1
Fork 0

errors: rename typeck.ftl to hir_analysis.ftl

In #102306, `rustc_typeck` was renamed to `rustc_hir_analysis` but the
diagnostic resources were not renamed - which is what this commit
changes.

Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
David Wood 2022-09-28 10:21:33 +01:00
parent 6b139c5b3e
commit c4418e1940
9 changed files with 326 additions and 319 deletions

View file

@ -0,0 +1,5 @@
compiletest_example = this is an example message used in testing
.note = with a note
.help = with a help
.suggestion = with a suggestion
.label = with a label

View file

@ -1,101 +1,101 @@
typeck_field_multiply_specified_in_initializer = hir_analysis_field_multiply_specified_in_initializer =
field `{$ident}` specified more than once field `{$ident}` specified more than once
.label = used more than once .label = used more than once
.previous_use_label = first use of `{$ident}` .previous_use_label = first use of `{$ident}`
typeck_unrecognized_atomic_operation = hir_analysis_unrecognized_atomic_operation =
unrecognized atomic operation function: `{$op}` unrecognized atomic operation function: `{$op}`
.label = unrecognized atomic operation .label = unrecognized atomic operation
typeck_wrong_number_of_generic_arguments_to_intrinsic = hir_analysis_wrong_number_of_generic_arguments_to_intrinsic =
intrinsic has wrong number of {$descr} parameters: found {$found}, expected {$expected} intrinsic has wrong number of {$descr} parameters: found {$found}, expected {$expected}
.label = expected {$expected} {$descr} {$expected -> .label = expected {$expected} {$descr} {$expected ->
[one] parameter [one] parameter
*[other] parameters *[other] parameters
} }
typeck_unrecognized_intrinsic_function = hir_analysis_unrecognized_intrinsic_function =
unrecognized intrinsic function: `{$name}` unrecognized intrinsic function: `{$name}`
.label = unrecognized intrinsic .label = unrecognized intrinsic
typeck_lifetimes_or_bounds_mismatch_on_trait = hir_analysis_lifetimes_or_bounds_mismatch_on_trait =
lifetime parameters or bounds on {$item_kind} `{$ident}` do not match the trait declaration lifetime parameters or bounds on {$item_kind} `{$ident}` do not match the trait declaration
.label = lifetimes do not match {$item_kind} in trait .label = lifetimes do not match {$item_kind} in trait
.generics_label = lifetimes in impl do not match this {$item_kind} in trait .generics_label = lifetimes in impl do not match this {$item_kind} in trait
typeck_drop_impl_on_wrong_item = hir_analysis_drop_impl_on_wrong_item =
the `Drop` trait may only be implemented for local structs, enums, and unions the `Drop` trait may only be implemented for local structs, enums, and unions
.label = must be a struct, enum, or union in the current crate .label = must be a struct, enum, or union in the current crate
typeck_field_already_declared = hir_analysis_field_already_declared =
field `{$field_name}` is already declared field `{$field_name}` is already declared
.label = field already declared .label = field already declared
.previous_decl_label = `{$field_name}` first declared here .previous_decl_label = `{$field_name}` first declared here
typeck_copy_impl_on_type_with_dtor = hir_analysis_copy_impl_on_type_with_dtor =
the trait `Copy` may not be implemented for this type; the type has a destructor the trait `Copy` may not be implemented for this type; the type has a destructor
.label = `Copy` not allowed on types with destructors .label = `Copy` not allowed on types with destructors
typeck_multiple_relaxed_default_bounds = hir_analysis_multiple_relaxed_default_bounds =
type parameter has more than one relaxed default bound, only one is supported type parameter has more than one relaxed default bound, only one is supported
typeck_copy_impl_on_non_adt = hir_analysis_copy_impl_on_non_adt =
the trait `Copy` may not be implemented for this type the trait `Copy` may not be implemented for this type
.label = type is not a structure or enumeration .label = type is not a structure or enumeration
typeck_trait_object_declared_with_no_traits = hir_analysis_trait_object_declared_with_no_traits =
at least one trait is required for an object type at least one trait is required for an object type
.alias_span = this alias does not contain a trait .alias_span = this alias does not contain a trait
typeck_ambiguous_lifetime_bound = hir_analysis_ambiguous_lifetime_bound =
ambiguous lifetime bound, explicit lifetime bound required ambiguous lifetime bound, explicit lifetime bound required
typeck_assoc_type_binding_not_allowed = hir_analysis_assoc_type_binding_not_allowed =
associated type bindings are not allowed here associated type bindings are not allowed here
.label = associated type not allowed here .label = associated type not allowed here
typeck_functional_record_update_on_non_struct = hir_analysis_functional_record_update_on_non_struct =
functional record update syntax requires a struct functional record update syntax requires a struct
typeck_typeof_reserved_keyword_used = hir_analysis_typeof_reserved_keyword_used =
`typeof` is a reserved keyword but unimplemented `typeof` is a reserved keyword but unimplemented
.suggestion = consider replacing `typeof(...)` with an actual type .suggestion = consider replacing `typeof(...)` with an actual type
.label = reserved keyword .label = reserved keyword
typeck_return_stmt_outside_of_fn_body = hir_analysis_return_stmt_outside_of_fn_body =
return statement outside of function body return statement outside of function body
.encl_body_label = the return is part of this body... .encl_body_label = the return is part of this body...
.encl_fn_label = ...not the enclosing function body .encl_fn_label = ...not the enclosing function body
typeck_yield_expr_outside_of_generator = hir_analysis_yield_expr_outside_of_generator =
yield expression outside of generator literal yield expression outside of generator literal
typeck_struct_expr_non_exhaustive = hir_analysis_struct_expr_non_exhaustive =
cannot create non-exhaustive {$what} using struct expression cannot create non-exhaustive {$what} using struct expression
typeck_method_call_on_unknown_type = hir_analysis_method_call_on_unknown_type =
the type of this value must be known to call a method on a raw pointer on it the type of this value must be known to call a method on a raw pointer on it
typeck_value_of_associated_struct_already_specified = hir_analysis_value_of_associated_struct_already_specified =
the value of the associated type `{$item_name}` (from trait `{$def_path}`) is already specified the value of the associated type `{$item_name}` (from trait `{$def_path}`) is already specified
.label = re-bound here .label = re-bound here
.previous_bound_label = `{$item_name}` bound here first .previous_bound_label = `{$item_name}` bound here first
typeck_address_of_temporary_taken = cannot take address of a temporary hir_analysis_address_of_temporary_taken = cannot take address of a temporary
.label = temporary value .label = temporary value
typeck_add_return_type_add = try adding a return type hir_analysis_add_return_type_add = try adding a return type
typeck_add_return_type_missing_here = a return type might be missing here hir_analysis_add_return_type_missing_here = a return type might be missing here
typeck_expected_default_return_type = expected `()` because of default return type hir_analysis_expected_default_return_type = expected `()` because of default return type
typeck_expected_return_type = expected `{$expected}` because of return type hir_analysis_expected_return_type = expected `{$expected}` because of return type
typeck_unconstrained_opaque_type = unconstrained opaque type hir_analysis_unconstrained_opaque_type = unconstrained opaque type
.note = `{$name}` must be used in combination with a concrete type within the same module .note = `{$name}` must be used in combination with a concrete type within the same module
typeck_missing_type_params = hir_analysis_missing_type_params =
the type {$parameterCount -> the type {$parameterCount ->
[one] parameter [one] parameter
*[other] parameters *[other] parameters
@ -117,19 +117,19 @@ typeck_missing_type_params =
} to {$parameters} } to {$parameters}
.note = because of the default `Self` reference, type parameters must be specified on object types .note = because of the default `Self` reference, type parameters must be specified on object types
typeck_manual_implementation = hir_analysis_manual_implementation =
manual implementations of `{$trait_name}` are experimental manual implementations of `{$trait_name}` are experimental
.label = manual implementations of `{$trait_name}` are experimental .label = manual implementations of `{$trait_name}` are experimental
.help = add `#![feature(unboxed_closures)]` to the crate attributes to enable .help = add `#![feature(unboxed_closures)]` to the crate attributes to enable
typeck_substs_on_overridden_impl = could not resolve substs on overridden impl hir_analysis_substs_on_overridden_impl = could not resolve substs on overridden impl
typeck_unused_extern_crate = hir_analysis_unused_extern_crate =
unused extern crate unused extern crate
.suggestion = remove it .suggestion = remove it
typeck_extern_crate_not_idiomatic = hir_analysis_extern_crate_not_idiomatic =
`extern crate` is not idiomatic in the new edition `extern crate` is not idiomatic in the new edition
.suggestion = convert it to a `{$msg_code}` .suggestion = convert it to a `{$msg_code}`
typeck_expected_used_symbol = expected `used`, `used(compiler)` or `used(linker)` hir_analysis_expected_used_symbol = expected `used`, `used(compiler)` or `used(linker)`

