Replace #[lint/warning/error] with #[diag]

This commit is contained in:
Xiretza 2022-08-19 15:40:48 +02:00
parent bd0d3f745d
commit 7f3a6fd7f6
16 changed files with 446 additions and 390 deletions

View file

@ -3,7 +3,7 @@ use rustc_middle::ty::Ty;
use rustc_span::Span; use rustc_span::Span;
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(borrowck::move_unsized, code = "E0161")] #[diag(borrowck::move_unsized, code = "E0161")]
pub(crate) struct MoveUnsized<'tcx> { pub(crate) struct MoveUnsized<'tcx> {
pub ty: Ty<'tcx>, pub ty: Ty<'tcx>,
#[primary_span] #[primary_span]
@ -12,7 +12,7 @@ pub(crate) struct MoveUnsized<'tcx> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(borrowck::higher_ranked_lifetime_error)] #[diag(borrowck::higher_ranked_lifetime_error)]
pub(crate) struct HigherRankedLifetimeError { pub(crate) struct HigherRankedLifetimeError {
#[subdiagnostic] #[subdiagnostic]
pub cause: Option<HigherRankedErrorCause>, pub cause: Option<HigherRankedErrorCause>,
@ -29,14 +29,14 @@ pub(crate) enum HigherRankedErrorCause {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(borrowck::higher_ranked_subtype_error)] #[diag(borrowck::higher_ranked_subtype_error)]
pub(crate) struct HigherRankedSubtypeError { pub(crate) struct HigherRankedSubtypeError {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(borrowck::generic_does_not_live_long_enough)] #[diag(borrowck::generic_does_not_live_long_enough)]
pub(crate) struct GenericDoesNotLiveLongEnough { pub(crate) struct GenericDoesNotLiveLongEnough {
pub kind: String, pub kind: String,
#[primary_span] #[primary_span]

View file

@ -36,7 +36,7 @@ pub fn expand_cfg(
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(builtin_macros::requires_cfg_pattern)] #[diag(builtin_macros::requires_cfg_pattern)]
struct RequiresCfgPattern { struct RequiresCfgPattern {
#[primary_span] #[primary_span]
#[label] #[label]
@ -44,7 +44,7 @@ struct RequiresCfgPattern {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(builtin_macros::expected_one_cfg_pattern)] #[diag(builtin_macros::expected_one_cfg_pattern)]
struct OneCfgPattern { struct OneCfgPattern {
#[primary_span] #[primary_span]
span: Span, span: Span,

View file

@ -3,7 +3,7 @@ use rustc_macros::SessionDiagnostic;
use rustc_span::Span; use rustc_span::Span;
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(const_eval::unstable_in_stable)] #[diag(const_eval::unstable_in_stable)]
pub(crate) struct UnstableInStable { pub(crate) struct UnstableInStable {
pub gate: String, pub gate: String,
#[primary_span] #[primary_span]
@ -22,14 +22,14 @@ pub(crate) struct UnstableInStable {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(const_eval::thread_local_access, code = "E0625")] #[diag(const_eval::thread_local_access, code = "E0625")]
pub(crate) struct NonConstOpErr { pub(crate) struct NonConstOpErr {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(const_eval::static_access, code = "E0013")] #[diag(const_eval::static_access, code = "E0013")]
#[help] #[help]
pub(crate) struct StaticAccessErr { pub(crate) struct StaticAccessErr {
#[primary_span] #[primary_span]
@ -41,7 +41,7 @@ pub(crate) struct StaticAccessErr {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(const_eval::raw_ptr_to_int)] #[diag(const_eval::raw_ptr_to_int)]
#[note] #[note]
#[note(const_eval::note2)] #[note(const_eval::note2)]
pub(crate) struct RawPtrToIntErr { pub(crate) struct RawPtrToIntErr {
@ -50,7 +50,7 @@ pub(crate) struct RawPtrToIntErr {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(const_eval::raw_ptr_comparison)] #[diag(const_eval::raw_ptr_comparison)]
#[note] #[note]
pub(crate) struct RawPtrComparisonErr { pub(crate) struct RawPtrComparisonErr {
#[primary_span] #[primary_span]
@ -58,14 +58,14 @@ pub(crate) struct RawPtrComparisonErr {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(const_eval::panic_non_str)] #[diag(const_eval::panic_non_str)]
pub(crate) struct PanicNonStrErr { pub(crate) struct PanicNonStrErr {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(const_eval::mut_deref, code = "E0658")] #[diag(const_eval::mut_deref, code = "E0658")]
pub(crate) struct MutDerefErr { pub(crate) struct MutDerefErr {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -73,7 +73,7 @@ pub(crate) struct MutDerefErr {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(const_eval::transient_mut_borrow, code = "E0658")] #[diag(const_eval::transient_mut_borrow, code = "E0658")]
pub(crate) struct TransientMutBorrowErr { pub(crate) struct TransientMutBorrowErr {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -81,7 +81,7 @@ pub(crate) struct TransientMutBorrowErr {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(const_eval::transient_mut_borrow_raw, code = "E0658")] #[diag(const_eval::transient_mut_borrow_raw, code = "E0658")]
pub(crate) struct TransientMutBorrowErrRaw { pub(crate) struct TransientMutBorrowErrRaw {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,

View file

@ -3,28 +3,28 @@ use rustc_span::symbol::MacroRulesNormalizedIdent;
use rustc_span::Span; use rustc_span::Span;
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(expand::expr_repeat_no_syntax_vars)] #[diag(expand::expr_repeat_no_syntax_vars)]
pub(crate) struct NoSyntaxVarsExprRepeat { pub(crate) struct NoSyntaxVarsExprRepeat {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(expand::must_repeat_once)] #[diag(expand::must_repeat_once)]
pub(crate) struct MustRepeatOnce { pub(crate) struct MustRepeatOnce {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(expand::count_repetition_misplaced)] #[diag(expand::count_repetition_misplaced)]
pub(crate) struct CountRepetitionMisplaced { pub(crate) struct CountRepetitionMisplaced {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(expand::meta_var_expr_unrecognized_var)] #[diag(expand::meta_var_expr_unrecognized_var)]
pub(crate) struct MetaVarExprUnrecognizedVar { pub(crate) struct MetaVarExprUnrecognizedVar {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -32,7 +32,7 @@ pub(crate) struct MetaVarExprUnrecognizedVar {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(expand::var_still_repeating)] #[diag(expand::var_still_repeating)]
pub(crate) struct VarStillRepeating { pub(crate) struct VarStillRepeating {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -40,7 +40,7 @@ pub(crate) struct VarStillRepeating {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(expand::meta_var_dif_seq_matchers)] #[diag(expand::meta_var_dif_seq_matchers)]
pub(crate) struct MetaVarsDifSeqMatchers { pub(crate) struct MetaVarsDifSeqMatchers {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,

View file

@ -265,7 +265,7 @@ impl LintStoreExpand for LintStoreExpandImpl<'_> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(interface::ferris_identifier)] #[diag(interface::ferris_identifier)]
struct FerrisIdentifier { struct FerrisIdentifier {
#[primary_span] #[primary_span]
spans: Vec<Span>, spans: Vec<Span>,
@ -274,7 +274,7 @@ struct FerrisIdentifier {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(interface::emoji_identifier)] #[diag(interface::emoji_identifier)]
struct EmojiIdentifier { struct EmojiIdentifier {
#[primary_span] #[primary_span]
spans: Vec<Span>, spans: Vec<Span>,

View file

@ -1546,7 +1546,7 @@ impl InvalidAtomicOrdering {
if matches!(fail_ordering, sym::Release | sym::AcqRel) { if matches!(fail_ordering, sym::Release | sym::AcqRel) {
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(lint::atomic_ordering_invalid)] #[diag(lint::atomic_ordering_invalid)]
#[help] #[help]
struct InvalidAtomicOrderingDiag { struct InvalidAtomicOrderingDiag {
method: Symbol, method: Symbol,

View file

@ -141,7 +141,7 @@ impl DiagnosticDeriveBuilder {
let name = name.as_str(); let name = name.as_str();
let meta = attr.parse_meta()?; let meta = attr.parse_meta()?;
let is_diag = matches!(name, "error" | "warning" | "lint" | "diag"); let is_diag = name == "diag";
let nested = match meta { let nested = match meta {
// Most attributes are lists, like `#[diag(..)]` for most cases or // Most attributes are lists, like `#[diag(..)]` for most cases or
@ -163,20 +163,9 @@ impl DiagnosticDeriveBuilder {
// Check the kind before doing any further processing so that there aren't misleading // Check the kind before doing any further processing so that there aren't misleading
// "no kind specified" errors if there are failures later. // "no kind specified" errors if there are failures later.
match name { match name {
"error" | "warning" => { "error" | "warning" | "lint" => throw_invalid_attr!(attr, &meta, |diag| {
if self.kind == DiagnosticDeriveKind::LintDiagnostic { diag.help("`error`, `warning` and `lint` have been replaced by `diag`")
span_err(span, "only `#[lint(..)]` is supported") }),
.help("use the `#[lint(...)]` attribute to create a lint")
.emit();
}
}
"lint" => {
if self.kind == DiagnosticDeriveKind::SessionDiagnostic {
span_err(span, "only `#[error(..)]` and `#[warning(..)]` are supported")
.help("use the `#[error(...)]` attribute to create a error")
.emit();
}
}
"diag" | "help" | "note" | "warn_" => (), "diag" | "help" | "note" | "warn_" => (),
_ => throw_invalid_attr!(attr, &meta, |diag| { _ => throw_invalid_attr!(attr, &meta, |diag| {
diag.help("only `diag`, `help`, `note` and `warn_` are valid attributes") diag.help("only `diag`, `help`, `note` and `warn_` are valid attributes")

View file

@ -23,7 +23,7 @@ use synstructure::Structure;
/// # extern crate rust_middle; /// # extern crate rust_middle;
/// # use rustc_middle::ty::Ty; /// # use rustc_middle::ty::Ty;
/// #[derive(SessionDiagnostic)] /// #[derive(SessionDiagnostic)]
/// #[error(borrowck::move_out_of_borrow, code = "E0505")] /// #[diag(borrowck::move_out_of_borrow, code = "E0505")]
/// pub struct MoveOutOfBorrowError<'tcx> { /// pub struct MoveOutOfBorrowError<'tcx> {
/// pub name: Ident, /// pub name: Ident,
/// pub ty: Ty<'tcx>, /// pub ty: Ty<'tcx>,
@ -67,7 +67,7 @@ pub fn session_diagnostic_derive(s: Structure<'_>) -> TokenStream {
/// ///
/// ```ignore (rust) /// ```ignore (rust)
/// #[derive(LintDiagnostic)] /// #[derive(LintDiagnostic)]
/// #[lint(lint::atomic_ordering_invalid_fail_success)] /// #[diag(lint::atomic_ordering_invalid_fail_success)]
/// pub struct AtomicOrderingInvalidLint { /// pub struct AtomicOrderingInvalidLint {
/// method: Symbol, /// method: Symbol,
/// success_ordering: Symbol, /// success_ordering: Symbol,

View file

@ -129,9 +129,6 @@ decl_derive!([Lift, attributes(lift)] => lift::lift_derive);
decl_derive!( decl_derive!(
[SessionDiagnostic, attributes( [SessionDiagnostic, attributes(
// struct attributes // struct attributes
warning,
error,
lint,
diag, diag,
help, help,
note, note,
@ -149,9 +146,6 @@ decl_derive!(
decl_derive!( decl_derive!(
[LintDiagnostic, attributes( [LintDiagnostic, attributes(
// struct attributes // struct attributes
warning,
error,
lint,
diag, diag,
help, help,
note, note,

View file

@ -244,7 +244,7 @@ impl MultiSugg {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(parser::maybe_report_ambiguous_plus)] #[diag(parser::maybe_report_ambiguous_plus)]
struct AmbiguousPlus { struct AmbiguousPlus {
pub sum_ty: String, pub sum_ty: String,
#[primary_span] #[primary_span]
@ -253,7 +253,7 @@ struct AmbiguousPlus {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(parser::maybe_recover_from_bad_type_plus, code = "E0178")] #[diag(parser::maybe_recover_from_bad_type_plus, code = "E0178")]
struct BadTypePlus { struct BadTypePlus {
pub ty: String, pub ty: String,
#[primary_span] #[primary_span]
@ -287,7 +287,7 @@ pub enum BadTypePlusSub {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(parser::maybe_recover_from_bad_qpath_stage_2)] #[diag(parser::maybe_recover_from_bad_qpath_stage_2)]
struct BadQPathStage2 { struct BadQPathStage2 {
#[primary_span] #[primary_span]
#[suggestion(applicability = "maybe-incorrect")] #[suggestion(applicability = "maybe-incorrect")]
@ -296,7 +296,7 @@ struct BadQPathStage2 {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(parser::incorrect_semicolon)] #[diag(parser::incorrect_semicolon)]
struct IncorrectSemicolon<'a> { struct IncorrectSemicolon<'a> {
#[primary_span] #[primary_span]
#[suggestion_short(applicability = "machine-applicable")] #[suggestion_short(applicability = "machine-applicable")]
@ -307,7 +307,7 @@ struct IncorrectSemicolon<'a> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(parser::incorrect_use_of_await)] #[diag(parser::incorrect_use_of_await)]
struct IncorrectUseOfAwait { struct IncorrectUseOfAwait {
#[primary_span] #[primary_span]
#[suggestion(parser::parentheses_suggestion, applicability = "machine-applicable")] #[suggestion(parser::parentheses_suggestion, applicability = "machine-applicable")]
@ -315,7 +315,7 @@ struct IncorrectUseOfAwait {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(parser::incorrect_use_of_await)] #[diag(parser::incorrect_use_of_await)]
struct IncorrectAwait { struct IncorrectAwait {
#[primary_span] #[primary_span]
span: Span, span: Span,
@ -326,7 +326,7 @@ struct IncorrectAwait {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(parser::in_in_typo)] #[diag(parser::in_in_typo)]
struct InInTypo { struct InInTypo {
#[primary_span] #[primary_span]
span: Span, span: Span,
@ -335,7 +335,7 @@ struct InInTypo {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(parser::invalid_variable_declaration)] #[diag(parser::invalid_variable_declaration)]
pub struct InvalidVariableDeclaration { pub struct InvalidVariableDeclaration {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,

View file

@ -3,37 +3,37 @@ use rustc_macros::{LintDiagnostic, SessionDiagnostic, SessionSubdiagnostic};
use rustc_span::{Span, Symbol}; use rustc_span::{Span, Symbol};
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::outer_crate_level_attr)] #[diag(passes::outer_crate_level_attr)]
pub struct OuterCrateLevelAttr; pub struct OuterCrateLevelAttr;
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::inner_crate_level_attr)] #[diag(passes::inner_crate_level_attr)]
pub struct InnerCrateLevelAttr; pub struct InnerCrateLevelAttr;
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::ignored_attr_with_macro)] #[diag(passes::ignored_attr_with_macro)]
pub struct IgnoredAttrWithMacro<'a> { pub struct IgnoredAttrWithMacro<'a> {
pub sym: &'a str, pub sym: &'a str,
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::ignored_attr)] #[diag(passes::ignored_attr)]
pub struct IgnoredAttr<'a> { pub struct IgnoredAttr<'a> {
pub sym: &'a str, pub sym: &'a str,
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::inline_ignored_function_prototype)] #[diag(passes::inline_ignored_function_prototype)]
pub struct IgnoredInlineAttrFnProto; pub struct IgnoredInlineAttrFnProto;
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::inline_ignored_constants)] #[diag(passes::inline_ignored_constants)]
#[warn_] #[warn_]
#[note] #[note]
pub struct IgnoredInlineAttrConstants; pub struct IgnoredInlineAttrConstants;
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::inline_not_fn_or_closure, code = "E0518")] #[diag(passes::inline_not_fn_or_closure, code = "E0518")]
pub struct InlineNotFnOrClosure { pub struct InlineNotFnOrClosure {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -42,19 +42,19 @@ pub struct InlineNotFnOrClosure {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::no_coverage_ignored_function_prototype)] #[diag(passes::no_coverage_ignored_function_prototype)]
pub struct IgnoredNoCoverageFnProto; pub struct IgnoredNoCoverageFnProto;
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::no_coverage_propagate)] #[diag(passes::no_coverage_propagate)]
pub struct IgnoredNoCoveragePropagate; pub struct IgnoredNoCoveragePropagate;
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::no_coverage_fn_defn)] #[diag(passes::no_coverage_fn_defn)]
pub struct IgnoredNoCoverageFnDefn; pub struct IgnoredNoCoverageFnDefn;
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::no_coverage_not_coverable, code = "E0788")] #[diag(passes::no_coverage_not_coverable, code = "E0788")]
pub struct IgnoredNoCoverageNotCoverable { pub struct IgnoredNoCoverageNotCoverable {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -63,7 +63,7 @@ pub struct IgnoredNoCoverageNotCoverable {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::should_be_applied_to_fn)] #[diag(passes::should_be_applied_to_fn)]
pub struct AttrShouldBeAppliedToFn { pub struct AttrShouldBeAppliedToFn {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -72,14 +72,14 @@ pub struct AttrShouldBeAppliedToFn {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::naked_tracked_caller, code = "E0736")] #[diag(passes::naked_tracked_caller, code = "E0736")]
pub struct NakedTrackedCaller { pub struct NakedTrackedCaller {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::should_be_applied_to_fn, code = "E0739")] #[diag(passes::should_be_applied_to_fn, code = "E0739")]
pub struct TrackedCallerWrongLocation { pub struct TrackedCallerWrongLocation {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -88,7 +88,7 @@ pub struct TrackedCallerWrongLocation {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::should_be_applied_to_struct_enum, code = "E0701")] #[diag(passes::should_be_applied_to_struct_enum, code = "E0701")]
pub struct NonExhaustiveWrongLocation { pub struct NonExhaustiveWrongLocation {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -97,7 +97,7 @@ pub struct NonExhaustiveWrongLocation {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::should_be_applied_to_trait)] #[diag(passes::should_be_applied_to_trait)]
pub struct AttrShouldBeAppliedToTrait { pub struct AttrShouldBeAppliedToTrait {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -106,11 +106,11 @@ pub struct AttrShouldBeAppliedToTrait {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::target_feature_on_statement)] #[diag(passes::target_feature_on_statement)]
pub struct TargetFeatureOnStatement; pub struct TargetFeatureOnStatement;
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::should_be_applied_to_static)] #[diag(passes::should_be_applied_to_static)]
pub struct AttrShouldBeAppliedToStatic { pub struct AttrShouldBeAppliedToStatic {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -119,7 +119,7 @@ pub struct AttrShouldBeAppliedToStatic {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_expect_str)] #[diag(passes::doc_expect_str)]
pub struct DocExpectStr<'a> { pub struct DocExpectStr<'a> {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -127,7 +127,7 @@ pub struct DocExpectStr<'a> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_alias_empty)] #[diag(passes::doc_alias_empty)]
pub struct DocAliasEmpty<'a> { pub struct DocAliasEmpty<'a> {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -135,7 +135,7 @@ pub struct DocAliasEmpty<'a> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_alias_bad_char)] #[diag(passes::doc_alias_bad_char)]
pub struct DocAliasBadChar<'a> { pub struct DocAliasBadChar<'a> {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -144,7 +144,7 @@ pub struct DocAliasBadChar<'a> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_alias_start_end)] #[diag(passes::doc_alias_start_end)]
pub struct DocAliasStartEnd<'a> { pub struct DocAliasStartEnd<'a> {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -152,7 +152,7 @@ pub struct DocAliasStartEnd<'a> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_alias_bad_location)] #[diag(passes::doc_alias_bad_location)]
pub struct DocAliasBadLocation<'a> { pub struct DocAliasBadLocation<'a> {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -161,7 +161,7 @@ pub struct DocAliasBadLocation<'a> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_alias_not_an_alias)] #[diag(passes::doc_alias_not_an_alias)]
pub struct DocAliasNotAnAlias<'a> { pub struct DocAliasNotAnAlias<'a> {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -169,42 +169,42 @@ pub struct DocAliasNotAnAlias<'a> {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::doc_alias_duplicated)] #[diag(passes::doc_alias_duplicated)]
pub struct DocAliasDuplicated { pub struct DocAliasDuplicated {
#[label] #[label]
pub first_defn: Span, pub first_defn: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_alias_not_string_literal)] #[diag(passes::doc_alias_not_string_literal)]
pub struct DocAliasNotStringLiteral { pub struct DocAliasNotStringLiteral {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_alias_malformed)] #[diag(passes::doc_alias_malformed)]
pub struct DocAliasMalformed { pub struct DocAliasMalformed {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_keyword_empty_mod)] #[diag(passes::doc_keyword_empty_mod)]
pub struct DocKeywordEmptyMod { pub struct DocKeywordEmptyMod {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_keyword_not_mod)] #[diag(passes::doc_keyword_not_mod)]
pub struct DocKeywordNotMod { pub struct DocKeywordNotMod {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_keyword_invalid_ident)] #[diag(passes::doc_keyword_invalid_ident)]
pub struct DocKeywordInvalidIdent { pub struct DocKeywordInvalidIdent {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -212,21 +212,21 @@ pub struct DocKeywordInvalidIdent {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_fake_variadic_not_valid)] #[diag(passes::doc_fake_variadic_not_valid)]
pub struct DocFakeVariadicNotValid { pub struct DocFakeVariadicNotValid {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_keyword_only_impl)] #[diag(passes::doc_keyword_only_impl)]
pub struct DocKeywordOnlyImpl { pub struct DocKeywordOnlyImpl {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_inline_conflict)] #[diag(passes::doc_inline_conflict)]
#[help] #[help]
pub struct DocKeywordConflict { pub struct DocKeywordConflict {
#[primary_span] #[primary_span]
@ -234,7 +234,7 @@ pub struct DocKeywordConflict {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::doc_inline_only_use)] #[diag(passes::doc_inline_only_use)]
#[note] #[note]
pub struct DocInlineOnlyUse { pub struct DocInlineOnlyUse {
#[label] #[label]
@ -244,7 +244,7 @@ pub struct DocInlineOnlyUse {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::doc_attr_not_crate_level)] #[diag(passes::doc_attr_not_crate_level)]
pub struct DocAttrNotCrateLevel<'a> { pub struct DocAttrNotCrateLevel<'a> {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -252,27 +252,27 @@ pub struct DocAttrNotCrateLevel<'a> {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::doc_test_unknown)] #[diag(passes::doc_test_unknown)]
pub struct DocTestUnknown { pub struct DocTestUnknown {
pub path: String, pub path: String,
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::doc_test_takes_list)] #[diag(passes::doc_test_takes_list)]
pub struct DocTestTakesList; pub struct DocTestTakesList;
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::doc_primitive)] #[diag(passes::doc_primitive)]
pub struct DocPrimitive; pub struct DocPrimitive;
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::doc_test_unknown_any)] #[diag(passes::doc_test_unknown_any)]
pub struct DocTestUnknownAny { pub struct DocTestUnknownAny {
pub path: String, pub path: String,
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::doc_test_unknown_spotlight)] #[diag(passes::doc_test_unknown_spotlight)]
#[note] #[note]
#[note(passes::no_op_note)] #[note(passes::no_op_note)]
pub struct DocTestUnknownSpotlight { pub struct DocTestUnknownSpotlight {
@ -282,7 +282,7 @@ pub struct DocTestUnknownSpotlight {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::doc_test_unknown_include)] #[diag(passes::doc_test_unknown_include)]
pub struct DocTestUnknownInclude { pub struct DocTestUnknownInclude {
pub path: String, pub path: String,
pub value: String, pub value: String,
@ -292,11 +292,11 @@ pub struct DocTestUnknownInclude {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::doc_invalid)] #[diag(passes::doc_invalid)]
pub struct DocInvalid; pub struct DocInvalid;
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::pass_by_value)] #[diag(passes::pass_by_value)]
pub struct PassByValue { pub struct PassByValue {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -305,7 +305,7 @@ pub struct PassByValue {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::allow_incoherent_impl)] #[diag(passes::allow_incoherent_impl)]
pub struct AllowIncoherentImpl { pub struct AllowIncoherentImpl {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -314,7 +314,7 @@ pub struct AllowIncoherentImpl {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::has_incoherent_inherent_impl)] #[diag(passes::has_incoherent_inherent_impl)]
pub struct HasIncoherentInherentImpl { pub struct HasIncoherentInherentImpl {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -323,21 +323,21 @@ pub struct HasIncoherentInherentImpl {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::must_use_async)] #[diag(passes::must_use_async)]
pub struct MustUseAsync { pub struct MustUseAsync {
#[label] #[label]
pub span: Span, pub span: Span,
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::must_use_no_effect)] #[diag(passes::must_use_no_effect)]
pub struct MustUseNoEffect { pub struct MustUseNoEffect {
pub article: &'static str, pub article: &'static str,
pub target: rustc_hir::Target, pub target: rustc_hir::Target,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::must_not_suspend)] #[diag(passes::must_not_suspend)]
pub struct MustNotSuspend { pub struct MustNotSuspend {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -346,7 +346,7 @@ pub struct MustNotSuspend {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::cold)] #[diag(passes::cold)]
#[warn_] #[warn_]
pub struct Cold { pub struct Cold {
#[label] #[label]
@ -354,7 +354,7 @@ pub struct Cold {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::link)] #[diag(passes::link)]
#[warn_] #[warn_]
pub struct Link { pub struct Link {
#[label] #[label]
@ -362,7 +362,7 @@ pub struct Link {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::link_name)] #[diag(passes::link_name)]
#[warn_] #[warn_]
pub struct LinkName<'a> { pub struct LinkName<'a> {
#[help] #[help]
@ -373,7 +373,7 @@ pub struct LinkName<'a> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::no_link)] #[diag(passes::no_link)]
pub struct NoLink { pub struct NoLink {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -382,7 +382,7 @@ pub struct NoLink {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::export_name)] #[diag(passes::export_name)]
pub struct ExportName { pub struct ExportName {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -391,7 +391,7 @@ pub struct ExportName {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::rustc_layout_scalar_valid_range_not_struct)] #[diag(passes::rustc_layout_scalar_valid_range_not_struct)]
pub struct RustcLayoutScalarValidRangeNotStruct { pub struct RustcLayoutScalarValidRangeNotStruct {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -400,14 +400,14 @@ pub struct RustcLayoutScalarValidRangeNotStruct {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::rustc_layout_scalar_valid_range_arg)] #[diag(passes::rustc_layout_scalar_valid_range_arg)]
pub struct RustcLayoutScalarValidRangeArg { pub struct RustcLayoutScalarValidRangeArg {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::rustc_legacy_const_generics_only)] #[diag(passes::rustc_legacy_const_generics_only)]
pub struct RustcLegacyConstGenericsOnly { pub struct RustcLegacyConstGenericsOnly {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -416,7 +416,7 @@ pub struct RustcLegacyConstGenericsOnly {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::rustc_legacy_const_generics_index)] #[diag(passes::rustc_legacy_const_generics_index)]
pub struct RustcLegacyConstGenericsIndex { pub struct RustcLegacyConstGenericsIndex {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -425,7 +425,7 @@ pub struct RustcLegacyConstGenericsIndex {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::rustc_legacy_const_generics_index_exceed)] #[diag(passes::rustc_legacy_const_generics_index_exceed)]
pub struct RustcLegacyConstGenericsIndexExceed { pub struct RustcLegacyConstGenericsIndexExceed {
#[primary_span] #[primary_span]
#[label] #[label]
@ -434,21 +434,21 @@ pub struct RustcLegacyConstGenericsIndexExceed {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::rustc_legacy_const_generics_index_negative)] #[diag(passes::rustc_legacy_const_generics_index_negative)]
pub struct RustcLegacyConstGenericsIndexNegative { pub struct RustcLegacyConstGenericsIndexNegative {
#[primary_span] #[primary_span]
pub invalid_args: Vec<Span>, pub invalid_args: Vec<Span>,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::rustc_dirty_clean)] #[diag(passes::rustc_dirty_clean)]
pub struct RustcDirtyClean { pub struct RustcDirtyClean {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::link_section)] #[diag(passes::link_section)]
#[warn_] #[warn_]
pub struct LinkSection { pub struct LinkSection {
#[label] #[label]
@ -456,7 +456,7 @@ pub struct LinkSection {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::no_mangle_foreign)] #[diag(passes::no_mangle_foreign)]
#[warn_] #[warn_]
#[note] #[note]
pub struct NoMangleForeign { pub struct NoMangleForeign {
@ -468,7 +468,7 @@ pub struct NoMangleForeign {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::no_mangle)] #[diag(passes::no_mangle)]
#[warn_] #[warn_]
pub struct NoMangle { pub struct NoMangle {
#[label] #[label]
@ -476,32 +476,32 @@ pub struct NoMangle {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::repr_ident, code = "E0565")] #[diag(passes::repr_ident, code = "E0565")]
pub struct ReprIdent { pub struct ReprIdent {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::repr_conflicting, code = "E0566")] #[diag(passes::repr_conflicting, code = "E0566")]
pub struct ReprConflicting; pub struct ReprConflicting;
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::used_static)] #[diag(passes::used_static)]
pub struct UsedStatic { pub struct UsedStatic {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::used_compiler_linker)] #[diag(passes::used_compiler_linker)]
pub struct UsedCompilerLinker { pub struct UsedCompilerLinker {
#[primary_span] #[primary_span]
pub spans: Vec<Span>, pub spans: Vec<Span>,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::allow_internal_unstable)] #[diag(passes::allow_internal_unstable)]
pub struct AllowInternalUnstable { pub struct AllowInternalUnstable {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -510,14 +510,14 @@ pub struct AllowInternalUnstable {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::debug_visualizer_placement)] #[diag(passes::debug_visualizer_placement)]
pub struct DebugVisualizerPlacement { pub struct DebugVisualizerPlacement {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::debug_visualizer_invalid)] #[diag(passes::debug_visualizer_invalid)]
#[note(passes::note_1)] #[note(passes::note_1)]
#[note(passes::note_2)] #[note(passes::note_2)]
#[note(passes::note_3)] #[note(passes::note_3)]
@ -527,7 +527,7 @@ pub struct DebugVisualizerInvalid {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::rustc_allow_const_fn_unstable)] #[diag(passes::rustc_allow_const_fn_unstable)]
pub struct RustcAllowConstFnUnstable { pub struct RustcAllowConstFnUnstable {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -536,7 +536,7 @@ pub struct RustcAllowConstFnUnstable {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::rustc_std_internal_symbol)] #[diag(passes::rustc_std_internal_symbol)]
pub struct RustcStdInternalSymbol { pub struct RustcStdInternalSymbol {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -545,42 +545,42 @@ pub struct RustcStdInternalSymbol {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::const_trait)] #[diag(passes::const_trait)]
pub struct ConstTrait { pub struct ConstTrait {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::link_ordinal)] #[diag(passes::link_ordinal)]
pub struct LinkOrdinal { pub struct LinkOrdinal {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::stability_promotable)] #[diag(passes::stability_promotable)]
pub struct StabilityPromotable { pub struct StabilityPromotable {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::deprecated)] #[diag(passes::deprecated)]
pub struct Deprecated; pub struct Deprecated;
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::macro_use)] #[diag(passes::macro_use)]
pub struct MacroUse { pub struct MacroUse {
pub name: Symbol, pub name: Symbol,
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::macro_export)] #[diag(passes::macro_export)]
pub struct MacroExport; pub struct MacroExport;
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::plugin_registrar)] #[diag(passes::plugin_registrar)]
pub struct PluginRegistrar; pub struct PluginRegistrar;
#[derive(SessionSubdiagnostic)] #[derive(SessionSubdiagnostic)]
@ -594,7 +594,7 @@ pub enum UnusedNote {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::unused)] #[diag(passes::unused)]
pub struct Unused { pub struct Unused {
#[suggestion(applicability = "machine-applicable")] #[suggestion(applicability = "machine-applicable")]
pub attr_span: Span, pub attr_span: Span,
@ -603,7 +603,7 @@ pub struct Unused {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::non_exported_macro_invalid_attrs, code = "E0518")] #[diag(passes::non_exported_macro_invalid_attrs, code = "E0518")]
pub struct NonExportedMacroInvalidAttrs { pub struct NonExportedMacroInvalidAttrs {
#[primary_span] #[primary_span]
#[label] #[label]
@ -611,7 +611,7 @@ pub struct NonExportedMacroInvalidAttrs {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(passes::unused_duplicate)] #[diag(passes::unused_duplicate)]
pub struct UnusedDuplicate { pub struct UnusedDuplicate {
#[suggestion(code = "", applicability = "machine-applicable")] #[suggestion(code = "", applicability = "machine-applicable")]
pub this: Span, pub this: Span,
@ -622,7 +622,7 @@ pub struct UnusedDuplicate {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::unused_multiple)] #[diag(passes::unused_multiple)]
pub struct UnusedMultiple { pub struct UnusedMultiple {
#[primary_span] #[primary_span]
#[suggestion(code = "", applicability = "machine-applicable")] #[suggestion(code = "", applicability = "machine-applicable")]
@ -633,7 +633,7 @@ pub struct UnusedMultiple {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::rustc_lint_opt_ty)] #[diag(passes::rustc_lint_opt_ty)]
pub struct RustcLintOptTy { pub struct RustcLintOptTy {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,
@ -642,7 +642,7 @@ pub struct RustcLintOptTy {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(passes::rustc_lint_opt_deny_field_access)] #[diag(passes::rustc_lint_opt_deny_field_access)]
pub struct RustcLintOptDenyFieldAccess { pub struct RustcLintOptDenyFieldAccess {
#[primary_span] #[primary_span]
pub attr_span: Span, pub attr_span: Span,

View file

@ -3,7 +3,7 @@ use rustc_macros::{LintDiagnostic, SessionDiagnostic, SessionSubdiagnostic};
use rustc_span::{Span, Symbol}; use rustc_span::{Span, Symbol};
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(privacy::field_is_private, code = "E0451")] #[diag(privacy::field_is_private, code = "E0451")]
pub struct FieldIsPrivate { pub struct FieldIsPrivate {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -30,7 +30,7 @@ pub enum FieldIsPrivateLabel {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(privacy::item_is_private)] #[diag(privacy::item_is_private)]
pub struct ItemIsPrivate<'a> { pub struct ItemIsPrivate<'a> {
#[primary_span] #[primary_span]
#[label] #[label]
@ -40,7 +40,7 @@ pub struct ItemIsPrivate<'a> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(privacy::unnamed_item_is_private)] #[diag(privacy::unnamed_item_is_private)]
pub struct UnnamedItemIsPrivate { pub struct UnnamedItemIsPrivate {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -49,7 +49,7 @@ pub struct UnnamedItemIsPrivate {
// Duplicate of `InPublicInterface` but with a different error code, shares the same slug. // Duplicate of `InPublicInterface` but with a different error code, shares the same slug.
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(privacy::in_public_interface, code = "E0445")] #[diag(privacy::in_public_interface, code = "E0445")]
pub struct InPublicInterfaceTraits<'a> { pub struct InPublicInterfaceTraits<'a> {
#[primary_span] #[primary_span]
#[label] #[label]
@ -63,7 +63,7 @@ pub struct InPublicInterfaceTraits<'a> {
// Duplicate of `InPublicInterfaceTraits` but with a different error code, shares the same slug. // Duplicate of `InPublicInterfaceTraits` but with a different error code, shares the same slug.
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(privacy::in_public_interface, code = "E0446")] #[diag(privacy::in_public_interface, code = "E0446")]
pub struct InPublicInterface<'a> { pub struct InPublicInterface<'a> {
#[primary_span] #[primary_span]
#[label] #[label]
@ -76,7 +76,7 @@ pub struct InPublicInterface<'a> {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(privacy::from_private_dep_in_public_interface)] #[diag(privacy::from_private_dep_in_public_interface)]
pub struct FromPrivateDependencyInPublicInterface<'a> { pub struct FromPrivateDependencyInPublicInterface<'a> {
pub kind: &'a str, pub kind: &'a str,
pub descr: DiagnosticArgFromDisplay<'a>, pub descr: DiagnosticArgFromDisplay<'a>,
@ -84,7 +84,7 @@ pub struct FromPrivateDependencyInPublicInterface<'a> {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(privacy::private_in_public_lint)] #[diag(privacy::private_in_public_lint)]
pub struct PrivateInPublicLint<'a> { pub struct PrivateInPublicLint<'a> {
pub vis_descr: &'static str, pub vis_descr: &'static str,
pub kind: &'a str, pub kind: &'a str,

View file

@ -6,7 +6,7 @@ use rustc_session::{parse::ParseSess, SessionDiagnostic};
use rustc_span::{symbol::Ident, Span, Symbol}; use rustc_span::{symbol::Ident, Span, Symbol};
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::field_multiply_specified_in_initializer, code = "E0062")] #[diag(typeck::field_multiply_specified_in_initializer, code = "E0062")]
pub struct FieldMultiplySpecifiedInInitializer { pub struct FieldMultiplySpecifiedInInitializer {
#[primary_span] #[primary_span]
#[label] #[label]
@ -17,7 +17,7 @@ pub struct FieldMultiplySpecifiedInInitializer {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::unrecognized_atomic_operation, code = "E0092")] #[diag(typeck::unrecognized_atomic_operation, code = "E0092")]
pub struct UnrecognizedAtomicOperation<'a> { pub struct UnrecognizedAtomicOperation<'a> {
#[primary_span] #[primary_span]
#[label] #[label]
@ -26,7 +26,7 @@ pub struct UnrecognizedAtomicOperation<'a> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::wrong_number_of_generic_arguments_to_intrinsic, code = "E0094")] #[diag(typeck::wrong_number_of_generic_arguments_to_intrinsic, code = "E0094")]
pub struct WrongNumberOfGenericArgumentsToIntrinsic<'a> { pub struct WrongNumberOfGenericArgumentsToIntrinsic<'a> {
#[primary_span] #[primary_span]
#[label] #[label]
@ -37,7 +37,7 @@ pub struct WrongNumberOfGenericArgumentsToIntrinsic<'a> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::unrecognized_intrinsic_function, code = "E0093")] #[diag(typeck::unrecognized_intrinsic_function, code = "E0093")]
pub struct UnrecognizedIntrinsicFunction { pub struct UnrecognizedIntrinsicFunction {
#[primary_span] #[primary_span]
#[label] #[label]
@ -46,7 +46,7 @@ pub struct UnrecognizedIntrinsicFunction {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::lifetimes_or_bounds_mismatch_on_trait, code = "E0195")] #[diag(typeck::lifetimes_or_bounds_mismatch_on_trait, code = "E0195")]
pub struct LifetimesOrBoundsMismatchOnTrait { pub struct LifetimesOrBoundsMismatchOnTrait {
#[primary_span] #[primary_span]
#[label] #[label]
@ -58,7 +58,7 @@ pub struct LifetimesOrBoundsMismatchOnTrait {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::drop_impl_on_wrong_item, code = "E0120")] #[diag(typeck::drop_impl_on_wrong_item, code = "E0120")]
pub struct DropImplOnWrongItem { pub struct DropImplOnWrongItem {
#[primary_span] #[primary_span]
#[label] #[label]
@ -66,7 +66,7 @@ pub struct DropImplOnWrongItem {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::field_already_declared, code = "E0124")] #[diag(typeck::field_already_declared, code = "E0124")]
pub struct FieldAlreadyDeclared { pub struct FieldAlreadyDeclared {
pub field_name: Ident, pub field_name: Ident,
#[primary_span] #[primary_span]
@ -77,7 +77,7 @@ pub struct FieldAlreadyDeclared {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::copy_impl_on_type_with_dtor, code = "E0184")] #[diag(typeck::copy_impl_on_type_with_dtor, code = "E0184")]
pub struct CopyImplOnTypeWithDtor { pub struct CopyImplOnTypeWithDtor {
#[primary_span] #[primary_span]
#[label] #[label]
@ -85,14 +85,14 @@ pub struct CopyImplOnTypeWithDtor {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::multiple_relaxed_default_bounds, code = "E0203")] #[diag(typeck::multiple_relaxed_default_bounds, code = "E0203")]
pub struct MultipleRelaxedDefaultBounds { pub struct MultipleRelaxedDefaultBounds {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::copy_impl_on_non_adt, code = "E0206")] #[diag(typeck::copy_impl_on_non_adt, code = "E0206")]
pub struct CopyImplOnNonAdt { pub struct CopyImplOnNonAdt {
#[primary_span] #[primary_span]
#[label] #[label]
@ -100,7 +100,7 @@ pub struct CopyImplOnNonAdt {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::trait_object_declared_with_no_traits, code = "E0224")] #[diag(typeck::trait_object_declared_with_no_traits, code = "E0224")]
pub struct TraitObjectDeclaredWithNoTraits { pub struct TraitObjectDeclaredWithNoTraits {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -109,14 +109,14 @@ pub struct TraitObjectDeclaredWithNoTraits {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0227")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0227")]
pub struct AmbiguousLifetimeBound { pub struct AmbiguousLifetimeBound {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::assoc_type_binding_not_allowed, code = "E0229")] #[diag(typeck::assoc_type_binding_not_allowed, code = "E0229")]
pub struct AssocTypeBindingNotAllowed { pub struct AssocTypeBindingNotAllowed {
#[primary_span] #[primary_span]
#[label] #[label]
@ -124,14 +124,14 @@ pub struct AssocTypeBindingNotAllowed {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::functional_record_update_on_non_struct, code = "E0436")] #[diag(typeck::functional_record_update_on_non_struct, code = "E0436")]
pub struct FunctionalRecordUpdateOnNonStruct { pub struct FunctionalRecordUpdateOnNonStruct {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::typeof_reserved_keyword_used, code = "E0516")] #[diag(typeck::typeof_reserved_keyword_used, code = "E0516")]
pub struct TypeofReservedKeywordUsed<'tcx> { pub struct TypeofReservedKeywordUsed<'tcx> {
pub ty: Ty<'tcx>, pub ty: Ty<'tcx>,
#[primary_span] #[primary_span]
@ -142,7 +142,7 @@ pub struct TypeofReservedKeywordUsed<'tcx> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::return_stmt_outside_of_fn_body, code = "E0572")] #[diag(typeck::return_stmt_outside_of_fn_body, code = "E0572")]
pub struct ReturnStmtOutsideOfFnBody { pub struct ReturnStmtOutsideOfFnBody {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -153,14 +153,14 @@ pub struct ReturnStmtOutsideOfFnBody {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::yield_expr_outside_of_generator, code = "E0627")] #[diag(typeck::yield_expr_outside_of_generator, code = "E0627")]
pub struct YieldExprOutsideOfGenerator { pub struct YieldExprOutsideOfGenerator {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::struct_expr_non_exhaustive, code = "E0639")] #[diag(typeck::struct_expr_non_exhaustive, code = "E0639")]
pub struct StructExprNonExhaustive { pub struct StructExprNonExhaustive {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -168,14 +168,14 @@ pub struct StructExprNonExhaustive {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::method_call_on_unknown_type, code = "E0699")] #[diag(typeck::method_call_on_unknown_type, code = "E0699")]
pub struct MethodCallOnUnknownType { pub struct MethodCallOnUnknownType {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::value_of_associated_struct_already_specified, code = "E0719")] #[diag(typeck::value_of_associated_struct_already_specified, code = "E0719")]
pub struct ValueOfAssociatedStructAlreadySpecified { pub struct ValueOfAssociatedStructAlreadySpecified {
#[primary_span] #[primary_span]
#[label] #[label]
@ -187,7 +187,7 @@ pub struct ValueOfAssociatedStructAlreadySpecified {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::address_of_temporary_taken, code = "E0745")] #[diag(typeck::address_of_temporary_taken, code = "E0745")]
pub struct AddressOfTemporaryTaken { pub struct AddressOfTemporaryTaken {
#[primary_span] #[primary_span]
#[label] #[label]
@ -233,7 +233,7 @@ pub enum ExpectedReturnTypeLabel<'tcx> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::unconstrained_opaque_type)] #[diag(typeck::unconstrained_opaque_type)]
#[note] #[note]
pub struct UnconstrainedOpaqueType { pub struct UnconstrainedOpaqueType {
#[primary_span] #[primary_span]
@ -309,7 +309,7 @@ impl<'a> SessionDiagnostic<'a> for MissingTypeParams {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::manual_implementation, code = "E0183")] #[diag(typeck::manual_implementation, code = "E0183")]
#[help] #[help]
pub struct ManualImplementation { pub struct ManualImplementation {
#[primary_span] #[primary_span]
@ -319,21 +319,21 @@ pub struct ManualImplementation {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::substs_on_overridden_impl)] #[diag(typeck::substs_on_overridden_impl)]
pub struct SubstsOnOverriddenImpl { pub struct SubstsOnOverriddenImpl {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(typeck::unused_extern_crate)] #[diag(typeck::unused_extern_crate)]
pub struct UnusedExternCrate { pub struct UnusedExternCrate {
#[suggestion(applicability = "machine-applicable", code = "")] #[suggestion(applicability = "machine-applicable", code = "")]
pub span: Span, pub span: Span,
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(typeck::extern_crate_not_idiomatic)] #[diag(typeck::extern_crate_not_idiomatic)]
pub struct ExternCrateNotIdiomatic { pub struct ExternCrateNotIdiomatic {
#[suggestion_short(applicability = "machine-applicable", code = "{suggestion_code}")] #[suggestion_short(applicability = "machine-applicable", code = "{suggestion_code}")]
pub span: Span, pub span: Span,
@ -342,7 +342,7 @@ pub struct ExternCrateNotIdiomatic {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::expected_used_symbol)] #[diag(typeck::expected_used_symbol)]
pub struct ExpectedUsedSymbol { pub struct ExpectedUsedSymbol {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,

View file

@ -16,7 +16,7 @@ use rustc_session::{parse::ParseSess, SessionDiagnostic};
use rustc_span::Span; use rustc_span::Span;
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(parser::expect_path)] #[diag(parser::expect_path)]
struct DeriveSessionDiagnostic { struct DeriveSessionDiagnostic {
#[primary_span] #[primary_span]
span: Span, span: Span,

View file

@ -28,15 +28,15 @@ use rustc_errors::{Applicability, MultiSpan};
extern crate rustc_session; extern crate rustc_session;
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct Hello {} struct Hello {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[warning(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct HelloWarn {} struct HelloWarn {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
//~^ ERROR `#[derive(SessionDiagnostic)]` can only be used on structs //~^ ERROR `#[derive(SessionDiagnostic)]` can only be used on structs
enum SessionDiagnosticOnEnum { enum SessionDiagnosticOnEnum {
Foo, Foo,
@ -44,9 +44,9 @@ enum SessionDiagnosticOnEnum {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
#[error = "E0123"] #[diag = "E0123"]
//~^ ERROR `#[error = ...]` is not a valid attribute //~^ ERROR `#[diag = ...]` is not a valid attribute
struct WrongStructAttrStyle {} struct WrongStructAttrStyle {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
@ -57,41 +57,41 @@ struct WrongStructAttrStyle {}
struct InvalidStructAttr {} struct InvalidStructAttr {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error("E0123")] #[diag("E0123")]
//~^ ERROR `#[error("...")]` is not a valid attribute //~^ ERROR `#[diag("...")]` is not a valid attribute
//~^^ ERROR diagnostic slug not specified //~^^ ERROR diagnostic slug not specified
struct InvalidLitNestedAttr {} struct InvalidLitNestedAttr {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(nonsense, code = "E0123")] #[diag(nonsense, code = "E0123")]
//~^ ERROR cannot find value `nonsense` in module `rustc_errors::fluent` //~^ ERROR cannot find value `nonsense` in module `rustc_errors::fluent`
struct InvalidNestedStructAttr {} struct InvalidNestedStructAttr {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(nonsense("foo"), code = "E0123", slug = "foo")] #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
//~^ ERROR `#[error(nonsense(...))]` is not a valid attribute //~^ ERROR `#[diag(nonsense(...))]` is not a valid attribute
//~^^ ERROR diagnostic slug not specified //~^^ ERROR diagnostic slug not specified
struct InvalidNestedStructAttr1 {} struct InvalidNestedStructAttr1 {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(nonsense = "...", code = "E0123", slug = "foo")] #[diag(nonsense = "...", code = "E0123", slug = "foo")]
//~^ ERROR `#[error(nonsense = ...)]` is not a valid attribute //~^ ERROR `#[diag(nonsense = ...)]` is not a valid attribute
//~^^ ERROR diagnostic slug not specified //~^^ ERROR diagnostic slug not specified
struct InvalidNestedStructAttr2 {} struct InvalidNestedStructAttr2 {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(nonsense = 4, code = "E0123", slug = "foo")] #[diag(nonsense = 4, code = "E0123", slug = "foo")]
//~^ ERROR `#[error(nonsense = ...)]` is not a valid attribute //~^ ERROR `#[diag(nonsense = ...)]` is not a valid attribute
//~^^ ERROR diagnostic slug not specified //~^^ ERROR diagnostic slug not specified
struct InvalidNestedStructAttr3 {} struct InvalidNestedStructAttr3 {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123", slug = "foo")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123", slug = "foo")]
//~^ ERROR `#[error(slug = ...)]` is not a valid attribute //~^ ERROR `#[diag(slug = ...)]` is not a valid attribute
struct InvalidNestedStructAttr4 {} struct InvalidNestedStructAttr4 {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct WrongPlaceField { struct WrongPlaceField {
#[suggestion = "bar"] #[suggestion = "bar"]
//~^ ERROR `#[suggestion = ...]` is not a valid attribute //~^ ERROR `#[suggestion = ...]` is not a valid attribute
@ -99,43 +99,36 @@ struct WrongPlaceField {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
#[error(typeck::ambiguous_lifetime_bound, code = "E0456")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0456")]
//~^ ERROR specified multiple times //~^ ERROR specified multiple times
//~^^ ERROR specified multiple times //~^^ ERROR specified multiple times
struct ErrorSpecifiedTwice {} struct DiagSpecifiedTwice {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")]
#[warning(typeck::ambiguous_lifetime_bound, code = "E0293")]
//~^ ERROR specified multiple times
//~^^ ERROR specified multiple times
struct WarnSpecifiedAfterError {}
#[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")]
//~^ ERROR specified multiple times //~^ ERROR specified multiple times
struct CodeSpecifiedTwice {} struct CodeSpecifiedTwice {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, typeck::ambiguous_lifetime_bound, code = "E0456")] #[diag(typeck::ambiguous_lifetime_bound, typeck::ambiguous_lifetime_bound, code = "E0456")]
//~^ ERROR `#[error(typeck::ambiguous_lifetime_bound)]` is not a valid attribute //~^ ERROR `#[diag(typeck::ambiguous_lifetime_bound)]` is not a valid attribute
struct SlugSpecifiedTwice {} struct SlugSpecifiedTwice {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
struct KindNotProvided {} //~ ERROR diagnostic slug not specified struct KindNotProvided {} //~ ERROR diagnostic slug not specified
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(code = "E0456")] #[diag(code = "E0456")]
//~^ ERROR diagnostic slug not specified //~^ ERROR diagnostic slug not specified
struct SlugNotProvided {} struct SlugNotProvided {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound)] #[diag(typeck::ambiguous_lifetime_bound)]
struct CodeNotProvided {} struct CodeNotProvided {}
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct MessageWrongType { struct MessageWrongType {
#[primary_span] #[primary_span]
//~^ ERROR `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan` //~^ ERROR `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
@ -143,7 +136,7 @@ struct MessageWrongType {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct InvalidPathFieldAttr { struct InvalidPathFieldAttr {
#[nonsense] #[nonsense]
//~^ ERROR `#[nonsense]` is not a valid attribute //~^ ERROR `#[nonsense]` is not a valid attribute
@ -152,7 +145,7 @@ struct InvalidPathFieldAttr {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorWithField { struct ErrorWithField {
name: String, name: String,
#[label(typeck::label)] #[label(typeck::label)]
@ -160,7 +153,7 @@ struct ErrorWithField {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorWithMessageAppliedToField { struct ErrorWithMessageAppliedToField {
#[label(typeck::label)] #[label(typeck::label)]
//~^ ERROR the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` //~^ ERROR the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
@ -168,7 +161,7 @@ struct ErrorWithMessageAppliedToField {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorWithNonexistentField { struct ErrorWithNonexistentField {
#[suggestion(typeck::suggestion, code = "{name}")] #[suggestion(typeck::suggestion, code = "{name}")]
//~^ ERROR `name` doesn't refer to a field on this type //~^ ERROR `name` doesn't refer to a field on this type
@ -177,7 +170,7 @@ struct ErrorWithNonexistentField {
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
//~^ ERROR invalid format string: expected `'}'` //~^ ERROR invalid format string: expected `'}'`
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorMissingClosingBrace { struct ErrorMissingClosingBrace {
#[suggestion(typeck::suggestion, code = "{name")] #[suggestion(typeck::suggestion, code = "{name")]
suggestion: (Span, Applicability), suggestion: (Span, Applicability),
@ -187,7 +180,7 @@ struct ErrorMissingClosingBrace {
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
//~^ ERROR invalid format string: unmatched `}` //~^ ERROR invalid format string: unmatched `}`
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorMissingOpeningBrace { struct ErrorMissingOpeningBrace {
#[suggestion(typeck::suggestion, code = "name}")] #[suggestion(typeck::suggestion, code = "name}")]
suggestion: (Span, Applicability), suggestion: (Span, Applicability),
@ -196,14 +189,14 @@ struct ErrorMissingOpeningBrace {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct LabelOnSpan { struct LabelOnSpan {
#[label(typeck::label)] #[label(typeck::label)]
sp: Span, sp: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct LabelOnNonSpan { struct LabelOnNonSpan {
#[label(typeck::label)] #[label(typeck::label)]
//~^ ERROR the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` //~^ ERROR the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
@ -211,7 +204,7 @@ struct LabelOnNonSpan {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct Suggest { struct Suggest {
#[suggestion(typeck::suggestion, code = "This is the suggested code")] #[suggestion(typeck::suggestion, code = "This is the suggested code")]
#[suggestion_short(typeck::suggestion, code = "This is the suggested code")] #[suggestion_short(typeck::suggestion, code = "This is the suggested code")]
@ -221,14 +214,14 @@ struct Suggest {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct SuggestWithoutCode { struct SuggestWithoutCode {
#[suggestion(typeck::suggestion)] #[suggestion(typeck::suggestion)]
suggestion: (Span, Applicability), suggestion: (Span, Applicability),
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct SuggestWithBadKey { struct SuggestWithBadKey {
#[suggestion(nonsense = "bar")] #[suggestion(nonsense = "bar")]
//~^ ERROR `#[suggestion(nonsense = ...)]` is not a valid attribute //~^ ERROR `#[suggestion(nonsense = ...)]` is not a valid attribute
@ -236,7 +229,7 @@ struct SuggestWithBadKey {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct SuggestWithShorthandMsg { struct SuggestWithShorthandMsg {
#[suggestion(msg = "bar")] #[suggestion(msg = "bar")]
//~^ ERROR `#[suggestion(msg = ...)]` is not a valid attribute //~^ ERROR `#[suggestion(msg = ...)]` is not a valid attribute
@ -244,21 +237,21 @@ struct SuggestWithShorthandMsg {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct SuggestWithoutMsg { struct SuggestWithoutMsg {
#[suggestion(code = "bar")] #[suggestion(code = "bar")]
suggestion: (Span, Applicability), suggestion: (Span, Applicability),
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct SuggestWithTypesSwapped { struct SuggestWithTypesSwapped {
#[suggestion(typeck::suggestion, code = "This is suggested code")] #[suggestion(typeck::suggestion, code = "This is suggested code")]
suggestion: (Applicability, Span), suggestion: (Applicability, Span),
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct SuggestWithWrongTypeApplicabilityOnly { struct SuggestWithWrongTypeApplicabilityOnly {
#[suggestion(typeck::suggestion, code = "This is suggested code")] #[suggestion(typeck::suggestion, code = "This is suggested code")]
//~^ ERROR wrong field type for suggestion //~^ ERROR wrong field type for suggestion
@ -266,14 +259,14 @@ struct SuggestWithWrongTypeApplicabilityOnly {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct SuggestWithSpanOnly { struct SuggestWithSpanOnly {
#[suggestion(typeck::suggestion, code = "This is suggested code")] #[suggestion(typeck::suggestion, code = "This is suggested code")]
suggestion: Span, suggestion: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct SuggestWithDuplicateSpanAndApplicability { struct SuggestWithDuplicateSpanAndApplicability {
#[suggestion(typeck::suggestion, code = "This is suggested code")] #[suggestion(typeck::suggestion, code = "This is suggested code")]
//~^ ERROR type of field annotated with `#[suggestion(...)]` contains more than one `Span` //~^ ERROR type of field annotated with `#[suggestion(...)]` contains more than one `Span`
@ -281,7 +274,7 @@ struct SuggestWithDuplicateSpanAndApplicability {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct SuggestWithDuplicateApplicabilityAndSpan { struct SuggestWithDuplicateApplicabilityAndSpan {
#[suggestion(typeck::suggestion, code = "This is suggested code")] #[suggestion(typeck::suggestion, code = "This is suggested code")]
//~^ ERROR type of field annotated with `#[suggestion(...)]` contains more than one //~^ ERROR type of field annotated with `#[suggestion(...)]` contains more than one
@ -289,7 +282,7 @@ struct SuggestWithDuplicateApplicabilityAndSpan {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct WrongKindOfAnnotation { struct WrongKindOfAnnotation {
#[label = "bar"] #[label = "bar"]
//~^ ERROR `#[label = ...]` is not a valid attribute //~^ ERROR `#[label = ...]` is not a valid attribute
@ -297,7 +290,7 @@ struct WrongKindOfAnnotation {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct OptionsInErrors { struct OptionsInErrors {
#[label(typeck::label)] #[label(typeck::label)]
label: Option<Span>, label: Option<Span>,
@ -306,7 +299,7 @@ struct OptionsInErrors {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0456")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0456")]
struct MoveOutOfBorrowError<'tcx> { struct MoveOutOfBorrowError<'tcx> {
name: Ident, name: Ident,
ty: Ty<'tcx>, ty: Ty<'tcx>,
@ -320,7 +313,7 @@ struct MoveOutOfBorrowError<'tcx> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorWithLifetime<'a> { struct ErrorWithLifetime<'a> {
#[label(typeck::label)] #[label(typeck::label)]
span: Span, span: Span,
@ -328,7 +321,7 @@ struct ErrorWithLifetime<'a> {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorWithDefaultLabelAttr<'a> { struct ErrorWithDefaultLabelAttr<'a> {
#[label] #[label]
span: Span, span: Span,
@ -337,7 +330,7 @@ struct ErrorWithDefaultLabelAttr<'a> {
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
//~^ ERROR the trait bound `Hello: IntoDiagnosticArg` is not satisfied //~^ ERROR the trait bound `Hello: IntoDiagnosticArg` is not satisfied
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ArgFieldWithoutSkip { struct ArgFieldWithoutSkip {
#[primary_span] #[primary_span]
span: Span, span: Span,
@ -345,7 +338,7 @@ struct ArgFieldWithoutSkip {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ArgFieldWithSkip { struct ArgFieldWithSkip {
#[primary_span] #[primary_span]
span: Span, span: Span,
@ -356,56 +349,56 @@ struct ArgFieldWithSkip {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorWithSpannedNote { struct ErrorWithSpannedNote {
#[note] #[note]
span: Span, span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorWithSpannedNoteCustom { struct ErrorWithSpannedNoteCustom {
#[note(typeck::note)] #[note(typeck::note)]
span: Span, span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
#[note] #[note]
struct ErrorWithNote { struct ErrorWithNote {
val: String, val: String,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
#[note(typeck::note)] #[note(typeck::note)]
struct ErrorWithNoteCustom { struct ErrorWithNoteCustom {
val: String, val: String,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorWithSpannedHelp { struct ErrorWithSpannedHelp {
#[help] #[help]
span: Span, span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorWithSpannedHelpCustom { struct ErrorWithSpannedHelpCustom {
#[help(typeck::help)] #[help(typeck::help)]
span: Span, span: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
#[help] #[help]
struct ErrorWithHelp { struct ErrorWithHelp {
val: String, val: String,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
#[help(typeck::help)] #[help(typeck::help)]
struct ErrorWithHelpCustom { struct ErrorWithHelpCustom {
val: String, val: String,
@ -413,34 +406,34 @@ struct ErrorWithHelpCustom {
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[help] #[help]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorWithHelpWrongOrder { struct ErrorWithHelpWrongOrder {
val: String, val: String,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[help(typeck::help)] #[help(typeck::help)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorWithHelpCustomWrongOrder { struct ErrorWithHelpCustomWrongOrder {
val: String, val: String,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[note] #[note]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorWithNoteWrongOrder { struct ErrorWithNoteWrongOrder {
val: String, val: String,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[note(typeck::note)] #[note(typeck::note)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorWithNoteCustomWrongOrder { struct ErrorWithNoteCustomWrongOrder {
val: String, val: String,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ApplicabilityInBoth { struct ApplicabilityInBoth {
#[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")] #[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")]
//~^ ERROR applicability cannot be set in both the field and attribute //~^ ERROR applicability cannot be set in both the field and attribute
@ -448,7 +441,7 @@ struct ApplicabilityInBoth {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct InvalidApplicability { struct InvalidApplicability {
#[suggestion(typeck::suggestion, code = "...", applicability = "batman")] #[suggestion(typeck::suggestion, code = "...", applicability = "batman")]
//~^ ERROR invalid applicability //~^ ERROR invalid applicability
@ -456,14 +449,14 @@ struct InvalidApplicability {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ValidApplicability { struct ValidApplicability {
#[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")] #[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")]
suggestion: Span, suggestion: Span,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct NoApplicability { struct NoApplicability {
#[suggestion(typeck::suggestion, code = "...")] #[suggestion(typeck::suggestion, code = "...")]
suggestion: Span, suggestion: Span,
@ -474,14 +467,14 @@ struct NoApplicability {
struct Note; struct Note;
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound)] #[diag(typeck::ambiguous_lifetime_bound)]
struct Subdiagnostic { struct Subdiagnostic {
#[subdiagnostic] #[subdiagnostic]
note: Note, note: Note,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct VecField { struct VecField {
#[primary_span] #[primary_span]
#[label] #[label]
@ -489,7 +482,7 @@ struct VecField {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct UnitField { struct UnitField {
#[primary_span] #[primary_span]
spans: Span, spans: Span,
@ -500,7 +493,7 @@ struct UnitField {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct OptUnitField { struct OptUnitField {
#[primary_span] #[primary_span]
spans: Span, spans: Span,
@ -511,7 +504,7 @@ struct OptUnitField {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct LabelWithTrailingPath { struct LabelWithTrailingPath {
#[label(typeck::label, foo)] #[label(typeck::label, foo)]
//~^ ERROR `#[label(...)]` is not a valid attribute //~^ ERROR `#[label(...)]` is not a valid attribute
@ -519,7 +512,7 @@ struct LabelWithTrailingPath {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct LabelWithTrailingNameValue { struct LabelWithTrailingNameValue {
#[label(typeck::label, foo = "...")] #[label(typeck::label, foo = "...")]
//~^ ERROR `#[label(...)]` is not a valid attribute //~^ ERROR `#[label(...)]` is not a valid attribute
@ -527,32 +520,20 @@ struct LabelWithTrailingNameValue {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct LabelWithTrailingList { struct LabelWithTrailingList {
#[label(typeck::label, foo("..."))] #[label(typeck::label, foo("..."))]
//~^ ERROR `#[label(...)]` is not a valid attribute //~^ ERROR `#[label(...)]` is not a valid attribute
span: Span, span: Span,
} }
#[derive(SessionDiagnostic)]
#[lint(typeck::ambiguous_lifetime_bound)]
//~^ ERROR only `#[error(..)]` and `#[warning(..)]` are supported
struct LintsBad {
}
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(typeck::ambiguous_lifetime_bound)] #[diag(typeck::ambiguous_lifetime_bound)]
struct LintsGood { struct LintsGood {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound)] #[diag(typeck::ambiguous_lifetime_bound)]
//~^ ERROR only `#[lint(..)]` is supported
struct ErrorsBad {
}
#[derive(LintDiagnostic)]
#[lint(typeck::ambiguous_lifetime_bound)]
struct PrimarySpanOnLint { struct PrimarySpanOnLint {
#[primary_span] #[primary_span]
//~^ ERROR `#[primary_span]` is not a valid attribute //~^ ERROR `#[primary_span]` is not a valid attribute
@ -560,15 +541,43 @@ struct PrimarySpanOnLint {
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
struct ErrorWithMultiSpan { struct ErrorWithMultiSpan {
#[primary_span] #[primary_span]
span: MultiSpan, span: MultiSpan,
} }
#[derive(SessionDiagnostic)] #[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
#[warn_] #[warn_]
struct ErrorWithWarn { struct ErrorWithWarn {
val: String, val: String,
} }
#[derive(SessionDiagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
//~^ ERROR `#[error(...)]` is not a valid attribute
//~| ERROR diagnostic slug not specified
//~| ERROR cannot find attribute `error` in this scope
struct ErrorAttribute {}
#[derive(SessionDiagnostic)]
#[warning(typeck::ambiguous_lifetime_bound, code = "E0123")]
//~^ ERROR `#[warning(...)]` is not a valid attribute
//~| ERROR diagnostic slug not specified
//~| ERROR cannot find attribute `warning` in this scope
struct WarningAttribute {}
#[derive(SessionDiagnostic)]
#[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
//~^ ERROR `#[lint(...)]` is not a valid attribute
//~| ERROR diagnostic slug not specified
//~| ERROR cannot find attribute `lint` in this scope
struct LintAttributeOnSessionDiag {}
#[derive(LintDiagnostic)]
#[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
//~^ ERROR `#[lint(...)]` is not a valid attribute
//~| ERROR diagnostic slug not specified
//~| ERROR cannot find attribute `lint` in this scope
struct LintAttributeOnLintDiag {}

View file

@ -1,7 +1,7 @@
error: `#[derive(SessionDiagnostic)]` can only be used on structs error: `#[derive(SessionDiagnostic)]` can only be used on structs
--> $DIR/diagnostic-derive.rs:39:1 --> $DIR/diagnostic-derive.rs:39:1
| |
LL | / #[error(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | / #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
LL | | LL | |
LL | | enum SessionDiagnosticOnEnum { LL | | enum SessionDiagnosticOnEnum {
LL | | Foo, LL | | Foo,
@ -9,11 +9,11 @@ LL | | Bar,
LL | | } LL | | }
| |_^ | |_^
error: `#[error = ...]` is not a valid attribute error: `#[diag = ...]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:48:1 --> $DIR/diagnostic-derive.rs:48:1
| |
LL | #[error = "E0123"] LL | #[diag = "E0123"]
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: `#[nonsense(...)]` is not a valid attribute error: `#[nonsense(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:53:1 --> $DIR/diagnostic-derive.rs:53:1
@ -35,18 +35,18 @@ LL | | struct InvalidStructAttr {}
| |
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
error: `#[error("...")]` is not a valid attribute error: `#[diag("...")]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:60:9 --> $DIR/diagnostic-derive.rs:60:8
| |
LL | #[error("E0123")] LL | #[diag("E0123")]
| ^^^^^^^ | ^^^^^^^
| |
= help: first argument of the attribute should be the diagnostic slug = help: first argument of the attribute should be the diagnostic slug
error: diagnostic slug not specified error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:60:1 --> $DIR/diagnostic-derive.rs:60:1
| |
LL | / #[error("E0123")] LL | / #[diag("E0123")]
LL | | LL | |
LL | | LL | |
LL | | struct InvalidLitNestedAttr {} LL | | struct InvalidLitNestedAttr {}
@ -54,18 +54,18 @@ LL | | struct InvalidLitNestedAttr {}
| |
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
error: `#[error(nonsense(...))]` is not a valid attribute error: `#[diag(nonsense(...))]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:71:9 --> $DIR/diagnostic-derive.rs:71:8
| |
LL | #[error(nonsense("foo"), code = "E0123", slug = "foo")] LL | #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
| |
= help: first argument of the attribute should be the diagnostic slug = help: first argument of the attribute should be the diagnostic slug
error: diagnostic slug not specified error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:71:1 --> $DIR/diagnostic-derive.rs:71:1
| |
LL | / #[error(nonsense("foo"), code = "E0123", slug = "foo")] LL | / #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
LL | | LL | |
LL | | LL | |
LL | | struct InvalidNestedStructAttr1 {} LL | | struct InvalidNestedStructAttr1 {}
@ -73,18 +73,18 @@ LL | | struct InvalidNestedStructAttr1 {}
| |
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
error: `#[error(nonsense = ...)]` is not a valid attribute error: `#[diag(nonsense = ...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:77:9 --> $DIR/diagnostic-derive.rs:77:8
| |
LL | #[error(nonsense = "...", code = "E0123", slug = "foo")] LL | #[diag(nonsense = "...", code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
| |
= help: first argument of the attribute should be the diagnostic slug = help: first argument of the attribute should be the diagnostic slug
error: diagnostic slug not specified error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:77:1 --> $DIR/diagnostic-derive.rs:77:1
| |
LL | / #[error(nonsense = "...", code = "E0123", slug = "foo")] LL | / #[diag(nonsense = "...", code = "E0123", slug = "foo")]
LL | | LL | |
LL | | LL | |
LL | | struct InvalidNestedStructAttr2 {} LL | | struct InvalidNestedStructAttr2 {}
@ -92,18 +92,18 @@ LL | | struct InvalidNestedStructAttr2 {}
| |
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
error: `#[error(nonsense = ...)]` is not a valid attribute error: `#[diag(nonsense = ...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:83:9 --> $DIR/diagnostic-derive.rs:83:8
| |
LL | #[error(nonsense = 4, code = "E0123", slug = "foo")] LL | #[diag(nonsense = 4, code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= help: first argument of the attribute should be the diagnostic slug = help: first argument of the attribute should be the diagnostic slug
error: diagnostic slug not specified error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:83:1 --> $DIR/diagnostic-derive.rs:83:1
| |
LL | / #[error(nonsense = 4, code = "E0123", slug = "foo")] LL | / #[diag(nonsense = 4, code = "E0123", slug = "foo")]
LL | | LL | |
LL | | LL | |
LL | | struct InvalidNestedStructAttr3 {} LL | | struct InvalidNestedStructAttr3 {}
@ -111,11 +111,11 @@ LL | | struct InvalidNestedStructAttr3 {}
| |
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
error: `#[error(slug = ...)]` is not a valid attribute error: `#[diag(slug = ...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:89:59 --> $DIR/diagnostic-derive.rs:89:58
| |
LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123", slug = "foo")] LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123", slug = "foo")]
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
= help: only `code` is a valid nested attributes following the slug = help: only `code` is a valid nested attributes following the slug
@ -128,71 +128,47 @@ LL | #[suggestion = "bar"]
error: specified multiple times error: specified multiple times
--> $DIR/diagnostic-derive.rs:103:1 --> $DIR/diagnostic-derive.rs:103:1
| |
LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0456")] LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
note: previously specified here note: previously specified here
--> $DIR/diagnostic-derive.rs:102:1 --> $DIR/diagnostic-derive.rs:102:1
| |
LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: specified multiple times error: specified multiple times
--> $DIR/diagnostic-derive.rs:103:50 --> $DIR/diagnostic-derive.rs:103:49
| |
LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0456")] LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456")]
| ^^^^^^^ | ^^^^^^^
| |
note: previously specified here note: previously specified here
--> $DIR/diagnostic-derive.rs:102:50 --> $DIR/diagnostic-derive.rs:102:49
| |
LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")]
| ^^^^^^^ | ^^^^^^^
error: specified multiple times error: specified multiple times
--> $DIR/diagnostic-derive.rs:110:1 --> $DIR/diagnostic-derive.rs:109:65
| |
LL | #[warning(typeck::ambiguous_lifetime_bound, code = "E0293")] LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^
| |
note: previously specified here note: previously specified here
--> $DIR/diagnostic-derive.rs:109:1 --> $DIR/diagnostic-derive.rs:109:49
| |
LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^
error: specified multiple times error: `#[diag(typeck::ambiguous_lifetime_bound)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:110:52 --> $DIR/diagnostic-derive.rs:114:42
| |
LL | #[warning(typeck::ambiguous_lifetime_bound, code = "E0293")] LL | #[diag(typeck::ambiguous_lifetime_bound, typeck::ambiguous_lifetime_bound, code = "E0456")]
| ^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: previously specified here
--> $DIR/diagnostic-derive.rs:109:50
|
LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
| ^^^^^^^
error: specified multiple times
--> $DIR/diagnostic-derive.rs:116:66
|
LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")]
| ^^^^^^^
|
note: previously specified here
--> $DIR/diagnostic-derive.rs:116:50
|
LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")]
| ^^^^^^^
error: `#[error(typeck::ambiguous_lifetime_bound)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:121:43
|
LL | #[error(typeck::ambiguous_lifetime_bound, typeck::ambiguous_lifetime_bound, code = "E0456")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:126:1 --> $DIR/diagnostic-derive.rs:119:1
| |
LL | struct KindNotProvided {} LL | struct KindNotProvided {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -200,9 +176,9 @@ LL | struct KindNotProvided {}
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
error: diagnostic slug not specified error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:129:1 --> $DIR/diagnostic-derive.rs:122:1
| |
LL | / #[error(code = "E0456")] LL | / #[diag(code = "E0456")]
LL | | LL | |
LL | | struct SlugNotProvided {} LL | | struct SlugNotProvided {}
| |_________________________^ | |_________________________^
@ -210,13 +186,13 @@ LL | | struct SlugNotProvided {}
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan` error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
--> $DIR/diagnostic-derive.rs:140:5 --> $DIR/diagnostic-derive.rs:133:5
| |
LL | #[primary_span] LL | #[primary_span]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
error: `#[nonsense]` is not a valid attribute error: `#[nonsense]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:148:5 --> $DIR/diagnostic-derive.rs:141:5
| |
LL | #[nonsense] LL | #[nonsense]
| ^^^^^^^^^^^ | ^^^^^^^^^^^
@ -224,19 +200,19 @@ LL | #[nonsense]
= help: only `skip_arg`, `primary_span`, `label`, `note`, `help` and `subdiagnostic` are valid field attributes = help: only `skip_arg`, `primary_span`, `label`, `note`, `help` and `subdiagnostic` are valid field attributes
error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
--> $DIR/diagnostic-derive.rs:165:5 --> $DIR/diagnostic-derive.rs:158:5
| |
LL | #[label(typeck::label)] LL | #[label(typeck::label)]
| ^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^
error: `name` doesn't refer to a field on this type error: `name` doesn't refer to a field on this type
--> $DIR/diagnostic-derive.rs:173:45 --> $DIR/diagnostic-derive.rs:166:45
| |
LL | #[suggestion(typeck::suggestion, code = "{name}")] LL | #[suggestion(typeck::suggestion, code = "{name}")]
| ^^^^^^^^ | ^^^^^^^^
error: invalid format string: expected `'}'` but string was terminated error: invalid format string: expected `'}'` but string was terminated
--> $DIR/diagnostic-derive.rs:178:16 --> $DIR/diagnostic-derive.rs:171:16
| |
LL | #[derive(SessionDiagnostic)] LL | #[derive(SessionDiagnostic)]
| - ^ expected `'}'` in format string | - ^ expected `'}'` in format string
@ -247,7 +223,7 @@ LL | #[derive(SessionDiagnostic)]
= note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid format string: unmatched `}` found error: invalid format string: unmatched `}` found
--> $DIR/diagnostic-derive.rs:188:15 --> $DIR/diagnostic-derive.rs:181:15
| |
LL | #[derive(SessionDiagnostic)] LL | #[derive(SessionDiagnostic)]
| ^ unmatched `}` in format string | ^ unmatched `}` in format string
@ -256,13 +232,13 @@ LL | #[derive(SessionDiagnostic)]
= note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
--> $DIR/diagnostic-derive.rs:208:5 --> $DIR/diagnostic-derive.rs:201:5
| |
LL | #[label(typeck::label)] LL | #[label(typeck::label)]
| ^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^
error: `#[suggestion(nonsense = ...)]` is not a valid attribute error: `#[suggestion(nonsense = ...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:233:18 --> $DIR/diagnostic-derive.rs:226:18
| |
LL | #[suggestion(nonsense = "bar")] LL | #[suggestion(nonsense = "bar")]
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
@ -270,7 +246,7 @@ LL | #[suggestion(nonsense = "bar")]
= help: only `message`, `code` and `applicability` are valid field attributes = help: only `message`, `code` and `applicability` are valid field attributes
error: `#[suggestion(msg = ...)]` is not a valid attribute error: `#[suggestion(msg = ...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:241:18 --> $DIR/diagnostic-derive.rs:234:18
| |
LL | #[suggestion(msg = "bar")] LL | #[suggestion(msg = "bar")]
| ^^^^^^^^^^^ | ^^^^^^^^^^^
@ -278,7 +254,7 @@ LL | #[suggestion(msg = "bar")]
= help: only `message`, `code` and `applicability` are valid field attributes = help: only `message`, `code` and `applicability` are valid field attributes
error: wrong field type for suggestion error: wrong field type for suggestion
--> $DIR/diagnostic-derive.rs:263:5 --> $DIR/diagnostic-derive.rs:256:5
| |
LL | / #[suggestion(typeck::suggestion, code = "This is suggested code")] LL | / #[suggestion(typeck::suggestion, code = "This is suggested code")]
LL | | LL | |
@ -288,7 +264,7 @@ LL | | suggestion: Applicability,
= help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)` = help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`
error: type of field annotated with `#[suggestion(...)]` contains more than one `Span` error: type of field annotated with `#[suggestion(...)]` contains more than one `Span`
--> $DIR/diagnostic-derive.rs:278:5 --> $DIR/diagnostic-derive.rs:271:5
| |
LL | / #[suggestion(typeck::suggestion, code = "This is suggested code")] LL | / #[suggestion(typeck::suggestion, code = "This is suggested code")]
LL | | LL | |
@ -296,7 +272,7 @@ LL | | suggestion: (Span, Span, Applicability),
| |___________________________________________^ | |___________________________________________^
error: type of field annotated with `#[suggestion(...)]` contains more than one Applicability error: type of field annotated with `#[suggestion(...)]` contains more than one Applicability
--> $DIR/diagnostic-derive.rs:286:5 --> $DIR/diagnostic-derive.rs:279:5
| |
LL | / #[suggestion(typeck::suggestion, code = "This is suggested code")] LL | / #[suggestion(typeck::suggestion, code = "This is suggested code")]
LL | | LL | |
@ -304,65 +280,129 @@ LL | | suggestion: (Applicability, Applicability, Span),
| |____________________________________________________^ | |____________________________________________________^
error: `#[label = ...]` is not a valid attribute error: `#[label = ...]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:294:5 --> $DIR/diagnostic-derive.rs:287:5
| |
LL | #[label = "bar"] LL | #[label = "bar"]
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: applicability cannot be set in both the field and attribute error: applicability cannot be set in both the field and attribute
--> $DIR/diagnostic-derive.rs:445:52 --> $DIR/diagnostic-derive.rs:438:52
| |
LL | #[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")] LL | #[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: invalid applicability error: invalid applicability
--> $DIR/diagnostic-derive.rs:453:52 --> $DIR/diagnostic-derive.rs:446:52
| |
LL | #[suggestion(typeck::suggestion, code = "...", applicability = "batman")] LL | #[suggestion(typeck::suggestion, code = "...", applicability = "batman")]
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[label(...)]` is not a valid attribute error: `#[label(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:516:5 --> $DIR/diagnostic-derive.rs:509:5
| |
LL | #[label(typeck::label, foo)] LL | #[label(typeck::label, foo)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[label(...)]` is not a valid attribute error: `#[label(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:524:5 --> $DIR/diagnostic-derive.rs:517:5
| |
LL | #[label(typeck::label, foo = "...")] LL | #[label(typeck::label, foo = "...")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[label(...)]` is not a valid attribute error: `#[label(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:532:5 --> $DIR/diagnostic-derive.rs:525:5
| |
LL | #[label(typeck::label, foo("..."))] LL | #[label(typeck::label, foo("..."))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: only `#[error(..)]` and `#[warning(..)]` are supported
--> $DIR/diagnostic-derive.rs:538:1
|
LL | #[lint(typeck::ambiguous_lifetime_bound)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use the `#[error(...)]` attribute to create a error
error: only `#[lint(..)]` is supported
--> $DIR/diagnostic-derive.rs:549:1
|
LL | #[error(typeck::ambiguous_lifetime_bound)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use the `#[lint(...)]` attribute to create a lint
error: `#[primary_span]` is not a valid attribute error: `#[primary_span]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:557:5 --> $DIR/diagnostic-derive.rs:538:5
| |
LL | #[primary_span] LL | #[primary_span]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
| |
= help: the `primary_span` field attribute is not valid for lint diagnostics = help: the `primary_span` field attribute is not valid for lint diagnostics
error: `#[error(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:558:1
|
LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `error`, `warning` and `lint` have been replaced by `diag`
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:558:1
|
LL | / #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
LL | |
LL | |
LL | |
LL | | struct ErrorAttribute {}
| |________________________^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
error: `#[warning(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:565:1
|
LL | #[warning(typeck::ambiguous_lifetime_bound, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `error`, `warning` and `lint` have been replaced by `diag`
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:565:1
|
LL | / #[warning(typeck::ambiguous_lifetime_bound, code = "E0123")]
LL | |
LL | |
LL | |
LL | | struct WarningAttribute {}
| |__________________________^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
error: `#[lint(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:572:1
|
LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `error`, `warning` and `lint` have been replaced by `diag`
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:572:1
|
LL | / #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
LL | |
LL | |
LL | |
LL | | struct LintAttributeOnSessionDiag {}
| |____________________________________^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]`
error: `#[lint(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:579:1
|
LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: `error`, `warning` and `lint` have been replaced by `diag`
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:579:1
|
LL | / #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
LL | |
LL | |
LL | |
LL | | struct LintAttributeOnLintDiag {}
| |_________________________________^
|
= help: specify the slug as the first argument to the attribute, such as `#[diag(typeck::example_error)]`
error: cannot find attribute `nonsense` in this scope error: cannot find attribute `nonsense` in this scope
--> $DIR/diagnostic-derive.rs:53:3 --> $DIR/diagnostic-derive.rs:53:3
| |
@ -370,19 +410,43 @@ LL | #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")]
| ^^^^^^^^ | ^^^^^^^^
error: cannot find attribute `nonsense` in this scope error: cannot find attribute `nonsense` in this scope
--> $DIR/diagnostic-derive.rs:148:7 --> $DIR/diagnostic-derive.rs:141:7
| |
LL | #[nonsense] LL | #[nonsense]
| ^^^^^^^^ | ^^^^^^^^
error[E0425]: cannot find value `nonsense` in module `rustc_errors::fluent` error: cannot find attribute `error` in this scope
--> $DIR/diagnostic-derive.rs:66:9 --> $DIR/diagnostic-derive.rs:558:3
| |
LL | #[error(nonsense, code = "E0123")] LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
| ^^^^^^^^ not found in `rustc_errors::fluent` | ^^^^^
error: cannot find attribute `warning` in this scope
--> $DIR/diagnostic-derive.rs:565:3
|
LL | #[warning(typeck::ambiguous_lifetime_bound, code = "E0123")]
| ^^^^^^^
error: cannot find attribute `lint` in this scope
--> $DIR/diagnostic-derive.rs:572:3
|
LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
| ^^^^ help: a built-in attribute with a similar name exists: `link`
error: cannot find attribute `lint` in this scope
--> $DIR/diagnostic-derive.rs:579:3
|
LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")]
| ^^^^ help: a built-in attribute with a similar name exists: `link`
error[E0425]: cannot find value `nonsense` in module `rustc_errors::fluent`
--> $DIR/diagnostic-derive.rs:66:8
|
LL | #[diag(nonsense, code = "E0123")]
| ^^^^^^^^ not found in `rustc_errors::fluent`
error[E0277]: the trait bound `Hello: IntoDiagnosticArg` is not satisfied error[E0277]: the trait bound `Hello: IntoDiagnosticArg` is not satisfied
--> $DIR/diagnostic-derive.rs:338:10 --> $DIR/diagnostic-derive.rs:331:10
| |
LL | #[derive(SessionDiagnostic)] LL | #[derive(SessionDiagnostic)]
| ^^^^^^^^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `Hello` | ^^^^^^^^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `Hello`
@ -395,7 +459,7 @@ LL | arg: impl IntoDiagnosticArg,
| ^^^^^^^^^^^^^^^^^ required by this bound in `DiagnosticBuilder::<'a, G>::set_arg` | ^^^^^^^^^^^^^^^^^ required by this bound in `DiagnosticBuilder::<'a, G>::set_arg`
= note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 47 previous errors error: aborting due to 55 previous errors
Some errors have detailed explanations: E0277, E0425. Some errors have detailed explanations: E0277, E0425.
For more information about an error, try `rustc --explain E0277`. For more information about an error, try `rustc --explain E0277`.