|
1 | 1 | use rustc_errors::codes::*; |
2 | 2 | use rustc_errors::{ |
3 | | - Applicability, Diag, ElidedLifetimeInPathSubdiag, EmissionGuarantee, IntoDiagArg, MultiSpan, |
4 | | - Subdiagnostic, |
| 3 | + Applicability, Diag, DiagMessage, ElidedLifetimeInPathSubdiag, EmissionGuarantee, IntoDiagArg, |
| 4 | + LintDiagnostic, MultiSpan, Subdiagnostic, |
5 | 5 | }; |
6 | 6 | use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic}; |
7 | 7 | use rustc_span::{Ident, Span, Symbol}; |
@@ -1359,3 +1359,40 @@ pub(crate) struct UnusedMacroUse; |
1359 | 1359 | #[diag(resolve_macro_use_deprecated)] |
1360 | 1360 | #[help] |
1361 | 1361 | pub(crate) struct MacroUseDeprecated; |
| 1362 | + |
| 1363 | +#[derive(LintDiagnostic)] |
| 1364 | +#[diag(resolve_macro_is_private)] |
| 1365 | +pub(crate) struct MacroIsPrivate { |
| 1366 | + pub ident: Ident, |
| 1367 | +} |
| 1368 | + |
| 1369 | +#[derive(LintDiagnostic)] |
| 1370 | +#[diag(resolve_unused_macro_definition)] |
| 1371 | +pub(crate) struct UnusedMacroDefinition { |
| 1372 | + pub name: Symbol, |
| 1373 | +} |
| 1374 | + |
| 1375 | +#[derive(LintDiagnostic)] |
| 1376 | +#[diag(resolve_macro_rule_never_used)] |
| 1377 | +pub(crate) struct MacroRuleNeverUsed { |
| 1378 | + pub n: usize, |
| 1379 | + pub name: Symbol, |
| 1380 | +} |
| 1381 | + |
| 1382 | +pub(crate) struct UnstableFeature { |
| 1383 | + pub msg: DiagMessage, |
| 1384 | +} |
| 1385 | + |
| 1386 | +impl<'a> LintDiagnostic<'a, ()> for UnstableFeature { |
| 1387 | + fn decorate_lint<'b>(self, diag: &'b mut Diag<'a, ()>) { |
| 1388 | + diag.primary_message(self.msg); |
| 1389 | + } |
| 1390 | +} |
| 1391 | + |
| 1392 | +#[derive(LintDiagnostic)] |
| 1393 | +#[diag(resolve_extern_crate_not_idiomatic)] |
| 1394 | +pub(crate) struct ExternCrateNotIdiomatic { |
| 1395 | + #[suggestion(style = "verbose", code = "{code}", applicability = "machine-applicable")] |
| 1396 | + pub span: Span, |
| 1397 | + pub code: &'static str, |
| 1398 | +} |
0 commit comments