View file

@ -40,28 +40,29 @@ fluent_messages! {
attr => "../locales/en-US/attr.ftl", attr => "../locales/en-US/attr.ftl",
borrowck => "../locales/en-US/borrowck.ftl", borrowck => "../locales/en-US/borrowck.ftl",
builtin_macros => "../locales/en-US/builtin_macros.ftl", builtin_macros => "../locales/en-US/builtin_macros.ftl",
compiletest => "../locales/en-US/compiletest.ftl",
const_eval => "../locales/en-US/const_eval.ftl", const_eval => "../locales/en-US/const_eval.ftl",
codegen_gcc => "../locales/en-US/codegen_gcc.ftl", codegen_gcc => "../locales/en-US/codegen_gcc.ftl",
driver => "../locales/en-US/driver.ftl", driver => "../locales/en-US/driver.ftl",
expand => "../locales/en-US/expand.ftl", expand => "../locales/en-US/expand.ftl",
session => "../locales/en-US/session.ftl", hir_analysis => "../locales/en-US/hir_analysis.ftl",
interface => "../locales/en-US/interface.ftl",
infer => "../locales/en-US/infer.ftl", infer => "../locales/en-US/infer.ftl",
interface => "../locales/en-US/interface.ftl",
lint => "../locales/en-US/lint.ftl", lint => "../locales/en-US/lint.ftl",
middle => "../locales/en-US/middle.ftl",
monomorphize => "../locales/en-US/monomorphize.ftl",
metadata => "../locales/en-US/metadata.ftl", metadata => "../locales/en-US/metadata.ftl",
middle => "../locales/en-US/middle.ftl",
mir_dataflow => "../locales/en-US/mir_dataflow.ftl",
monomorphize => "../locales/en-US/monomorphize.ftl",
parser => "../locales/en-US/parser.ftl", parser => "../locales/en-US/parser.ftl",
passes => "../locales/en-US/passes.ftl", passes => "../locales/en-US/passes.ftl",
plugin_impl => "../locales/en-US/plugin_impl.ftl", plugin_impl => "../locales/en-US/plugin_impl.ftl",
privacy => "../locales/en-US/privacy.ftl", privacy => "../locales/en-US/privacy.ftl",
query_system => "../locales/en-US/query_system.ftl", query_system => "../locales/en-US/query_system.ftl",
trait_selection => "../locales/en-US/trait_selection.ftl",
save_analysis => "../locales/en-US/save_analysis.ftl", save_analysis => "../locales/en-US/save_analysis.ftl",
ty_utils => "../locales/en-US/ty_utils.ftl", session => "../locales/en-US/session.ftl",
typeck => "../locales/en-US/typeck.ftl",
mir_dataflow => "../locales/en-US/mir_dataflow.ftl",
symbol_mangling => "../locales/en-US/symbol_mangling.ftl", symbol_mangling => "../locales/en-US/symbol_mangling.ftl",
trait_selection => "../locales/en-US/trait_selection.ftl",
ty_utils => "../locales/en-US/ty_utils.ftl",
} }
pub use fluent_generated::{self as fluent, DEFAULT_LOCALE_RESOURCES}; pub use fluent_generated::{self as fluent, DEFAULT_LOCALE_RESOURCES};

View file

@ -1,4 +1,5 @@
//! Errors emitted by typeck. //! Errors emitted by `hir_analysis`.
use rustc_errors::IntoDiagnostic; use rustc_errors::IntoDiagnostic;
use rustc_errors::{error_code, Applicability, DiagnosticBuilder, ErrorGuaranteed, Handler}; use rustc_errors::{error_code, Applicability, DiagnosticBuilder, ErrorGuaranteed, Handler};
use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic}; use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
@ -6,18 +7,18 @@ use rustc_middle::ty::Ty;
use rustc_span::{symbol::Ident, Span, Symbol}; use rustc_span::{symbol::Ident, Span, Symbol};
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::field_multiply_specified_in_initializer, code = "E0062")] #[diag(hir_analysis::field_multiply_specified_in_initializer, code = "E0062")]
pub struct FieldMultiplySpecifiedInInitializer { pub struct FieldMultiplySpecifiedInInitializer {
#[primary_span] #[primary_span]
#[label] #[label]
pub span: Span, pub span: Span,
#[label(typeck::previous_use_label)] #[label(hir_analysis::previous_use_label)]
pub prev_span: Span, pub prev_span: Span,
pub ident: Ident, pub ident: Ident,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::unrecognized_atomic_operation, code = "E0092")] #[diag(hir_analysis::unrecognized_atomic_operation, code = "E0092")]
pub struct UnrecognizedAtomicOperation<'a> { pub struct UnrecognizedAtomicOperation<'a> {
#[primary_span] #[primary_span]
#[label] #[label]
@ -26,7 +27,7 @@ pub struct UnrecognizedAtomicOperation<'a> {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::wrong_number_of_generic_arguments_to_intrinsic, code = "E0094")] #[diag(hir_analysis::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 +38,7 @@ pub struct WrongNumberOfGenericArgumentsToIntrinsic<'a> {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::unrecognized_intrinsic_function, code = "E0093")] #[diag(hir_analysis::unrecognized_intrinsic_function, code = "E0093")]
pub struct UnrecognizedIntrinsicFunction { pub struct UnrecognizedIntrinsicFunction {
#[primary_span] #[primary_span]
#[label] #[label]
@ -46,19 +47,19 @@ pub struct UnrecognizedIntrinsicFunction {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::lifetimes_or_bounds_mismatch_on_trait, code = "E0195")] #[diag(hir_analysis::lifetimes_or_bounds_mismatch_on_trait, code = "E0195")]
pub struct LifetimesOrBoundsMismatchOnTrait { pub struct LifetimesOrBoundsMismatchOnTrait {
#[primary_span] #[primary_span]
#[label] #[label]
pub span: Span, pub span: Span,
#[label(typeck::generics_label)] #[label(hir_analysis::generics_label)]
pub generics_span: Option<Span>, pub generics_span: Option<Span>,
pub item_kind: &'static str, pub item_kind: &'static str,
pub ident: Ident, pub ident: Ident,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::drop_impl_on_wrong_item, code = "E0120")] #[diag(hir_analysis::drop_impl_on_wrong_item, code = "E0120")]
pub struct DropImplOnWrongItem { pub struct DropImplOnWrongItem {
#[primary_span] #[primary_span]
#[label] #[label]
@ -66,18 +67,18 @@ pub struct DropImplOnWrongItem {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::field_already_declared, code = "E0124")] #[diag(hir_analysis::field_already_declared, code = "E0124")]
pub struct FieldAlreadyDeclared { pub struct FieldAlreadyDeclared {
pub field_name: Ident, pub field_name: Ident,
#[primary_span] #[primary_span]
#[label] #[label]
pub span: Span, pub span: Span,
#[label(typeck::previous_decl_label)] #[label(hir_analysis::previous_decl_label)]
pub prev_span: Span, pub prev_span: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::copy_impl_on_type_with_dtor, code = "E0184")] #[diag(hir_analysis::copy_impl_on_type_with_dtor, code = "E0184")]
pub struct CopyImplOnTypeWithDtor { pub struct CopyImplOnTypeWithDtor {
#[primary_span] #[primary_span]
#[label] #[label]
@ -85,14 +86,14 @@ pub struct CopyImplOnTypeWithDtor {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::multiple_relaxed_default_bounds, code = "E0203")] #[diag(hir_analysis::multiple_relaxed_default_bounds, code = "E0203")]
pub struct MultipleRelaxedDefaultBounds { pub struct MultipleRelaxedDefaultBounds {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::copy_impl_on_non_adt, code = "E0206")] #[diag(hir_analysis::copy_impl_on_non_adt, code = "E0206")]
pub struct CopyImplOnNonAdt { pub struct CopyImplOnNonAdt {
#[primary_span] #[primary_span]
#[label] #[label]
@ -100,23 +101,23 @@ pub struct CopyImplOnNonAdt {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::trait_object_declared_with_no_traits, code = "E0224")] #[diag(hir_analysis::trait_object_declared_with_no_traits, code = "E0224")]
pub struct TraitObjectDeclaredWithNoTraits { pub struct TraitObjectDeclaredWithNoTraits {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
#[label(typeck::alias_span)] #[label(hir_analysis::alias_span)]
pub trait_alias_span: Option<Span>, pub trait_alias_span: Option<Span>,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0227")] #[diag(hir_analysis::ambiguous_lifetime_bound, code = "E0227")]
pub struct AmbiguousLifetimeBound { pub struct AmbiguousLifetimeBound {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::assoc_type_binding_not_allowed, code = "E0229")] #[diag(hir_analysis::assoc_type_binding_not_allowed, code = "E0229")]
pub struct AssocTypeBindingNotAllowed { pub struct AssocTypeBindingNotAllowed {
#[primary_span] #[primary_span]
#[label] #[label]
@ -124,14 +125,14 @@ pub struct AssocTypeBindingNotAllowed {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::functional_record_update_on_non_struct, code = "E0436")] #[diag(hir_analysis::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(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::typeof_reserved_keyword_used, code = "E0516")] #[diag(hir_analysis::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,25 +143,25 @@ pub struct TypeofReservedKeywordUsed<'tcx> {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::return_stmt_outside_of_fn_body, code = "E0572")] #[diag(hir_analysis::return_stmt_outside_of_fn_body, code = "E0572")]
pub struct ReturnStmtOutsideOfFnBody { pub struct ReturnStmtOutsideOfFnBody {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
#[label(typeck::encl_body_label)] #[label(hir_analysis::encl_body_label)]
pub encl_body_span: Option<Span>, pub encl_body_span: Option<Span>,
#[label(typeck::encl_fn_label)] #[label(hir_analysis::encl_fn_label)]
pub encl_fn_span: Option<Span>, pub encl_fn_span: Option<Span>,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::yield_expr_outside_of_generator, code = "E0627")] #[diag(hir_analysis::yield_expr_outside_of_generator, code = "E0627")]
pub struct YieldExprOutsideOfGenerator { pub struct YieldExprOutsideOfGenerator {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::struct_expr_non_exhaustive, code = "E0639")] #[diag(hir_analysis::struct_expr_non_exhaustive, code = "E0639")]
pub struct StructExprNonExhaustive { pub struct StructExprNonExhaustive {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
@ -168,26 +169,26 @@ pub struct StructExprNonExhaustive {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::method_call_on_unknown_type, code = "E0699")] #[diag(hir_analysis::method_call_on_unknown_type, code = "E0699")]
pub struct MethodCallOnUnknownType { pub struct MethodCallOnUnknownType {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::value_of_associated_struct_already_specified, code = "E0719")] #[diag(hir_analysis::value_of_associated_struct_already_specified, code = "E0719")]
pub struct ValueOfAssociatedStructAlreadySpecified { pub struct ValueOfAssociatedStructAlreadySpecified {
#[primary_span] #[primary_span]
#[label] #[label]
pub span: Span, pub span: Span,
#[label(typeck::previous_bound_label)] #[label(hir_analysis::previous_bound_label)]
pub prev_span: Span, pub prev_span: Span,
pub item_name: Ident, pub item_name: Ident,
pub def_path: String, pub def_path: String,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::address_of_temporary_taken, code = "E0745")] #[diag(hir_analysis::address_of_temporary_taken, code = "E0745")]
pub struct AddressOfTemporaryTaken { pub struct AddressOfTemporaryTaken {
#[primary_span] #[primary_span]
#[label] #[label]
@ -197,7 +198,7 @@ pub struct AddressOfTemporaryTaken {
#[derive(Subdiagnostic)] #[derive(Subdiagnostic)]
pub enum AddReturnTypeSuggestion { pub enum AddReturnTypeSuggestion {
#[suggestion( #[suggestion(
typeck::add_return_type_add, hir_analysis::add_return_type_add,
code = "-> {found} ", code = "-> {found} ",
applicability = "machine-applicable" applicability = "machine-applicable"
)] )]
@ -207,7 +208,7 @@ pub enum AddReturnTypeSuggestion {
found: String, found: String,
}, },
#[suggestion( #[suggestion(
typeck::add_return_type_missing_here, hir_analysis::add_return_type_missing_here,
code = "-> _ ", code = "-> _ ",
applicability = "has-placeholders" applicability = "has-placeholders"
)] )]
@ -219,12 +220,12 @@ pub enum AddReturnTypeSuggestion {
#[derive(Subdiagnostic)] #[derive(Subdiagnostic)]
pub enum ExpectedReturnTypeLabel<'tcx> { pub enum ExpectedReturnTypeLabel<'tcx> {
#[label(typeck::expected_default_return_type)] #[label(hir_analysis::expected_default_return_type)]
Unit { Unit {
#[primary_span] #[primary_span]
span: Span, span: Span,
}, },
#[label(typeck::expected_return_type)] #[label(hir_analysis::expected_return_type)]
Other { Other {
#[primary_span] #[primary_span]
span: Span, span: Span,
@ -233,7 +234,7 @@ pub enum ExpectedReturnTypeLabel<'tcx> {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::unconstrained_opaque_type)] #[diag(hir_analysis::unconstrained_opaque_type)]
#[note] #[note]
pub struct UnconstrainedOpaqueType { pub struct UnconstrainedOpaqueType {
#[primary_span] #[primary_span]
@ -254,7 +255,7 @@ impl<'a> IntoDiagnostic<'a> for MissingTypeParams {
fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> { fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
let mut err = handler.struct_span_err_with_code( let mut err = handler.struct_span_err_with_code(
self.span, self.span,
rustc_errors::fluent::typeck::missing_type_params, rustc_errors::fluent::hir_analysis::missing_type_params,
error_code!(E0393), error_code!(E0393),
); );
err.set_arg("parameterCount", self.missing_type_params.len()); err.set_arg("parameterCount", self.missing_type_params.len());
@ -267,7 +268,7 @@ impl<'a> IntoDiagnostic<'a> for MissingTypeParams {
.join(", "), .join(", "),
); );
err.span_label(self.def_span, rustc_errors::fluent::typeck::label); err.span_label(self.def_span, rustc_errors::fluent::hir_analysis::label);
let mut suggested = false; let mut suggested = false;
// Don't suggest setting the type params if there are some already: the order is // Don't suggest setting the type params if there are some already: the order is
@ -282,7 +283,7 @@ impl<'a> IntoDiagnostic<'a> for MissingTypeParams {
// least we can clue them to the correct syntax `Iterator<Type>`. // least we can clue them to the correct syntax `Iterator<Type>`.
err.span_suggestion( err.span_suggestion(
self.span, self.span,
rustc_errors::fluent::typeck::suggestion, rustc_errors::fluent::hir_analysis::suggestion,
format!( format!(
"{}<{}>", "{}<{}>",
snippet, snippet,
@ -298,16 +299,16 @@ impl<'a> IntoDiagnostic<'a> for MissingTypeParams {
} }
} }
if !suggested { if !suggested {
err.span_label(self.span, rustc_errors::fluent::typeck::no_suggestion_label); err.span_label(self.span, rustc_errors::fluent::hir_analysis::no_suggestion_label);
} }
err.note(rustc_errors::fluent::typeck::note); err.note(rustc_errors::fluent::hir_analysis::note);
err err
} }
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::manual_implementation, code = "E0183")] #[diag(hir_analysis::manual_implementation, code = "E0183")]
#[help] #[help]
pub struct ManualImplementation { pub struct ManualImplementation {
#[primary_span] #[primary_span]
@ -317,21 +318,21 @@ pub struct ManualImplementation {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::substs_on_overridden_impl)] #[diag(hir_analysis::substs_on_overridden_impl)]
pub struct SubstsOnOverriddenImpl { pub struct SubstsOnOverriddenImpl {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[diag(typeck::unused_extern_crate)] #[diag(hir_analysis::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)]
#[diag(typeck::extern_crate_not_idiomatic)] #[diag(hir_analysis::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,
@ -340,7 +341,7 @@ pub struct ExternCrateNotIdiomatic {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::expected_used_symbol)] #[diag(hir_analysis::expected_used_symbol)]
pub struct ExpectedUsedSymbol { pub struct ExpectedUsedSymbol {
#[primary_span] #[primary_span]
pub span: Span, pub span: Span,

View file

@ -36,7 +36,7 @@ impl<'a> DiagnosticDerive<'a> {
span_err(builder.span, "diagnostic slug not specified") span_err(builder.span, "diagnostic slug not specified")
.help(&format!( .help(&format!(
"specify the slug as the first argument to the `#[diag(...)]` \ "specify the slug as the first argument to the `#[diag(...)]` \
attribute, such as `#[diag(typeck::example_error)]`", attribute, such as `#[diag(hir_analysis::example_error)]`",
)) ))
.emit(); .emit();
return DiagnosticDeriveError::ErrorHandled.to_compile_error(); return DiagnosticDeriveError::ErrorHandled.to_compile_error();
@ -113,7 +113,7 @@ impl<'a> LintDiagnosticDerive<'a> {
span_err(builder.span, "diagnostic slug not specified") span_err(builder.span, "diagnostic slug not specified")
.help(&format!( .help(&format!(
"specify the slug as the first argument to the attribute, such as \ "specify the slug as the first argument to the attribute, such as \
`#[diag(typeck::example_error)]`", `#[diag(compiletest::example)]`",
)) ))
.emit(); .emit();
return DiagnosticDeriveError::ErrorHandled.to_compile_error(); return DiagnosticDeriveError::ErrorHandled.to_compile_error();

View file

@ -19,14 +19,14 @@ use rustc_macros::{Diagnostic, Subdiagnostic};
use rustc_span::Span; use rustc_span::Span;
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(parser::expect_path)] #[diag(compiletest::example)]
struct DeriveDiagnostic { struct DeriveDiagnostic {
#[primary_span] #[primary_span]
span: Span, span: Span,
} }
#[derive(Subdiagnostic)] #[derive(Subdiagnostic)]
#[note(parser::add_paren)] #[note(compiletest::example)]
struct Note { struct Note {
#[primary_span] #[primary_span]
span: Span, span: Span,
@ -45,7 +45,7 @@ pub struct TranslatableInIntoDiagnostic;
impl<'a> IntoDiagnostic<'a, ErrorGuaranteed> for TranslatableInIntoDiagnostic { impl<'a> IntoDiagnostic<'a, ErrorGuaranteed> for TranslatableInIntoDiagnostic {
fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> { fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
handler.struct_err(fluent::parser::expect_path) handler.struct_err(fluent::compiletest::example)
} }
} }
@ -62,12 +62,12 @@ pub struct TranslatableInAddToDiagnostic;
impl AddToDiagnostic for TranslatableInAddToDiagnostic { impl AddToDiagnostic for TranslatableInAddToDiagnostic {
fn add_to_diagnostic(self, diag: &mut Diagnostic) { fn add_to_diagnostic(self, diag: &mut Diagnostic) {
diag.note(fluent::typeck::note); diag.note(fluent::compiletest::note);
} }
} }
pub fn make_diagnostics<'a>(handler: &'a Handler) { pub fn make_diagnostics<'a>(handler: &'a Handler) {
let _diag = handler.struct_err(fluent::parser::expect_path); let _diag = handler.struct_err(fluent::compiletest::example);
//~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls //~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
let _diag = handler.struct_err("untranslatable diagnostic"); let _diag = handler.struct_err("untranslatable diagnostic");

View file

@ -19,7 +19,7 @@ LL | diag.note("untranslatable diagnostic");
error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
--> $DIR/diagnostics.rs:70:25 --> $DIR/diagnostics.rs:70:25
| |
LL | let _diag = handler.struct_err(fluent::parser::expect_path); LL | let _diag = handler.struct_err(fluent::compiletest::example);
| ^^^^^^^^^^ | ^^^^^^^^^^
| |
note: the lint level is defined here note: the lint level is defined here

View file

@ -28,15 +28,15 @@ use rustc_errors::{Applicability, MultiSpan};
extern crate rustc_session; extern crate rustc_session;
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct Hello {} struct Hello {}
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct HelloWarn {} struct HelloWarn {}
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
//~^ ERROR unsupported type attribute for diagnostic derive enum //~^ ERROR unsupported type attribute for diagnostic derive enum
enum DiagnosticOnEnum { enum DiagnosticOnEnum {
Foo, Foo,
@ -46,13 +46,13 @@ enum DiagnosticOnEnum {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
#[diag = "E0123"] #[diag = "E0123"]
//~^ ERROR `#[diag = ...]` is not a valid attribute //~^ ERROR `#[diag = ...]` is not a valid attribute
struct WrongStructAttrStyle {} struct WrongStructAttrStyle {}
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")] #[nonsense(compiletest::example, code = "E0123")]
//~^ ERROR `#[nonsense(...)]` is not a valid attribute //~^ ERROR `#[nonsense(...)]` is not a valid attribute
//~^^ ERROR diagnostic slug not specified //~^^ ERROR diagnostic slug not specified
//~^^^ ERROR cannot find attribute `nonsense` in this scope //~^^^ ERROR cannot find attribute `nonsense` in this scope
@ -90,12 +90,12 @@ struct InvalidNestedStructAttr2 {}
struct InvalidNestedStructAttr3 {} struct InvalidNestedStructAttr3 {}
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123", slug = "foo")] #[diag(compiletest::example, code = "E0123", slug = "foo")]
//~^ ERROR `#[diag(slug = ...)]` is not a valid attribute //~^ ERROR `#[diag(slug = ...)]` is not a valid attribute
struct InvalidNestedStructAttr4 {} struct InvalidNestedStructAttr4 {}
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct WrongPlaceField { struct WrongPlaceField {
#[suggestion = "bar"] #[suggestion = "bar"]
//~^ ERROR `#[suggestion = ...]` is not a valid attribute //~^ ERROR `#[suggestion = ...]` is not a valid attribute
@ -103,20 +103,20 @@ struct WrongPlaceField {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0456")] #[diag(compiletest::example, code = "E0456")]
//~^ ERROR specified multiple times //~^ ERROR specified multiple times
//~^^ ERROR specified multiple times //~^^ ERROR specified multiple times
struct DiagSpecifiedTwice {} struct DiagSpecifiedTwice {}
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")] #[diag(compiletest::example, code = "E0456", code = "E0457")]
//~^ ERROR specified multiple times //~^ ERROR specified multiple times
struct CodeSpecifiedTwice {} struct CodeSpecifiedTwice {}
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, typeck::ambiguous_lifetime_bound, code = "E0456")] #[diag(compiletest::example, compiletest::example, code = "E0456")]
//~^ ERROR `#[diag(typeck::ambiguous_lifetime_bound)]` is not a valid attribute //~^ ERROR `#[diag(compiletest::example)]` is not a valid attribute
struct SlugSpecifiedTwice {} struct SlugSpecifiedTwice {}
#[derive(Diagnostic)] #[derive(Diagnostic)]
@ -128,11 +128,11 @@ struct KindNotProvided {} //~ ERROR diagnostic slug not specified
struct SlugNotProvided {} struct SlugNotProvided {}
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound)] #[diag(compiletest::example)]
struct CodeNotProvided {} struct CodeNotProvided {}
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, 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`
@ -140,7 +140,7 @@ struct MessageWrongType {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct InvalidPathFieldAttr { struct InvalidPathFieldAttr {
#[nonsense] #[nonsense]
//~^ ERROR `#[nonsense]` is not a valid attribute //~^ ERROR `#[nonsense]` is not a valid attribute
@ -149,34 +149,34 @@ struct InvalidPathFieldAttr {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorWithField { struct ErrorWithField {
name: String, name: String,
#[label(typeck::label)] #[label(compiletest::label)]
span: Span, span: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorWithMessageAppliedToField { struct ErrorWithMessageAppliedToField {
#[label(typeck::label)] #[label(compiletest::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`
name: String, name: String,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorWithNonexistentField { struct ErrorWithNonexistentField {
#[suggestion(typeck::suggestion, code = "{name}")] #[suggestion(compiletest::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
suggestion: (Span, Applicability), suggestion: (Span, Applicability),
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
//~^ ERROR invalid format string: expected `'}'` //~^ ERROR invalid format string: expected `'}'`
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorMissingClosingBrace { struct ErrorMissingClosingBrace {
#[suggestion(typeck::suggestion, code = "{name")] #[suggestion(compiletest::suggestion, code = "{name")]
suggestion: (Span, Applicability), suggestion: (Span, Applicability),
name: String, name: String,
val: usize, val: usize,
@ -184,49 +184,49 @@ struct ErrorMissingClosingBrace {
#[derive(Diagnostic)] #[derive(Diagnostic)]
//~^ ERROR invalid format string: unmatched `}` //~^ ERROR invalid format string: unmatched `}`
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorMissingOpeningBrace { struct ErrorMissingOpeningBrace {
#[suggestion(typeck::suggestion, code = "name}")] #[suggestion(compiletest::suggestion, code = "name}")]
suggestion: (Span, Applicability), suggestion: (Span, Applicability),
name: String, name: String,
val: usize, val: usize,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct LabelOnSpan { struct LabelOnSpan {
#[label(typeck::label)] #[label(compiletest::label)]
sp: Span, sp: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct LabelOnNonSpan { struct LabelOnNonSpan {
#[label(typeck::label)] #[label(compiletest::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`
id: u32, id: u32,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct Suggest { struct Suggest {
#[suggestion(typeck::suggestion, code = "This is the suggested code")] #[suggestion(compiletest::suggestion, code = "This is the suggested code")]
#[suggestion_short(typeck::suggestion, code = "This is the suggested code")] #[suggestion_short(compiletest::suggestion, code = "This is the suggested code")]
#[suggestion_hidden(typeck::suggestion, code = "This is the suggested code")] #[suggestion_hidden(compiletest::suggestion, code = "This is the suggested code")]
#[suggestion_verbose(typeck::suggestion, code = "This is the suggested code")] #[suggestion_verbose(compiletest::suggestion, code = "This is the suggested code")]
suggestion: (Span, Applicability), suggestion: (Span, Applicability),
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct SuggestWithoutCode { struct SuggestWithoutCode {
#[suggestion(typeck::suggestion)] #[suggestion(compiletest::suggestion)]
//~^ ERROR suggestion without `code = "..."` //~^ ERROR suggestion without `code = "..."`
suggestion: (Span, Applicability), suggestion: (Span, Applicability),
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, 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
@ -235,7 +235,7 @@ struct SuggestWithBadKey {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, 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,52 +244,52 @@ struct SuggestWithShorthandMsg {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct SuggestWithoutMsg { struct SuggestWithoutMsg {
#[suggestion(code = "bar")] #[suggestion(code = "bar")]
suggestion: (Span, Applicability), suggestion: (Span, Applicability),
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct SuggestWithTypesSwapped { struct SuggestWithTypesSwapped {
#[suggestion(typeck::suggestion, code = "This is suggested code")] #[suggestion(compiletest::suggestion, code = "This is suggested code")]
suggestion: (Applicability, Span), suggestion: (Applicability, Span),
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct SuggestWithWrongTypeApplicabilityOnly { struct SuggestWithWrongTypeApplicabilityOnly {
#[suggestion(typeck::suggestion, code = "This is suggested code")] #[suggestion(compiletest::suggestion, code = "This is suggested code")]
//~^ ERROR wrong field type for suggestion //~^ ERROR wrong field type for suggestion
suggestion: Applicability, suggestion: Applicability,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct SuggestWithSpanOnly { struct SuggestWithSpanOnly {
#[suggestion(typeck::suggestion, code = "This is suggested code")] #[suggestion(compiletest::suggestion, code = "This is suggested code")]
suggestion: Span, suggestion: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct SuggestWithDuplicateSpanAndApplicability { struct SuggestWithDuplicateSpanAndApplicability {
#[suggestion(typeck::suggestion, code = "This is suggested code")] #[suggestion(compiletest::suggestion, code = "This is suggested code")]
suggestion: (Span, Span, Applicability), suggestion: (Span, Span, Applicability),
//~^ ERROR specified multiple times //~^ ERROR specified multiple times
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct SuggestWithDuplicateApplicabilityAndSpan { struct SuggestWithDuplicateApplicabilityAndSpan {
#[suggestion(typeck::suggestion, code = "This is suggested code")] #[suggestion(compiletest::suggestion, code = "This is suggested code")]
suggestion: (Applicability, Applicability, Span), suggestion: (Applicability, Applicability, Span),
//~^ ERROR specified multiple times //~^ ERROR specified multiple times
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, 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,38 +297,38 @@ struct WrongKindOfAnnotation {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct OptionsInErrors { struct OptionsInErrors {
#[label(typeck::label)] #[label(compiletest::label)]
label: Option<Span>, label: Option<Span>,
#[suggestion(typeck::suggestion, code = "...")] #[suggestion(compiletest::suggestion, code = "...")]
opt_sugg: Option<(Span, Applicability)>, opt_sugg: Option<(Span, Applicability)>,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0456")] #[diag(compiletest::example, code = "E0456")]
struct MoveOutOfBorrowError<'tcx> { struct MoveOutOfBorrowError<'tcx> {
name: Ident, name: Ident,
ty: Ty<'tcx>, ty: Ty<'tcx>,
#[primary_span] #[primary_span]
#[label(typeck::label)] #[label(compiletest::label)]
span: Span, span: Span,
#[label(typeck::label)] #[label(compiletest::label)]
other_span: Span, other_span: Span,
#[suggestion(typeck::suggestion, code = "{name}.clone()")] #[suggestion(compiletest::suggestion, code = "{name}.clone()")]
opt_sugg: Option<(Span, Applicability)>, opt_sugg: Option<(Span, Applicability)>,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorWithLifetime<'a> { struct ErrorWithLifetime<'a> {
#[label(typeck::label)] #[label(compiletest::label)]
span: Span, span: Span,
name: &'a str, name: &'a str,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorWithDefaultLabelAttr<'a> { struct ErrorWithDefaultLabelAttr<'a> {
#[label] #[label]
span: Span, span: Span,
@ -337,7 +337,7 @@ struct ErrorWithDefaultLabelAttr<'a> {
#[derive(Diagnostic)] #[derive(Diagnostic)]
//~^ ERROR the trait bound `Hello: IntoDiagnosticArg` is not satisfied //~^ ERROR the trait bound `Hello: IntoDiagnosticArg` is not satisfied
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ArgFieldWithoutSkip { struct ArgFieldWithoutSkip {
#[primary_span] #[primary_span]
span: Span, span: Span,
@ -345,7 +345,7 @@ struct ArgFieldWithoutSkip {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ArgFieldWithSkip { struct ArgFieldWithSkip {
#[primary_span] #[primary_span]
span: Span, span: Span,
@ -356,116 +356,116 @@ struct ArgFieldWithSkip {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorWithSpannedNote { struct ErrorWithSpannedNote {
#[note] #[note]
span: Span, span: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorWithSpannedNoteCustom { struct ErrorWithSpannedNoteCustom {
#[note(typeck::note)] #[note(compiletest::note)]
span: Span, span: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
#[note] #[note]
struct ErrorWithNote { struct ErrorWithNote {
val: String, val: String,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
#[note(typeck::note)] #[note(compiletest::note)]
struct ErrorWithNoteCustom { struct ErrorWithNoteCustom {
val: String, val: String,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorWithSpannedHelp { struct ErrorWithSpannedHelp {
#[help] #[help]
span: Span, span: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorWithSpannedHelpCustom { struct ErrorWithSpannedHelpCustom {
#[help(typeck::help)] #[help(compiletest::help)]
span: Span, span: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
#[help] #[help]
struct ErrorWithHelp { struct ErrorWithHelp {
val: String, val: String,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
#[help(typeck::help)] #[help(compiletest::help)]
struct ErrorWithHelpCustom { struct ErrorWithHelpCustom {
val: String, val: String,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[help] #[help]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorWithHelpWrongOrder { struct ErrorWithHelpWrongOrder {
val: String, val: String,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[help(typeck::help)] #[help(compiletest::help)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorWithHelpCustomWrongOrder { struct ErrorWithHelpCustomWrongOrder {
val: String, val: String,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[note] #[note]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorWithNoteWrongOrder { struct ErrorWithNoteWrongOrder {
val: String, val: String,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[note(typeck::note)] #[note(compiletest::note)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorWithNoteCustomWrongOrder { struct ErrorWithNoteCustomWrongOrder {
val: String, val: String,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ApplicabilityInBoth { struct ApplicabilityInBoth {
#[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")] #[suggestion(compiletest::suggestion, code = "...", applicability = "maybe-incorrect")]
//~^ ERROR specified multiple times //~^ ERROR specified multiple times
suggestion: (Span, Applicability), suggestion: (Span, Applicability),
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct InvalidApplicability { struct InvalidApplicability {
#[suggestion(typeck::suggestion, code = "...", applicability = "batman")] #[suggestion(compiletest::suggestion, code = "...", applicability = "batman")]
//~^ ERROR invalid applicability //~^ ERROR invalid applicability
suggestion: Span, suggestion: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ValidApplicability { struct ValidApplicability {
#[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")] #[suggestion(compiletest::suggestion, code = "...", applicability = "maybe-incorrect")]
suggestion: Span, suggestion: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct NoApplicability { struct NoApplicability {
#[suggestion(typeck::suggestion, code = "...")] #[suggestion(compiletest::suggestion, code = "...")]
suggestion: Span, suggestion: Span,
} }
@ -474,14 +474,14 @@ struct NoApplicability {
struct Note; struct Note;
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound)] #[diag(compiletest::example)]
struct Subdiagnostic { struct Subdiagnostic {
#[subdiagnostic] #[subdiagnostic]
note: Note, note: Note,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct VecField { struct VecField {
#[primary_span] #[primary_span]
#[label] #[label]
@ -489,58 +489,58 @@ struct VecField {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct UnitField { struct UnitField {
#[primary_span] #[primary_span]
spans: Span, spans: Span,
#[help] #[help]
foo: (), foo: (),
#[help(typeck::help)] #[help(compiletest::help)]
bar: (), bar: (),
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct OptUnitField { struct OptUnitField {
#[primary_span] #[primary_span]
spans: Span, spans: Span,
#[help] #[help]
foo: Option<()>, foo: Option<()>,
#[help(typeck::help)] #[help(compiletest::help)]
bar: Option<()>, bar: Option<()>,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct LabelWithTrailingPath { struct LabelWithTrailingPath {
#[label(typeck::label, foo)] #[label(compiletest::label, foo)]
//~^ ERROR `#[label(foo)]` is not a valid attribute //~^ ERROR `#[label(foo)]` is not a valid attribute
span: Span, span: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct LabelWithTrailingNameValue { struct LabelWithTrailingNameValue {
#[label(typeck::label, foo = "...")] #[label(compiletest::label, foo = "...")]
//~^ ERROR `#[label(foo = ...)]` is not a valid attribute //~^ ERROR `#[label(foo = ...)]` is not a valid attribute
span: Span, span: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct LabelWithTrailingList { struct LabelWithTrailingList {
#[label(typeck::label, foo("..."))] #[label(compiletest::label, foo("..."))]
//~^ ERROR `#[label(foo(...))]` is not a valid attribute //~^ ERROR `#[label(foo(...))]` is not a valid attribute
span: Span, span: Span,
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[diag(typeck::ambiguous_lifetime_bound)] #[diag(compiletest::example)]
struct LintsGood { struct LintsGood {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[diag(typeck::ambiguous_lifetime_bound)] #[diag(compiletest::example)]
struct PrimarySpanOnLint { struct PrimarySpanOnLint {
#[primary_span] #[primary_span]
//~^ ERROR `#[primary_span]` is not a valid attribute //~^ ERROR `#[primary_span]` is not a valid attribute
@ -548,42 +548,42 @@ struct PrimarySpanOnLint {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct ErrorWithMultiSpan { struct ErrorWithMultiSpan {
#[primary_span] #[primary_span]
span: MultiSpan, span: MultiSpan,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
#[warning] #[warning]
struct ErrorWithWarn { struct ErrorWithWarn {
val: String, val: String,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] #[error(compiletest::example, code = "E0123")]
//~^ ERROR `#[error(...)]` is not a valid attribute //~^ ERROR `#[error(...)]` is not a valid attribute
//~| ERROR diagnostic slug not specified //~| ERROR diagnostic slug not specified
//~| ERROR cannot find attribute `error` in this scope //~| ERROR cannot find attribute `error` in this scope
struct ErrorAttribute {} struct ErrorAttribute {}
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")] #[warn_(compiletest::example, code = "E0123")]
//~^ ERROR `#[warn_(...)]` is not a valid attribute //~^ ERROR `#[warn_(...)]` is not a valid attribute
//~| ERROR diagnostic slug not specified //~| ERROR diagnostic slug not specified
//~| ERROR cannot find attribute `warn_` in this scope //~| ERROR cannot find attribute `warn_` in this scope
struct WarnAttribute {} struct WarnAttribute {}
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] #[lint(compiletest::example, code = "E0123")]
//~^ ERROR `#[lint(...)]` is not a valid attribute //~^ ERROR `#[lint(...)]` is not a valid attribute
//~| ERROR diagnostic slug not specified //~| ERROR diagnostic slug not specified
//~| ERROR cannot find attribute `lint` in this scope //~| ERROR cannot find attribute `lint` in this scope
struct LintAttributeOnSessionDiag {} struct LintAttributeOnSessionDiag {}
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] #[lint(compiletest::example, code = "E0123")]
//~^ ERROR `#[lint(...)]` is not a valid attribute //~^ ERROR `#[lint(...)]` is not a valid attribute
//~| ERROR `#[lint(...)]` is not a valid attribute //~| ERROR `#[lint(...)]` is not a valid attribute
//~| ERROR diagnostic slug not specified //~| ERROR diagnostic slug not specified
@ -591,55 +591,55 @@ struct LintAttributeOnSessionDiag {}
struct LintAttributeOnLintDiag {} struct LintAttributeOnLintDiag {}
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct DuplicatedSuggestionCode { struct DuplicatedSuggestionCode {
#[suggestion(typeck::suggestion, code = "...", code = ",,,")] #[suggestion(compiletest::suggestion, code = "...", code = ",,,")]
//~^ ERROR specified multiple times //~^ ERROR specified multiple times
suggestion: Span, suggestion: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct InvalidTypeInSuggestionTuple { struct InvalidTypeInSuggestionTuple {
#[suggestion(typeck::suggestion, code = "...")] #[suggestion(compiletest::suggestion, code = "...")]
suggestion: (Span, usize), suggestion: (Span, usize),
//~^ ERROR wrong types for suggestion //~^ ERROR wrong types for suggestion
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct MissingApplicabilityInSuggestionTuple { struct MissingApplicabilityInSuggestionTuple {
#[suggestion(typeck::suggestion, code = "...")] #[suggestion(compiletest::suggestion, code = "...")]
suggestion: (Span,), suggestion: (Span,),
//~^ ERROR wrong types for suggestion //~^ ERROR wrong types for suggestion
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct MissingCodeInSuggestion { struct MissingCodeInSuggestion {
#[suggestion(typeck::suggestion)] #[suggestion(compiletest::suggestion)]
//~^ ERROR suggestion without `code = "..."` //~^ ERROR suggestion without `code = "..."`
suggestion: Span, suggestion: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
#[multipart_suggestion(typeck::suggestion)] #[multipart_suggestion(compiletest::suggestion)]
//~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute //~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
//~| ERROR cannot find attribute `multipart_suggestion` in this scope //~| ERROR cannot find attribute `multipart_suggestion` in this scope
#[multipart_suggestion()] #[multipart_suggestion()]
//~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute //~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
//~| ERROR cannot find attribute `multipart_suggestion` in this scope //~| ERROR cannot find attribute `multipart_suggestion` in this scope
struct MultipartSuggestion { struct MultipartSuggestion {
#[multipart_suggestion(typeck::suggestion)] #[multipart_suggestion(compiletest::suggestion)]
//~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute //~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
//~| ERROR cannot find attribute `multipart_suggestion` in this scope //~| ERROR cannot find attribute `multipart_suggestion` in this scope
suggestion: Span, suggestion: Span,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
#[suggestion(typeck::suggestion, code = "...")] #[suggestion(compiletest::suggestion, code = "...")]
//~^ ERROR `#[suggestion(...)]` is not a valid attribute //~^ ERROR `#[suggestion(...)]` is not a valid attribute
struct SuggestionOnStruct { struct SuggestionOnStruct {
#[primary_span] #[primary_span]
@ -647,7 +647,7 @@ struct SuggestionOnStruct {
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
#[label] #[label]
//~^ ERROR `#[label]` is not a valid attribute //~^ ERROR `#[label]` is not a valid attribute
struct LabelOnStruct { struct LabelOnStruct {
@ -657,24 +657,24 @@ struct LabelOnStruct {
#[derive(Diagnostic)] #[derive(Diagnostic)]
enum ExampleEnum { enum ExampleEnum {
#[diag(typeck::ambiguous_lifetime_bound)] #[diag(compiletest::example)]
Foo { Foo {
#[primary_span] #[primary_span]
sp: Span, sp: Span,
#[note] #[note]
note_sp: Span, note_sp: Span,
}, },
#[diag(typeck::ambiguous_lifetime_bound)] #[diag(compiletest::example)]
Bar { Bar {
#[primary_span] #[primary_span]
sp: Span, sp: Span,
}, },
#[diag(typeck::ambiguous_lifetime_bound)] #[diag(compiletest::example)]
Baz, Baz,
} }
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] #[diag(compiletest::example, code = "E0123")]
struct RawIdentDiagnosticArg { struct RawIdentDiagnosticArg {
pub r#type: String, pub r#type: String,
} }

View file

@ -1,8 +1,8 @@
error: unsupported type attribute for diagnostic derive enum error: unsupported type attribute for diagnostic derive enum
--> $DIR/diagnostic-derive.rs:39:1 --> $DIR/diagnostic-derive.rs:39:1
| |
LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[diag(compiletest::example, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:42:5 --> $DIR/diagnostic-derive.rs:42:5
@ -10,7 +10,7 @@ error: diagnostic slug not specified
LL | Foo, LL | Foo,
| ^^^ | ^^^
| |
= 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(hir_analysis::example_error)]`
error: diagnostic slug not specified error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:44:5 --> $DIR/diagnostic-derive.rs:44:5
@ -18,7 +18,7 @@ error: diagnostic slug not specified
LL | Bar, LL | Bar,
| ^^^ | ^^^
| |
= 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(hir_analysis::example_error)]`
error: `#[diag = ...]` is not a valid attribute error: `#[diag = ...]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:50:1 --> $DIR/diagnostic-derive.rs:50:1
@ -29,20 +29,20 @@ LL | #[diag = "E0123"]
error: `#[nonsense(...)]` is not a valid attribute error: `#[nonsense(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:55:1 --> $DIR/diagnostic-derive.rs:55:1
| |
LL | #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[nonsense(compiletest::example, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:55:1 --> $DIR/diagnostic-derive.rs:55:1
| |
LL | / #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | / #[nonsense(compiletest::example, code = "E0123")]
LL | | LL | |
LL | | LL | |
LL | | LL | |
LL | | struct InvalidStructAttr {} 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(hir_analysis::example_error)]`
error: `#[diag("...")]` is not a valid attribute error: `#[diag("...")]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:62:8 --> $DIR/diagnostic-derive.rs:62:8
@ -61,7 +61,7 @@ LL | |
LL | | struct InvalidLitNestedAttr {} 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(hir_analysis::example_error)]`
error: `#[diag(nonsense(...))]` is not a valid attribute error: `#[diag(nonsense(...))]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:73:8 --> $DIR/diagnostic-derive.rs:73:8
@ -80,7 +80,7 @@ LL | |
LL | | struct InvalidNestedStructAttr1 {} 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(hir_analysis::example_error)]`
error: `#[diag(nonsense = ...)]` is not a valid attribute error: `#[diag(nonsense = ...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:79:8 --> $DIR/diagnostic-derive.rs:79:8
@ -108,7 +108,7 @@ LL | |
LL | | struct InvalidNestedStructAttr2 {} 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(hir_analysis::example_error)]`
error: `#[diag(nonsense = ...)]` is not a valid attribute error: `#[diag(nonsense = ...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:86:8 --> $DIR/diagnostic-derive.rs:86:8
@ -134,13 +134,13 @@ LL | |
LL | | struct InvalidNestedStructAttr3 {} 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(hir_analysis::example_error)]`
error: `#[diag(slug = ...)]` is not a valid attribute error: `#[diag(slug = ...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:93:58 --> $DIR/diagnostic-derive.rs:93:46
| |
LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123", slug = "foo")] LL | #[diag(compiletest::example, 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
@ -153,44 +153,44 @@ LL | #[suggestion = "bar"]
error: specified multiple times error: specified multiple times
--> $DIR/diagnostic-derive.rs:107:8 --> $DIR/diagnostic-derive.rs:107:8
| |
LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456")] LL | #[diag(compiletest::example, code = "E0456")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
| |
note: previously specified here note: previously specified here
--> $DIR/diagnostic-derive.rs:106:8 --> $DIR/diagnostic-derive.rs:106:8
| |
LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[diag(compiletest::example, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
error: specified multiple times error: specified multiple times
--> $DIR/diagnostic-derive.rs:107:49 --> $DIR/diagnostic-derive.rs:107:37
| |
LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456")] LL | #[diag(compiletest::example, code = "E0456")]
| ^^^^^^^ | ^^^^^^^
| |
note: previously specified here note: previously specified here
--> $DIR/diagnostic-derive.rs:106:49 --> $DIR/diagnostic-derive.rs:106:37
| |
LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[diag(compiletest::example, code = "E0123")]
| ^^^^^^^ | ^^^^^^^
error: specified multiple times error: specified multiple times
--> $DIR/diagnostic-derive.rs:113:65 --> $DIR/diagnostic-derive.rs:113:53
| |
LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")] LL | #[diag(compiletest::example, code = "E0456", code = "E0457")]
| ^^^^^^^ | ^^^^^^^
| |
note: previously specified here note: previously specified here
--> $DIR/diagnostic-derive.rs:113:49 --> $DIR/diagnostic-derive.rs:113:37
| |
LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")] LL | #[diag(compiletest::example, code = "E0456", code = "E0457")]
| ^^^^^^^ | ^^^^^^^
error: `#[diag(typeck::ambiguous_lifetime_bound)]` is not a valid attribute error: `#[diag(compiletest::example)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:118:42 --> $DIR/diagnostic-derive.rs:118:30
| |
LL | #[diag(typeck::ambiguous_lifetime_bound, typeck::ambiguous_lifetime_bound, code = "E0456")] LL | #[diag(compiletest::example, compiletest::example, code = "E0456")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
| |
= help: diagnostic slug must be the first argument = help: diagnostic slug must be the first argument
@ -200,7 +200,7 @@ error: diagnostic slug not specified
LL | struct KindNotProvided {} 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(hir_analysis::example_error)]`
error: diagnostic slug not specified error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:126:1 --> $DIR/diagnostic-derive.rs:126:1
@ -210,7 +210,7 @@ LL | |
LL | | struct SlugNotProvided {} 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(hir_analysis::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:137:5 --> $DIR/diagnostic-derive.rs:137:5
@ -227,14 +227,14 @@ LL | #[nonsense]
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:162:5 --> $DIR/diagnostic-derive.rs:162:5
| |
LL | #[label(typeck::label)] LL | #[label(compiletest::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:170:45 --> $DIR/diagnostic-derive.rs:170:50
| |
LL | #[suggestion(typeck::suggestion, code = "{name}")] LL | #[suggestion(compiletest::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:175:10 --> $DIR/diagnostic-derive.rs:175:10
@ -257,14 +257,14 @@ LL | #[derive(Diagnostic)]
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:205:5 --> $DIR/diagnostic-derive.rs:205:5
| |
LL | #[label(typeck::label)] LL | #[label(compiletest::label)]
| ^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: suggestion without `code = "..."` error: suggestion without `code = "..."`
--> $DIR/diagnostic-derive.rs:223:5 --> $DIR/diagnostic-derive.rs:223:5
| |
LL | #[suggestion(typeck::suggestion)] LL | #[suggestion(compiletest::suggestion)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[suggestion(nonsense = ...)]` is not a valid attribute error: `#[suggestion(nonsense = ...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:231:18 --> $DIR/diagnostic-derive.rs:231:18
@ -297,7 +297,7 @@ LL | #[suggestion(msg = "bar")]
error: wrong field type for suggestion error: wrong field type for suggestion
--> $DIR/diagnostic-derive.rs:263:5 --> $DIR/diagnostic-derive.rs:263:5
| |
LL | / #[suggestion(typeck::suggestion, code = "This is suggested code")] LL | / #[suggestion(compiletest::suggestion, code = "This is suggested code")]
LL | | LL | |
LL | | suggestion: Applicability, LL | | suggestion: Applicability,
| |_____________________________^ | |_____________________________^
@ -335,10 +335,10 @@ LL | #[label = "bar"]
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: specified multiple times error: specified multiple times
--> $DIR/diagnostic-derive.rs:445:52 --> $DIR/diagnostic-derive.rs:445:57
| |
LL | #[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")] LL | #[suggestion(compiletest::suggestion, code = "...", applicability = "maybe-incorrect")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
note: previously specified here note: previously specified here
--> $DIR/diagnostic-derive.rs:447:24 --> $DIR/diagnostic-derive.rs:447:24
@ -347,30 +347,30 @@ LL | suggestion: (Span, Applicability),
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
error: invalid applicability error: invalid applicability
--> $DIR/diagnostic-derive.rs:453:52 --> $DIR/diagnostic-derive.rs:453:57
| |
LL | #[suggestion(typeck::suggestion, code = "...", applicability = "batman")] LL | #[suggestion(compiletest::suggestion, code = "...", applicability = "batman")]
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[label(foo)]` is not a valid attribute error: `#[label(foo)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:516:28 --> $DIR/diagnostic-derive.rs:516:33
| |
LL | #[label(typeck::label, foo)] LL | #[label(compiletest::label, foo)]
| ^^^ | ^^^
| |
= help: a diagnostic slug must be the first argument to the attribute = help: a diagnostic slug must be the first argument to the attribute
error: `#[label(foo = ...)]` is not a valid attribute error: `#[label(foo = ...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:524:28 --> $DIR/diagnostic-derive.rs:524:33
| |
LL | #[label(typeck::label, foo = "...")] LL | #[label(compiletest::label, foo = "...")]
| ^^^^^^^^^^^ | ^^^^^^^^^^^
error: `#[label(foo(...))]` is not a valid attribute error: `#[label(foo(...))]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:532:28 --> $DIR/diagnostic-derive.rs:532:33
| |
LL | #[label(typeck::label, foo("..."))] LL | #[label(compiletest::label, foo("..."))]
| ^^^^^^^^^^ | ^^^^^^^^^^
error: `#[primary_span]` is not a valid attribute error: `#[primary_span]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:545:5 --> $DIR/diagnostic-derive.rs:545:5
@ -383,73 +383,73 @@ LL | #[primary_span]
error: `#[error(...)]` is not a valid attribute error: `#[error(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:565:1 --> $DIR/diagnostic-derive.rs:565:1
| |
LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[error(compiletest::example, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:565:1 --> $DIR/diagnostic-derive.rs:565:1
| |
LL | / #[error(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | / #[error(compiletest::example, code = "E0123")]
LL | | LL | |
LL | | LL | |
LL | | LL | |
LL | | struct ErrorAttribute {} LL | | struct ErrorAttribute {}
| |________________________^ | |________________________^
| |
= 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(hir_analysis::example_error)]`
error: `#[warn_(...)]` is not a valid attribute error: `#[warn_(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:572:1 --> $DIR/diagnostic-derive.rs:572:1
| |
LL | #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[warn_(compiletest::example, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:572:1 --> $DIR/diagnostic-derive.rs:572:1
| |
LL | / #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | / #[warn_(compiletest::example, code = "E0123")]
LL | | LL | |
LL | | LL | |
LL | | LL | |
LL | | struct WarnAttribute {} LL | | struct WarnAttribute {}
| |_______________________^ | |_______________________^
| |
= 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(hir_analysis::example_error)]`
error: `#[lint(...)]` is not a valid attribute error: `#[lint(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:579:1 --> $DIR/diagnostic-derive.rs:579:1
| |
LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[lint(compiletest::example, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:579:1 --> $DIR/diagnostic-derive.rs:579:1
| |
LL | / #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | / #[lint(compiletest::example, code = "E0123")]
LL | | LL | |
LL | | LL | |
LL | | LL | |
LL | | struct LintAttributeOnSessionDiag {} LL | | struct LintAttributeOnSessionDiag {}
| |____________________________________^ | |____________________________________^
| |
= 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(hir_analysis::example_error)]`
error: `#[lint(...)]` is not a valid attribute error: `#[lint(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:586:1 --> $DIR/diagnostic-derive.rs:586:1
| |
LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[lint(compiletest::example, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[lint(...)]` is not a valid attribute error: `#[lint(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:586:1 --> $DIR/diagnostic-derive.rs:586:1
| |
LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[lint(compiletest::example, code = "E0123")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug not specified error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:586:1 --> $DIR/diagnostic-derive.rs:586:1
| |
LL | / #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | / #[lint(compiletest::example, code = "E0123")]
LL | | LL | |
LL | | LL | |
LL | | LL | |
@ -457,19 +457,19 @@ LL | |
LL | | struct LintAttributeOnLintDiag {} LL | | struct LintAttributeOnLintDiag {}
| |_________________________________^ | |_________________________________^
| |
= help: specify the slug as the first argument to the attribute, such as `#[diag(typeck::example_error)]` = help: specify the slug as the first argument to the attribute, such as `#[diag(compiletest::example)]`
error: specified multiple times error: specified multiple times
--> $DIR/diagnostic-derive.rs:596:52 --> $DIR/diagnostic-derive.rs:596:57
| |
LL | #[suggestion(typeck::suggestion, code = "...", code = ",,,")] LL | #[suggestion(compiletest::suggestion, code = "...", code = ",,,")]
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
| |
note: previously specified here note: previously specified here
--> $DIR/diagnostic-derive.rs:596:38 --> $DIR/diagnostic-derive.rs:596:43
| |
LL | #[suggestion(typeck::suggestion, code = "...", code = ",,,")] LL | #[suggestion(compiletest::suggestion, code = "...", code = ",,,")]
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
error: wrong types for suggestion error: wrong types for suggestion
--> $DIR/diagnostic-derive.rs:605:24 --> $DIR/diagnostic-derive.rs:605:24
@ -490,14 +490,14 @@ LL | suggestion: (Span,),
error: suggestion without `code = "..."` error: suggestion without `code = "..."`
--> $DIR/diagnostic-derive.rs:620:5 --> $DIR/diagnostic-derive.rs:620:5
| |
LL | #[suggestion(typeck::suggestion)] LL | #[suggestion(compiletest::suggestion)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[multipart_suggestion(...)]` is not a valid attribute error: `#[multipart_suggestion(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:627:1 --> $DIR/diagnostic-derive.rs:627:1
| |
LL | #[multipart_suggestion(typeck::suggestion)] LL | #[multipart_suggestion(compiletest::suggestion)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= help: consider creating a `Subdiagnostic` instead = help: consider creating a `Subdiagnostic` instead
@ -512,16 +512,16 @@ LL | #[multipart_suggestion()]
error: `#[multipart_suggestion(...)]` is not a valid attribute error: `#[multipart_suggestion(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:634:5 --> $DIR/diagnostic-derive.rs:634:5
| |
LL | #[multipart_suggestion(typeck::suggestion)] LL | #[multipart_suggestion(compiletest::suggestion)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= help: consider creating a `Subdiagnostic` instead = help: consider creating a `Subdiagnostic` instead
error: `#[suggestion(...)]` is not a valid attribute error: `#[suggestion(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:642:1 --> $DIR/diagnostic-derive.rs:642:1
| |
LL | #[suggestion(typeck::suggestion, code = "...")] LL | #[suggestion(compiletest::suggestion, code = "...")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
= help: `#[label]` and `#[suggestion]` can only be applied to fields = help: `#[label]` and `#[suggestion]` can only be applied to fields
@ -536,7 +536,7 @@ LL | #[label]
error: cannot find attribute `nonsense` in this scope error: cannot find attribute `nonsense` in this scope
--> $DIR/diagnostic-derive.rs:55:3 --> $DIR/diagnostic-derive.rs:55:3
| |
LL | #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[nonsense(compiletest::example, code = "E0123")]
| ^^^^^^^^ | ^^^^^^^^
error: cannot find attribute `nonsense` in this scope error: cannot find attribute `nonsense` in this scope
@ -548,31 +548,31 @@ LL | #[nonsense]
error: cannot find attribute `error` in this scope error: cannot find attribute `error` in this scope
--> $DIR/diagnostic-derive.rs:565:3 --> $DIR/diagnostic-derive.rs:565:3
| |
LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[error(compiletest::example, code = "E0123")]
| ^^^^^ | ^^^^^
error: cannot find attribute `warn_` in this scope error: cannot find attribute `warn_` in this scope
--> $DIR/diagnostic-derive.rs:572:3 --> $DIR/diagnostic-derive.rs:572:3
| |
LL | #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[warn_(compiletest::example, code = "E0123")]
| ^^^^^ help: a built-in attribute with a similar name exists: `warn` | ^^^^^ help: a built-in attribute with a similar name exists: `warn`
error: cannot find attribute `lint` in this scope error: cannot find attribute `lint` in this scope
--> $DIR/diagnostic-derive.rs:579:3 --> $DIR/diagnostic-derive.rs:579:3
| |
LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[lint(compiletest::example, code = "E0123")]
| ^^^^ help: a built-in attribute with a similar name exists: `link` | ^^^^ help: a built-in attribute with a similar name exists: `link`
error: cannot find attribute `lint` in this scope error: cannot find attribute `lint` in this scope
--> $DIR/diagnostic-derive.rs:586:3 --> $DIR/diagnostic-derive.rs:586:3
| |
LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] LL | #[lint(compiletest::example, code = "E0123")]
| ^^^^ help: a built-in attribute with a similar name exists: `link` | ^^^^ help: a built-in attribute with a similar name exists: `link`
error: cannot find attribute `multipart_suggestion` in this scope error: cannot find attribute `multipart_suggestion` in this scope
--> $DIR/diagnostic-derive.rs:627:3 --> $DIR/diagnostic-derive.rs:627:3
| |
LL | #[multipart_suggestion(typeck::suggestion)] LL | #[multipart_suggestion(compiletest::suggestion)]
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
error: cannot find attribute `multipart_suggestion` in this scope error: cannot find attribute `multipart_suggestion` in this scope
@ -584,7 +584,7 @@ LL | #[multipart_suggestion()]
error: cannot find attribute `multipart_suggestion` in this scope error: cannot find attribute `multipart_suggestion` in this scope
--> $DIR/diagnostic-derive.rs:634:7 --> $DIR/diagnostic-derive.rs:634:7
| |
LL | #[multipart_suggestion(typeck::suggestion)] LL | #[multipart_suggestion(compiletest::suggestion)]
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
error[E0425]: cannot find value `nonsense` in module `rustc_errors::fluent` error[E0425]: cannot find value `nonsense` in module `rustc_errors::fluent`