diff --git a/compiler/rustc_attr_ir/src/attribute_docs.rs b/compiler/rustc_attr_ir/src/attribute_docs.rs index cc6e3d849d6b1..cb42c7a7bd742 100644 --- a/compiler/rustc_attr_ir/src/attribute_docs.rs +++ b/compiler/rustc_attr_ir/src/attribute_docs.rs @@ -425,11 +425,11 @@ const _: () = (); /// positional and listed parameters are not accepted. /// The following parameter names are valid: /// - `Self` and all generic parameters of the trait. -/// - `This`: the name of the trait the attribute is on, without generics. -/// - `This:path`: the full path of the trait the attribute is on, with unresolved generics. -/// - `This:resolved`: the full path of the trait the attribute is on, with resolved generics. +/// - `this`: the name of the trait the attribute is on, without generics. +/// - `this:path`: the full path of the trait the attribute is on, with unresolved generics. +/// - `this:resolved`: the full path of the trait the attribute is on, with resolved generics. /// Additionally, this will "sugar" the `Fn(...)` traits. -/// - `ItemContext`: the kind of `hir::Node` we're in, things like `"an async block"`, +/// - `item_context`: the kind of `hir::Node` we're in, things like `"an async block"`, /// `"a function"`, `"an async function"`, etc. /// #[doc = include_example!("rustc_on_unimplemented_format")] diff --git a/compiler/rustc_attr_ir/src/diagnostic.rs b/compiler/rustc_attr_ir/src/diagnostic.rs index ead8fbb89dfbd..bfbeb3fc54555 100644 --- a/compiler/rustc_attr_ir/src/diagnostic.rs +++ b/compiler/rustc_attr_ir/src/diagnostic.rs @@ -237,22 +237,22 @@ pub enum FormatArg { }, // `{Self}` SelfUpper, - /// `{This}` and `{This:name}`. + /// `{this}` and `{this:name}`. This, - /// The sugared form: `{This:sugared}`. + /// The sugared form: `{this:resolved}`. ThisResolved, - /// The full path: `{This:path}`. + /// The full path: `{this:path}`. ThisPath, - /// what we're in, like a function, method, closure etc. + /// What we're in, like a function, method, closure etc. Used via `{item_context}`. ItemContext, - /// What the user typed, if it doesn't match anything we can use. - AsIs(Symbol), - /// {Found} in diagnostic::on_type_error + /// {found} in diagnostic::on_type_error Found, - /// {Expected} in diagnostic::on_type_error + /// {expected} in diagnostic::on_type_error Expected, - /// {Unresolved} in diagnostic::on_unknown + /// {unresolved} in diagnostic::on_unknown Unresolved, + /// What the user typed, if it doesn't match anything we can use. + AsIs(Symbol), } /// Represents the `on` filter in `#[rustc_on_unimplemented]`. diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs index 53114d0ca9d8a..96dabe6ae46dd 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/mod.rs @@ -174,13 +174,13 @@ impl Mode { "only `Self` and generics of the implementation are allowed as a format argument" } Self::DiagnosticOnMove => { - "only `This`, `Self` and generics of the type are allowed as a format argument" + "only `this`, `Self` and generics of the type are allowed as a format argument" } Self::DiagnosticOnUnknown => { - "only `This` is allowed as a format argument, referring to the failed import" + "only `this` is allowed as a format argument, referring to the failed import" } Self::DiagnosticOnUnmatchedArgs => { - "only `This` is allowed as a format argument, referring to the macro's name" + "only `this` is allowed as a format argument, referring to the macro's name" } Self::DiagnosticOnTypeError => { "only `note` is allowed as option for `diagnostic::on_type_error`" @@ -515,10 +515,10 @@ fn parse_arg( let ret = match arg.position { // Something like "hello {name}" Position::ArgumentNamed(name) => match (mode, Symbol::intern(name)) { - (Mode::RustcOnUnimplemented, sym::ItemContext) => FormatArg::ItemContext, + (Mode::RustcOnUnimplemented, sym::item_context) => FormatArg::ItemContext, - // `{This:ty}` - (Mode::RustcOnUnimplemented, sym::This) => match arg.format.ty { + // `{this:ty}` + (Mode::RustcOnUnimplemented, sym::this) => match arg.format.ty { "resolved" => { check_format = false; FormatArg::ThisResolved @@ -530,11 +530,11 @@ fn parse_arg( _ => FormatArg::This, }, - (Mode::DiagnosticOnTypeError, sym::Found) => FormatArg::Found, - (Mode::DiagnosticOnTypeError, sym::Expected) => FormatArg::Expected, - (Mode::DiagnosticOnUnknown, sym::Unresolved) => FormatArg::Unresolved, + (Mode::DiagnosticOnTypeError, sym::found) => FormatArg::Found, + (Mode::DiagnosticOnTypeError, sym::expected) => FormatArg::Expected, + (Mode::DiagnosticOnUnknown, sym::unresolved) => FormatArg::Unresolved, - // Some diagnostic attributes can use `{This}` to refer to the annotated item. + // Some diagnostic attributes can use `{this}` to refer to the annotated item. // For those that don't, we continue and maybe use it as a generic parameter. // // FIXME(mejrs) `DiagnosticOnUnimplemented` is intentionally not here; @@ -544,13 +544,13 @@ fn parse_arg( | Mode::DiagnosticOnMove | Mode::DiagnosticOnUnmatchedArgs | Mode::DiagnosticOnTypeError, - sym::This, + sym::this, ) => FormatArg::This, // `{Self}`; the self type. // - For trait declaration attributes that's the type that does not implement it. // - for trait impl attributes, the implemented for type. - // - For ADT attributes, that's the type (which will be identical to `{This}`) + // - For ADT attributes, that's the type (which will be identical to `{this}`) // - For everything else it doesn't make sense. ( Mode::RustcOnUnimplemented diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index af61cca62122a..698289c3b5dba 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -721,7 +721,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { } }); - let is_allowed = argument_name == sym::Expected || argument_name == sym::Found; + let is_allowed = argument_name == sym::expected || argument_name == sym::found; if !(has_generic | is_allowed) { self.tcx.emit_node_span_lint( MALFORMED_DIAGNOSTIC_FORMAT_LITERALS, diff --git a/compiler/rustc_passes/src/diagnostics.rs b/compiler/rustc_passes/src/diagnostics.rs index 9ec4e10c5fa64..57c6cc4f6513f 100644 --- a/compiler/rustc_passes/src/diagnostics.rs +++ b/compiler/rustc_passes/src/diagnostics.rs @@ -1030,7 +1030,7 @@ pub(crate) struct GlobOrListDelegationUnusedTargetExpr { #[derive(Diagnostic)] #[diag("unknown parameter `{$name}`")] -#[help(r#"expect either a generic argument name, {"`{This}`"}, {"`{Expected}`"} or {"`{Found}`"} as format argument"#)] +#[help(r#"expect either a generic argument name, {"`{this}`"}, {"`{expected}`"} or {"`{found}`"} as format argument"#)] pub(crate) struct OnTypeErrorMalformedFormatLiterals { pub name: Symbol, } diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 0f6a0b7012ad7..22d453df065c9 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -219,7 +219,6 @@ symbols! { Equal, Err, ExitCode, - Expected, ExternC, ExternRust, Float, @@ -233,7 +232,6 @@ symbols! { FnPtrToPtr, Formatter, Forward, - Found, From, FromIterator, FromResidual, @@ -257,7 +255,6 @@ symbols! { IoBufReader, IrTyKind, Item, - ItemContext, Iterator, IteratorItem, IteratorMap, @@ -361,7 +358,6 @@ symbols! { Type, TypeVisitable, Union, - Unresolved, Unsafe, UnsafeFnPointer, Unsize, @@ -1051,6 +1047,7 @@ symbols! { format_macro, format_placeholder, format_unsafe_arg, + found, fp, fpregs, framework, @@ -1205,6 +1202,7 @@ symbols! { issue_5723_bootstrap, issue_tracker_base_url, item, + item_context, item_like_imports, iter, iter_mut, @@ -2175,6 +2173,7 @@ symbols! { test_removed_feature, test_runner, test_unstable_lint, + this, thread, thread_local, threadptr, @@ -2323,6 +2322,7 @@ symbols! { unreachable_code, unreachable_display, unreachable_macro, + unresolved, unrestricted_attribute_tokens, unsafe_attributes, unsafe_binders, @@ -3008,9 +3008,19 @@ pub mod kw { /// /// Given that `sym` is imported, use them like `sym::symbol_name`. /// For example `sym::rustfmt` or `sym::u8`. -#[diagnostic::on_unknown( - label = "`{Unresolved}` is not a pre-interned symbol", - note = "consider adding `{Unresolved}` to the `symbols!` invocation in compiler/rustc_span/src/symbol.rs" +#[cfg_attr( + bootstrap, + diagnostic::on_unknown( + label = "`{Unresolved}` is not a pre-interned symbol", + note = "consider adding `{Unresolved}` to the `symbols!` invocation in compiler/rustc_span/src/symbol.rs" + ) +)] +#[cfg_attr( + not(bootstrap), + diagnostic::on_unknown( + label = "`{unresolved}` is not a pre-interned symbol", + note = "consider adding `{unresolved}` to the `symbols!` invocation in compiler/rustc_span/src/symbol.rs" + ) )] pub mod sym { use super::Symbol; diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs index 1f1b581c5e546..dd84cc9792c71 100644 --- a/library/core/src/fmt/mod.rs +++ b/library/core/src/fmt/mod.rs @@ -1038,14 +1038,14 @@ impl Display for Arguments<'_> { #[rustc_on_unimplemented( on( all(crate_local, not(Self = "{union}")), - note = "add `#[derive(Debug)]` to `{Self}` or manually `impl {This} for {Self}`" + note = "add `#[derive(Debug)]` to `{Self}` or manually `impl {this} for {Self}`" ), - on(all(crate_local, Self = "{union}"), note = "manually `impl {This} for {Self}`"), + on(all(crate_local, Self = "{union}"), note = "manually `impl {this} for {Self}`"), on( from_desugaring = "FormatLiteral", - label = "`{Self}` cannot be formatted using `{{:?}}` because it doesn't implement `{This}`" + label = "`{Self}` cannot be formatted using `{{:?}}` because it doesn't implement `{this}`" ), - message = "`{Self}` doesn't implement `{This}`" + message = "`{Self}` doesn't implement `{this}`" )] #[doc(alias = "{:?}")] #[rustc_diagnostic_item = "Debug"] @@ -1179,7 +1179,7 @@ pub use macros::Debug; note = "in format strings you may be able to use `{{:?}}` (or `{{:#?}}` for pretty-print) instead", label = "`{Self}` cannot be formatted with the default formatter", ), - message = "`{Self}` doesn't implement `{This}`" + message = "`{Self}` doesn't implement `{this}`" )] #[doc(alias = "{}")] #[rustc_diagnostic_item = "Display"] diff --git a/library/core/src/ops/function.rs b/library/core/src/ops/function.rs index 6c0d96ace2a4d..fd1bf57f75ce1 100644 --- a/library/core/src/ops/function.rs +++ b/library/core/src/ops/function.rs @@ -67,8 +67,8 @@ use crate::ptr::NonNull; // SAFETY: tidy is not smart enough to tell that the below unsafe block is a string label = "call the function in a closure: `|| unsafe {{ /* code */ }}`" ), - message = "expected `{This:resolved}` signature, found `{Self}`", - label = "expected `{This:resolved}` signature, found `{Self}`" + message = "expected `{this:resolved}` signature, found `{Self}`", + label = "expected `{this:resolved}` signature, found `{Self}`" )] #[fundamental] // so that regex can rely that `&str: !FnMut` #[must_use = "closures are lazy and do nothing unless called"] @@ -154,8 +154,8 @@ pub const trait Fn: [const] FnMut { // SAFETY: tidy is not smart enough to tell that the below unsafe block is a string label = "call the function in a closure: `|| unsafe {{ /* code */ }}`" ), - message = "expected `{This:resolved}` signature, found `{Self}`", - label = "expected `{This:resolved}` signature, found `{Self}`" + message = "expected `{this:resolved}` signature, found `{Self}`", + label = "expected `{this:resolved}` signature, found `{Self}`" )] #[fundamental] // so that regex can rely that `&str: !FnMut` #[must_use = "closures are lazy and do nothing unless called"] @@ -233,8 +233,8 @@ pub const trait FnMut: FnOnce { // SAFETY: tidy is not smart enough to tell that the below unsafe block is a string label = "call the function in a closure: `|| unsafe {{ /* code */ }}`" ), - message = "expected `{This:resolved}` signature, found `{Self}`", - label = "expected `{This:resolved}` signature, found `{Self}`" + message = "expected `{this:resolved}` signature, found `{Self}`", + label = "expected `{this:resolved}` signature, found `{Self}`" )] #[fundamental] // so that regex can rely that `&str: !FnMut` #[must_use = "closures are lazy and do nothing unless called"] diff --git a/library/core/src/ops/try_trait.rs b/library/core/src/ops/try_trait.rs index d0dd6c8d5c8b7..7fd273f2b1f50 100644 --- a/library/core/src/ops/try_trait.rs +++ b/library/core/src/ops/try_trait.rs @@ -118,12 +118,12 @@ use crate::ops::ControlFlow; on( all(from_desugaring = "TryBlock"), message = "a `try` block must return `Result` or `Option` \ - (or another type that implements `{This}`)", + (or another type that implements `{this}`)", label = "could not wrap the final value of the block as `{Self}` doesn't implement `Try`", ), on( all(from_desugaring = "QuestionMark"), - message = "the `?` operator can only be applied to values that implement `{This}`", + message = "the `?` operator can only be applied to values that implement `{this}`", label = "the `?` operator cannot be applied to type `{Self}`" ) )] @@ -232,7 +232,7 @@ pub const trait Try: [const] FromResidual { R = "core::option::Option", ), message = "the `?` operator can only be used on `Result`s, not `Option`s, \ - in {ItemContext} that returns `Result`", + in {item_context} that returns `Result`", label = "use `.ok_or(...)?` to provide an error compatible with `{Self}`", parent_label = "this function returns a `Result`" ), @@ -245,7 +245,7 @@ pub const trait Try: [const] FromResidual { // `From` in `?`, so this is not shown for result-in-result errors, // and thus it can be phrased more strongly than `ControlFlow`'s. message = "the `?` operator can only be used on `Result`s \ - in {ItemContext} that returns `Result`", + in {item_context} that returns `Result`", label = "this `?` produces `{R}`, which is incompatible with `{Self}`", parent_label = "this function returns a `Result`" ), @@ -256,7 +256,7 @@ pub const trait Try: [const] FromResidual { R = "core::result::Result", ), message = "the `?` operator can only be used on `Option`s, not `Result`s, \ - in {ItemContext} that returns `Option`", + in {item_context} that returns `Option`", label = "use `.ok()?` if you want to discard the `{R}` error information", parent_label = "this function returns an `Option`" ), @@ -268,7 +268,7 @@ pub const trait Try: [const] FromResidual { // `Option`-in-`Option` always works, as there's only one possible // residual, so this can also be phrased strongly. message = "the `?` operator can only be used on `Option`s \ - in {ItemContext} that returns `Option`", + in {item_context} that returns `Option`", label = "this `?` produces `{R}`, which is incompatible with `{Self}`", parent_label = "this function returns an `Option`" ), @@ -278,7 +278,7 @@ pub const trait Try: [const] FromResidual { Self = "core::ops::control_flow::ControlFlow", R = "core::ops::control_flow::ControlFlow", ), - message = "the `?` operator in {ItemContext} that returns `ControlFlow` \ + message = "the `?` operator in {item_context} that returns `ControlFlow` \ can only be used on other `ControlFlow`s (with the same Break type)", label = "this `?` produces `{R}`, which is incompatible with `{Self}`", parent_label = "this function returns a `ControlFlow`", @@ -291,16 +291,16 @@ pub const trait Try: [const] FromResidual { // `R` is not a `ControlFlow`, as that case was matched previously ), message = "the `?` operator can only be used on `ControlFlow`s \ - in {ItemContext} that returns `ControlFlow`", + in {item_context} that returns `ControlFlow`", label = "this `?` produces `{R}`, which is incompatible with `{Self}`", parent_label = "this function returns a `ControlFlow`", ), on( all(from_desugaring = "QuestionMark"), - message = "the `?` operator can only be used in {ItemContext} \ + message = "the `?` operator can only be used in {item_context} \ that returns `Result` or `Option` \ - (or another type that implements `{This}`)", - label = "cannot use the `?` operator in {ItemContext} that returns `{Self}`", + (or another type that implements `{this}`)", + label = "cannot use the `?` operator in {item_context} that returns `{Self}`", parent_label = "this function should return `Result` or `Option` to accept `?`" ), )] diff --git a/library/std/src/process.rs b/library/std/src/process.rs index 20ea03d36eb0e..feed6e1ad55a0 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -2676,7 +2676,7 @@ pub fn id() -> u32 { #[rustc_on_unimplemented(on( cause = "MainFunctionType", message = "`main` has invalid return type `{Self}`", - label = "`main` can only return types that implement `{This}`" + label = "`main` can only return types that implement `{this}`" ))] pub trait Termination { /// Is called to get the representation of the value as status code. diff --git a/src/doc/unstable-book/src/language-features/diagnostic-on-unknown.md b/src/doc/unstable-book/src/language-features/diagnostic-on-unknown.md index dee89a6916353..1e53d8d25ccd2 100644 --- a/src/doc/unstable-book/src/language-features/diagnostic-on-unknown.md +++ b/src/doc/unstable-book/src/language-features/diagnostic-on-unknown.md @@ -12,7 +12,7 @@ annotated declaration is involved in a name resolution error. Format parameters with the given named parameter will be replaced with the following text: - `{Unresolved}` — The `SimplePathSegment` of the import path that could not be resolved. -- `{This}` — The name of the annotated item. On `use` statements this is identical to `{Unresolved}`. +- `{this}` — The name of the annotated item. On `use` statements this is identical to `{unresolved}`. The original error message will not be suppressed but is emitted as a note instead. @@ -46,7 +46,7 @@ For more information about this error, try `rustc --explain E0432`. #![feature(diagnostic_on_unknown)] #[diagnostic::on_unknown( - message = "module `{This}` is empty, there is no `{Unresolved}` here", + message = "module `{this}` is empty, there is no `{unresolved}` here", label = "can't import something from an empty module" )] mod empty {} diff --git a/src/doc/unstable-book/src/language-features/diagnostic-on-unmatched-args.md b/src/doc/unstable-book/src/language-features/diagnostic-on-unmatched-args.md index 830adcf34acdb..7f0156a29584c 100644 --- a/src/doc/unstable-book/src/language-features/diagnostic-on-unmatched-args.md +++ b/src/doc/unstable-book/src/language-features/diagnostic-on-unmatched-args.md @@ -19,7 +19,7 @@ errors still use their existing diagnostics. #![feature(diagnostic_on_unmatched_args)] #[diagnostic::on_unmatched_args( - message = "invalid arguments to {This} macro invocation", + message = "invalid arguments to {this} macro invocation", label = "expected a type and value here", note = "this macro expects a type and a value, like `pair!(u8, 0)`", note = "see ", diff --git a/tests/ui/attributes/doc_examples/rustc_on_unimplemented_format.rs b/tests/ui/attributes/doc_examples/rustc_on_unimplemented_format.rs index f67f54e279efd..10aef8a03e6bb 100644 --- a/tests/ui/attributes/doc_examples/rustc_on_unimplemented_format.rs +++ b/tests/ui/attributes/doc_examples/rustc_on_unimplemented_format.rs @@ -4,8 +4,8 @@ #![feature(rustc_attrs)] #[rustc_on_unimplemented(message = "Self = `{Self}`, \n \ - T = `{T}`, this = `{This}`, path = `{This:path}`, \n \ - resolved = `{This:resolved}`, context = `{ItemContext}`")] + T = `{T}`, this = `{this}`, path = `{this:path}`, \n \ + resolved = `{this:resolved}`, context = `{item_context}`")] pub trait From: Sized { fn from(x: T) -> Self; } diff --git a/tests/ui/diagnostic_namespace/auxiliary/on-type-error.rs b/tests/ui/diagnostic_namespace/auxiliary/on-type-error.rs index f0f83b552b710..7d23fc194ea4a 100644 --- a/tests/ui/diagnostic_namespace/auxiliary/on-type-error.rs +++ b/tests/ui/diagnostic_namespace/auxiliary/on-type-error.rs @@ -1,6 +1,6 @@ #![feature(diagnostic_on_type_error)] #[diagnostic::on_type_error( - note = "[TEST] cross crate expected `{Expected}`, found `{Found}`" + note = "[TEST] cross crate expected `{expected}`, found `{found}`" )] pub struct Foo(pub T); diff --git a/tests/ui/diagnostic_namespace/on_move/on_move_with_format.rs b/tests/ui/diagnostic_namespace/on_move/on_move_with_format.rs index 54035d1d0ea67..4f2f7ba482dfb 100644 --- a/tests/ui/diagnostic_namespace/on_move/on_move_with_format.rs +++ b/tests/ui/diagnostic_namespace/on_move/on_move_with_format.rs @@ -11,7 +11,7 @@ struct Foo; #[diagnostic::on_move( message="Foo for {X}", label="Bar for {X}", - note = "This is `{This}`", + note = "This is `{this}`", )] struct MyType { _x: X, diff --git a/tests/ui/diagnostic_namespace/on_type_error/auxiliary/on-type-error.rs b/tests/ui/diagnostic_namespace/on_type_error/auxiliary/on-type-error.rs index 0197ae6aa1693..636bc1102b4ad 100644 --- a/tests/ui/diagnostic_namespace/on_type_error/auxiliary/on-type-error.rs +++ b/tests/ui/diagnostic_namespace/on_type_error/auxiliary/on-type-error.rs @@ -1,5 +1,5 @@ #![feature(diagnostic_on_type_error)] #[diagnostic::on_type_error( - note = "custom on_type_error note: expected struct `{Expected}`\n found struct `{Found}`" + note = "custom on_type_error note: expected struct `{expected}`\n found struct `{found}`" )] pub struct S(pub T); diff --git a/tests/ui/diagnostic_namespace/on_type_error/on-type-error-const-generic.rs b/tests/ui/diagnostic_namespace/on_type_error/on-type-error-const-generic.rs index d5b0779049d19..24aee1cda563f 100644 --- a/tests/ui/diagnostic_namespace/on_type_error/on-type-error-const-generic.rs +++ b/tests/ui/diagnostic_namespace/on_type_error/on-type-error-const-generic.rs @@ -1,7 +1,7 @@ #![feature(diagnostic_on_type_error)] #[diagnostic::on_type_error( - note = "custom on_type_error note: expected `{Expected}`, found `{Found}`" + note = "custom on_type_error note: expected `{expected}`, found `{found}`" )] struct Array([T; N]); //~^ WARN `#[diagnostic::on_type_error]` only supports exactly one ADT generic parameter, but found `2` [malformed_diagnostic_attributes] diff --git a/tests/ui/diagnostic_namespace/on_type_error/on-type-error-invalid-placeholders.rs b/tests/ui/diagnostic_namespace/on_type_error/on-type-error-invalid-placeholders.rs index 06a8303eb4fc9..52dfc6e52742c 100644 --- a/tests/ui/diagnostic_namespace/on_type_error/on-type-error-invalid-placeholders.rs +++ b/tests/ui/diagnostic_namespace/on_type_error/on-type-error-invalid-placeholders.rs @@ -1,7 +1,7 @@ #![feature(diagnostic_on_move)] -#[diagnostic::on_move(message = "Foo", label = "Bar", note = "{Expected} {Found}")] -//~^ WARN unknown parameter `Expected` [malformed_diagnostic_format_literals] -//~| WARN unknown parameter `Found` [malformed_diagnostic_format_literals] +#[diagnostic::on_move(message = "Foo", label = "Bar", note = "{expected} {found}")] +//~^ WARN unknown parameter `expected` [malformed_diagnostic_format_literals] +//~| WARN unknown parameter `found` [malformed_diagnostic_format_literals] #[derive(Debug)] struct Foo; fn takes_foo(_: Foo) {} diff --git a/tests/ui/diagnostic_namespace/on_type_error/on-type-error-invalid-placeholders.stderr b/tests/ui/diagnostic_namespace/on_type_error/on-type-error-invalid-placeholders.stderr index 802bdd91a0675..6782dfb63ca47 100644 --- a/tests/ui/diagnostic_namespace/on_type_error/on-type-error-invalid-placeholders.stderr +++ b/tests/ui/diagnostic_namespace/on_type_error/on-type-error-invalid-placeholders.stderr @@ -1,16 +1,16 @@ -warning: unknown parameter `Expected` +warning: unknown parameter `expected` --> $DIR/on-type-error-invalid-placeholders.rs:2:64 | -LL | #[diagnostic::on_move(message = "Foo", label = "Bar", note = "{Expected} {Found}")] +LL | #[diagnostic::on_move(message = "Foo", label = "Bar", note = "{expected} {found}")] | ^^^^^^^^ | = help: expect either a generic argument name or `{Self}` as format argument = note: `#[warn(malformed_diagnostic_format_literals)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default -warning: unknown parameter `Found` +warning: unknown parameter `found` --> $DIR/on-type-error-invalid-placeholders.rs:2:75 | -LL | #[diagnostic::on_move(message = "Foo", label = "Bar", note = "{Expected} {Found}")] +LL | #[diagnostic::on_move(message = "Foo", label = "Bar", note = "{expected} {found}")] | ^^^^^ | = help: expect either a generic argument name or `{Self}` as format argument @@ -25,7 +25,7 @@ LL | takes_foo(foo); LL | let bar = foo; | ^^^ value used here after move | - = note: {Expected} {Found} + = note: {expected} {found} note: consider changing this parameter type in function `takes_foo` to borrow instead if owning the value isn't necessary --> $DIR/on-type-error-invalid-placeholders.rs:7:17 | diff --git a/tests/ui/diagnostic_namespace/on_type_error/on-type-error-lifetime-generic.rs b/tests/ui/diagnostic_namespace/on_type_error/on-type-error-lifetime-generic.rs index ee7de39e5d1a5..fcc73bafdd7ea 100644 --- a/tests/ui/diagnostic_namespace/on_type_error/on-type-error-lifetime-generic.rs +++ b/tests/ui/diagnostic_namespace/on_type_error/on-type-error-lifetime-generic.rs @@ -1,6 +1,6 @@ #![feature(diagnostic_on_type_error)] #[diagnostic::on_type_error( - note = "custom on_type_error note: expected `{Expected}`, found `{Found}`" + note = "custom on_type_error note: expected `{expected}`, found `{found}`" )] struct Ref<'a, T>(&'a T); diff --git a/tests/ui/diagnostic_namespace/on_type_error/on_type_error_enum.rs b/tests/ui/diagnostic_namespace/on_type_error/on_type_error_enum.rs index 86a2ceb9c1bd5..edfa86dbae672 100644 --- a/tests/ui/diagnostic_namespace/on_type_error/on_type_error_enum.rs +++ b/tests/ui/diagnostic_namespace/on_type_error/on_type_error_enum.rs @@ -1,7 +1,7 @@ #![feature(diagnostic_on_type_error)] #[diagnostic::on_type_error( - note = "custom on_type_error note: expected enum `{This}<{T}>`, found `{Found}`" + note = "custom on_type_error note: expected enum `{this}<{T}>`, found `{found}`" )] enum MyEnum { Variant(T), diff --git a/tests/ui/diagnostic_namespace/on_type_error/on_type_error_simple.rs b/tests/ui/diagnostic_namespace/on_type_error/on_type_error_simple.rs index 40a6ab82313ff..f66523d813ba7 100644 --- a/tests/ui/diagnostic_namespace/on_type_error/on_type_error_simple.rs +++ b/tests/ui/diagnostic_namespace/on_type_error/on_type_error_simple.rs @@ -1,6 +1,6 @@ #![feature(diagnostic_on_type_error)] #[diagnostic::on_type_error( - note = "custom on_type_error note: expected struct `{Expected}`\n found struct `{Found}`" + note = "custom on_type_error note: expected struct `{expected}`\n found struct `{found}`" )] struct S(T); //~^ NOTE tuple struct defined here diff --git a/tests/ui/diagnostic_namespace/on_type_error/on_type_error_union.rs b/tests/ui/diagnostic_namespace/on_type_error/on_type_error_union.rs index f1a98f163edf1..c4a1874397a5f 100644 --- a/tests/ui/diagnostic_namespace/on_type_error/on_type_error_union.rs +++ b/tests/ui/diagnostic_namespace/on_type_error/on_type_error_union.rs @@ -1,7 +1,7 @@ #![feature(diagnostic_on_type_error)] #[diagnostic::on_type_error( - note = "custom on_type_error note: expected union `{Expected}`, found `{Found}`" + note = "custom on_type_error note: expected union `{expected}`, found `{found}`" )] union MyUnion { value: std::mem::ManuallyDrop, diff --git a/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_invalid_formats.rs b/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_invalid_formats.rs index 0c2389f1793f8..50902ff1fbcd5 100644 --- a/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_invalid_formats.rs +++ b/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_invalid_formats.rs @@ -1,12 +1,12 @@ #![feature(diagnostic_on_type_error)] -#[diagnostic::on_type_error(note = "custom on_type_error note: invalid format {Expected:123}")] +#[diagnostic::on_type_error(note = "custom on_type_error note: invalid format {expected:123}")] //~^ WARN format specifiers are not permitted in diagnostic attributes //~| NOTE `#[warn(malformed_diagnostic_format_literals)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default //~| NOTE remove this format specifier struct InvalidFormat1(T); -#[diagnostic::on_type_error(note = "custom on_type_error note: invalid format {Expected:!}")] +#[diagnostic::on_type_error(note = "custom on_type_error note: invalid format {expected:!}")] //~^ WARN format specifiers are not permitted in diagnostic attributes //~| NOTE remove this format specifier struct InvalidFormat2(T); diff --git a/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_invalid_formats.stderr b/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_invalid_formats.stderr index c4947df2475e6..1a70543b4ffa5 100644 --- a/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_invalid_formats.stderr +++ b/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_invalid_formats.stderr @@ -1,7 +1,7 @@ warning: format specifiers are not permitted in diagnostic attributes --> $DIR/report_warning_on_invalid_formats.rs:3:88 | -LL | #[diagnostic::on_type_error(note = "custom on_type_error note: invalid format {Expected:123}")] +LL | #[diagnostic::on_type_error(note = "custom on_type_error note: invalid format {expected:123}")] | ^^^^ remove this format specifier | = note: `#[warn(malformed_diagnostic_format_literals)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default @@ -9,7 +9,7 @@ LL | #[diagnostic::on_type_error(note = "custom on_type_error note: invalid form warning: format specifiers are not permitted in diagnostic attributes --> $DIR/report_warning_on_invalid_formats.rs:9:88 | -LL | #[diagnostic::on_type_error(note = "custom on_type_error note: invalid format {Expected:!}")] +LL | #[diagnostic::on_type_error(note = "custom on_type_error note: invalid format {expected:!}")] | ^^ remove this format specifier error[E0308]: mismatched types diff --git a/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_non_adt.rs b/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_non_adt.rs index 038862ee820a5..daa80b7ee5366 100644 --- a/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_non_adt.rs +++ b/tests/ui/diagnostic_namespace/on_type_error/report_warning_on_non_adt.rs @@ -31,7 +31,7 @@ impl SomeStruct { fn main() { // Create a type error with a valid ADT to ensure the feature works #[diagnostic::on_type_error( - note = "custom on_type_error note: expected `{Expected}`, found `{Found}`" + note = "custom on_type_error note: expected `{expected}`, found `{found}`" )] struct Valid(T); diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.rs b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.rs index 03eddef2a5400..2c0a2cf21cc97 100644 --- a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.rs +++ b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.rs @@ -35,14 +35,14 @@ impl Bar for i32 {} //~|WARN there is no parameter `r#struct` on trait `Baz` //~|WARN there is no parameter `r#enum` on trait `Baz` //~|WARN there is no parameter `union` on trait `Baz` - label = "{float}{_Self}{crate_local}{This}{ItemContext}{This:path}{This:resolved}" + label = "{float}{_Self}{crate_local}{this}{item_context}{this:path}{this:resolved}" //~^WARN there is no parameter `float` on trait `Baz` //~|WARN there is no parameter `_Self` on trait `Baz` //~|WARN there is no parameter `crate_local` on trait `Baz` - //~|WARN there is no parameter `ItemContext` on trait `Baz` - //~|WARN there is no parameter `This` on trait `Baz` - //~|WARN there is no parameter `This` on trait `Baz` - //~|WARN there is no parameter `This` on trait `Baz` + //~|WARN there is no parameter `item_context` on trait `Baz` + //~|WARN there is no parameter `this` on trait `Baz` + //~|WARN there is no parameter `this` on trait `Baz` + //~|WARN there is no parameter `this` on trait `Baz` //~|WARN format specifiers are not permitted in diagnostic attributes //~|WARN format specifiers are not permitted in diagnostic attributes )] diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.stderr b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.stderr index 566ff1493e769..550132a4d8d71 100644 --- a/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.stderr +++ b/tests/ui/diagnostic_namespace/on_unimplemented/do_not_accept_options_of_the_internal_rustc_attribute.stderr @@ -66,7 +66,7 @@ LL | message = "{from_desugaring}{direct}{cause}{integral}{integer}{struct}{ warning: there is no parameter `float` on trait `Baz` --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:38:15 | -LL | label = "{float}{_Self}{crate_local}{This}{ItemContext}{This:path}{This:resolved}" +LL | label = "{float}{_Self}{crate_local}{this}{item_context}{this:path}{this:resolved}" | ^^^^^ | = help: expect either a generic argument name or `{Self}` as format argument @@ -74,7 +74,7 @@ LL | label = "{float}{_Self}{crate_local}{This}{ItemContext}{This:path}{This warning: there is no parameter `_Self` on trait `Baz` --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:38:22 | -LL | label = "{float}{_Self}{crate_local}{This}{ItemContext}{This:path}{This:resolved}" +LL | label = "{float}{_Self}{crate_local}{this}{item_context}{this:path}{this:resolved}" | ^^^^^ | = help: expect either a generic argument name or `{Self}` as format argument @@ -82,40 +82,40 @@ LL | label = "{float}{_Self}{crate_local}{This}{ItemContext}{This:path}{This warning: there is no parameter `crate_local` on trait `Baz` --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:38:29 | -LL | label = "{float}{_Self}{crate_local}{This}{ItemContext}{This:path}{This:resolved}" +LL | label = "{float}{_Self}{crate_local}{this}{item_context}{this:path}{this:resolved}" | ^^^^^^^^^^^ | = help: expect either a generic argument name or `{Self}` as format argument -warning: there is no parameter `This` on trait `Baz` +warning: there is no parameter `this` on trait `Baz` --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:38:42 | -LL | label = "{float}{_Self}{crate_local}{This}{ItemContext}{This:path}{This:resolved}" +LL | label = "{float}{_Self}{crate_local}{this}{item_context}{this:path}{this:resolved}" | ^^^^ | = help: expect either a generic argument name or `{Self}` as format argument -warning: there is no parameter `ItemContext` on trait `Baz` +warning: there is no parameter `item_context` on trait `Baz` --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:38:48 | -LL | label = "{float}{_Self}{crate_local}{This}{ItemContext}{This:path}{This:resolved}" - | ^^^^^^^^^^^ +LL | label = "{float}{_Self}{crate_local}{this}{item_context}{this:path}{this:resolved}" + | ^^^^^^^^^^^^ | = help: expect either a generic argument name or `{Self}` as format argument -warning: there is no parameter `This` on trait `Baz` - --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:38:61 +warning: there is no parameter `this` on trait `Baz` + --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:38:62 | -LL | label = "{float}{_Self}{crate_local}{This}{ItemContext}{This:path}{This:resolved}" - | ^^^^ +LL | label = "{float}{_Self}{crate_local}{this}{item_context}{this:path}{this:resolved}" + | ^^^^ | = help: expect either a generic argument name or `{Self}` as format argument -warning: there is no parameter `This` on trait `Baz` - --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:38:72 +warning: there is no parameter `this` on trait `Baz` + --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:38:73 | -LL | label = "{float}{_Self}{crate_local}{This}{ItemContext}{This:path}{This:resolved}" - | ^^^^ +LL | label = "{float}{_Self}{crate_local}{this}{item_context}{this:path}{this:resolved}" + | ^^^^ | = help: expect either a generic argument name or `{Self}` as format argument @@ -162,16 +162,16 @@ LL | #[diagnostic::on_unimplemented(message = "Not allowed to apply it on a impl = note: `#[warn(misplaced_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default warning: format specifiers are not permitted in diagnostic attributes - --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:38:65 + --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:38:66 | -LL | label = "{float}{_Self}{crate_local}{This}{ItemContext}{This:path}{This:resolved}" - | ^^^^^ remove this format specifier +LL | label = "{float}{_Self}{crate_local}{this}{item_context}{this:path}{this:resolved}" + | ^^^^^ remove this format specifier warning: format specifiers are not permitted in diagnostic attributes - --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:38:76 + --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:38:77 | -LL | label = "{float}{_Self}{crate_local}{This}{ItemContext}{This:path}{This:resolved}" - | ^^^^^^^^^ remove this format specifier +LL | label = "{float}{_Self}{crate_local}{this}{item_context}{this:path}{this:resolved}" + | ^^^^^^^^^ remove this format specifier error[E0277]: trait has `()` and `i32` as params --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:56:15 @@ -217,7 +217,7 @@ error[E0277]: {from_desugaring}{direct}{cause}{integral}{integer}{struct}{enum}{ --> $DIR/do_not_accept_options_of_the_internal_rustc_attribute.rs:60:15 | LL | takes_baz(()); - | --------- ^^ {float}{_Self}{crate_local}{This}{ItemContext}{This}{This} + | --------- ^^ {float}{_Self}{crate_local}{this}{item_context}{this}{this} | | | required by a bound introduced by this call | diff --git a/tests/ui/diagnostic_namespace/on_unknown/auxiliary/other_crate_level.rs b/tests/ui/diagnostic_namespace/on_unknown/auxiliary/other_crate_level.rs index 0dd96c7d0d289..167b311eaada7 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/auxiliary/other_crate_level.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/auxiliary/other_crate_level.rs @@ -2,4 +2,4 @@ #![feature(diagnostic_on_unknown)] #![crate_type = "lib"] -#![diagnostic::on_unknown(message = "you silly, the crate `{This}` is empty")] +#![diagnostic::on_unknown(message = "you silly, the crate `{this}` is empty")] diff --git a/tests/ui/diagnostic_namespace/on_unknown/crate_level.rs b/tests/ui/diagnostic_namespace/on_unknown/crate_level.rs index 3b0a5ef8e3ab5..0fe4f6ac8377f 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/crate_level.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/crate_level.rs @@ -7,7 +7,7 @@ #![crate_type = "lib"] // Only applies to the root, not everything in the entire crate -#![diagnostic::on_unknown(message = "crate_level `{This}`")] +#![diagnostic::on_unknown(message = "crate_level `{this}`")] mod module{} diff --git a/tests/ui/diagnostic_namespace/on_unknown/incorrect_format_string.rs b/tests/ui/diagnostic_namespace/on_unknown/incorrect_format_string.rs index 82fcf11712db9..d590d9d648833 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/incorrect_format_string.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/incorrect_format_string.rs @@ -25,7 +25,7 @@ use std::does_not_exist4; use std::does_not_exist5; //~^ ERROR: unresolved import `std::does_not_exist5` -#[diagnostic::on_unknown(note = "foo {Self} {ItemContext} {Trait} {A}")] +#[diagnostic::on_unknown(note = "foo {Self} {item_context} {Trait} {A}")] //~^ WARN: this format argument is not allowed in `#[diagnostic::on_unknown]` //~| WARN: this format argument is not allowed in `#[diagnostic::on_unknown]` //~| WARN: this format argument is not allowed in `#[diagnostic::on_unknown]` diff --git a/tests/ui/diagnostic_namespace/on_unknown/incorrect_format_string.stderr b/tests/ui/diagnostic_namespace/on_unknown/incorrect_format_string.stderr index 7bc85c107b9c2..5ff5d616a88a1 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/incorrect_format_string.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/incorrect_format_string.stderr @@ -52,7 +52,7 @@ LL | use std::does_not_exist6; | | | no `does_not_exist6` in the root | - = note: foo {Self} {ItemContext} {Trait} {A} + = note: foo {Self} {item_context} {Trait} {A} warning: positional arguments are not permitted in diagnostic attributes --> $DIR/incorrect_format_string.rs:3:42 @@ -69,7 +69,7 @@ warning: this format argument is not allowed in `#[diagnostic::on_unknown]` LL | #[diagnostic::on_unknown(message = "foo {A}")] | ^ remove this format argument | - = note: only `This` is allowed as a format argument, referring to the failed import + = note: only `this` is allowed as a format argument, referring to the failed import warning: positional arguments are not permitted in diagnostic attributes --> $DIR/incorrect_format_string.rs:13:40 @@ -85,7 +85,7 @@ warning: this format argument is not allowed in `#[diagnostic::on_unknown]` LL | #[diagnostic::on_unknown(label = "foo {A}")] | ^ remove this format argument | - = note: only `This` is allowed as a format argument, referring to the failed import + = note: only `this` is allowed as a format argument, referring to the failed import warning: positional arguments are not permitted in diagnostic attributes --> $DIR/incorrect_format_string.rs:23:39 @@ -98,34 +98,34 @@ LL | #[diagnostic::on_unknown(note = "foo {}")] warning: this format argument is not allowed in `#[diagnostic::on_unknown]` --> $DIR/incorrect_format_string.rs:28:39 | -LL | #[diagnostic::on_unknown(note = "foo {Self} {ItemContext} {Trait} {A}")] +LL | #[diagnostic::on_unknown(note = "foo {Self} {item_context} {Trait} {A}")] | ^^^^ remove this format argument | - = note: only `This` is allowed as a format argument, referring to the failed import + = note: only `this` is allowed as a format argument, referring to the failed import warning: this format argument is not allowed in `#[diagnostic::on_unknown]` --> $DIR/incorrect_format_string.rs:28:46 | -LL | #[diagnostic::on_unknown(note = "foo {Self} {ItemContext} {Trait} {A}")] - | ^^^^^^^^^^^ remove this format argument +LL | #[diagnostic::on_unknown(note = "foo {Self} {item_context} {Trait} {A}")] + | ^^^^^^^^^^^^ remove this format argument | - = note: only `This` is allowed as a format argument, referring to the failed import + = note: only `this` is allowed as a format argument, referring to the failed import warning: this format argument is not allowed in `#[diagnostic::on_unknown]` - --> $DIR/incorrect_format_string.rs:28:60 + --> $DIR/incorrect_format_string.rs:28:61 | -LL | #[diagnostic::on_unknown(note = "foo {Self} {ItemContext} {Trait} {A}")] - | ^^^^^ remove this format argument +LL | #[diagnostic::on_unknown(note = "foo {Self} {item_context} {Trait} {A}")] + | ^^^^^ remove this format argument | - = note: only `This` is allowed as a format argument, referring to the failed import + = note: only `this` is allowed as a format argument, referring to the failed import warning: this format argument is not allowed in `#[diagnostic::on_unknown]` - --> $DIR/incorrect_format_string.rs:28:68 + --> $DIR/incorrect_format_string.rs:28:69 | -LL | #[diagnostic::on_unknown(note = "foo {Self} {ItemContext} {Trait} {A}")] - | ^ remove this format argument +LL | #[diagnostic::on_unknown(note = "foo {Self} {item_context} {Trait} {A}")] + | ^ remove this format argument | - = note: only `This` is allowed as a format argument, referring to the failed import + = note: only `this` is allowed as a format argument, referring to the failed import error: aborting due to 6 previous errors; 9 warnings emitted diff --git a/tests/ui/diagnostic_namespace/on_unknown/late_res.rs b/tests/ui/diagnostic_namespace/on_unknown/late_res.rs index 08527c3a8e06e..74a08cc046ba9 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/late_res.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/late_res.rs @@ -2,7 +2,7 @@ #![feature(diagnostic_on_unknown)] #[diagnostic::on_unknown( - message = "it works `{This}` `{Unresolved}`", + message = "it works `{this}` `{unresolved}`", label = "label it works", note = "note it works" )] diff --git a/tests/ui/diagnostic_namespace/on_unknown/on_module.rs b/tests/ui/diagnostic_namespace/on_unknown/on_module.rs index 50977ff0acf6d..040718df066fb 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/on_module.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/on_module.rs @@ -1,7 +1,7 @@ #![crate_type = "lib"] #![feature(diagnostic_on_unknown)] -#[diagnostic::on_unknown(message = "oh no, `{Unresolved}` is not in module `{This}`")] +#[diagnostic::on_unknown(message = "oh no, `{unresolved}` is not in module `{this}`")] pub mod x { pub struct Foo; } diff --git a/tests/ui/diagnostic_namespace/on_unknown/on_module_inner.rs b/tests/ui/diagnostic_namespace/on_unknown/on_module_inner.rs index 44d5dccf6dad9..4cd8b31999c83 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/on_module_inner.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/on_module_inner.rs @@ -3,7 +3,7 @@ #![feature(custom_inner_attributes)] pub mod x { - #![diagnostic::on_unknown(message = "oh no, `{Unresolved}` is not in module `{This}`")] + #![diagnostic::on_unknown(message = "oh no, `{unresolved}` is not in module `{this}`")] pub struct Foo; } diff --git a/tests/ui/diagnostic_namespace/on_unknown/on_module_no_body.rs b/tests/ui/diagnostic_namespace/on_unknown/on_module_no_body.rs index c37908b2593bf..13ff613afb839 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/on_module_no_body.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/on_module_no_body.rs @@ -1,7 +1,7 @@ #![crate_type = "lib"] #![feature(diagnostic_on_unknown)] -#[diagnostic::on_unknown(message = "oh no, that is not in aux module `{This}`")] +#[diagnostic::on_unknown(message = "oh no, that is not in aux module `{this}`")] #[path = "auxiliary/module.rs"] pub mod x; diff --git a/tests/ui/diagnostic_namespace/on_unknown/this_format_argument.rs b/tests/ui/diagnostic_namespace/on_unknown/this_format_argument.rs index 80ab7b973e8c0..1131ea0bdfc53 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/this_format_argument.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/this_format_argument.rs @@ -3,26 +3,26 @@ pub mod foo {} -#[diagnostic::on_unknown(note = "the name of this item is a single ident: `{This}`")] +#[diagnostic::on_unknown(note = "the name of this item is a single ident: `{this}`")] use foo::Foo; //~^ERROR unresolved import `foo::Foo` //~|NOTE the name of this item is a single ident: `Foo` //~|NOTE no `Foo` in `foo` -#[diagnostic::on_unknown(note = "the name of this item is a single ident: `{This}`")] +#[diagnostic::on_unknown(note = "the name of this item is a single ident: `{this}`")] use foo::foo::Foo; //~^ERROR unresolved import `foo::foo` //~|NOTE the name of this item is a single ident: `foo` //~|NOTE could not find `foo` in `foo` -#[diagnostic::on_unknown(note = "the name of this item is two idents: `{This}`")] +#[diagnostic::on_unknown(note = "the name of this item is two idents: `{this}`")] use foo::{Bar, Foo}; //~^ERROR unresolved imports `foo::Bar`, `foo::Foo` //~|NOTE the name of this item is two idents: `Bar, Foo` //~|NOTE no `Foo` in `foo` //~|NOTE no `Bar` in `foo` -#[diagnostic::on_unknown(note = "the name of this item is many idents: `{This}`")] +#[diagnostic::on_unknown(note = "the name of this item is many idents: `{this}`")] use foo::{ Foo, //~^ERROR unresolved imports `foo::Foo`, `foo::bar` @@ -32,13 +32,13 @@ use foo::{ //~^NOTE could not find `bar` in `foo` }; -#[diagnostic::on_unknown(note = "the name of this is: `{This}`")] +#[diagnostic::on_unknown(note = "the name of this is: `{this}`")] pub use doesnt_exist::*; //~^ERROR unresolved import `doesnt_exist` //~|NOTE use of unresolved module or unlinked crate `doesnt_exist` //~|NOTE the name of this is: `doesnt_exist` -#[diagnostic::on_unknown(note = "the name of this item is a single ident: `{This}`")] +#[diagnostic::on_unknown(note = "the name of this item is a single ident: `{this}`")] use foo::Foo as DoNotUseForThisParam; //~^ERROR unresolved import `foo::Foo` //~|NOTE the name of this item is a single ident: `Foo` diff --git a/tests/ui/diagnostic_namespace/on_unmatched_args/auxiliary/other.rs b/tests/ui/diagnostic_namespace/on_unmatched_args/auxiliary/other.rs index 32cbf69a695ba..c2d76b92971be 100644 --- a/tests/ui/diagnostic_namespace/on_unmatched_args/auxiliary/other.rs +++ b/tests/ui/diagnostic_namespace/on_unmatched_args/auxiliary/other.rs @@ -2,7 +2,7 @@ #[macro_export] #[diagnostic::on_unmatched_args( - message = "invalid arguments to {This} macro invocation", + message = "invalid arguments to {this} macro invocation", label = "expected a type and value here", note = "this macro expects a type and a value, like `pair!(u8, 0)`", note = "see the macro documentation for accepted forms", diff --git a/tests/ui/diagnostic_namespace/on_unmatched_args/message_and_label.rs b/tests/ui/diagnostic_namespace/on_unmatched_args/message_and_label.rs index 4209c939ed52f..4a5336794d781 100644 --- a/tests/ui/diagnostic_namespace/on_unmatched_args/message_and_label.rs +++ b/tests/ui/diagnostic_namespace/on_unmatched_args/message_and_label.rs @@ -1,7 +1,7 @@ #![feature(diagnostic_on_unmatched_args)] #[diagnostic::on_unmatched_args( - message = "invalid arguments to {This} macro invocation", + message = "invalid arguments to {this} macro invocation", label = "expected a type and value here", note = "this macro expects a type and a value, like `pair!(u8, 0)`", note = "see the macro documentation for accepted forms", diff --git a/tests/ui/diagnostic_namespace/on_unmatched_args/notes_on_extra_args.rs b/tests/ui/diagnostic_namespace/on_unmatched_args/notes_on_extra_args.rs index 66e951297a1b6..007ae2f4c7c3d 100644 --- a/tests/ui/diagnostic_namespace/on_unmatched_args/notes_on_extra_args.rs +++ b/tests/ui/diagnostic_namespace/on_unmatched_args/notes_on_extra_args.rs @@ -1,7 +1,7 @@ #![feature(diagnostic_on_unmatched_args)] #[diagnostic::on_unmatched_args( - message = "{This}! expects exactly two arguments", + message = "{this}! expects exactly two arguments", label = "unexpected extra input starts here", note = "this macro expects a type and a value, like `pair!(u8, 0)`", note = "make sure to pass both arguments", diff --git a/tests/ui/diagnostic_namespace/on_unmatched_args/other_match_macro_error.rs b/tests/ui/diagnostic_namespace/on_unmatched_args/other_match_macro_error.rs index ec7ea5888b6c9..f41ca526f4d62 100644 --- a/tests/ui/diagnostic_namespace/on_unmatched_args/other_match_macro_error.rs +++ b/tests/ui/diagnostic_namespace/on_unmatched_args/other_match_macro_error.rs @@ -2,7 +2,7 @@ #[diagnostic::on_unmatched_args( message = "invalid route method", - note = "this macro expects a action, like `{This}!(get \"/hello\")`" + note = "this macro expects a action, like `{this}!(get \"/hello\")`" )] macro_rules! route { (get $path:literal) => {}; diff --git a/tests/ui/diagnostic_namespace/on_unmatched_args/report_warning_on_invalid_formats.rs b/tests/ui/diagnostic_namespace/on_unmatched_args/report_warning_on_invalid_formats.rs index b98d7f777aee8..c4521a29d0c68 100644 --- a/tests/ui/diagnostic_namespace/on_unmatched_args/report_warning_on_invalid_formats.rs +++ b/tests/ui/diagnostic_namespace/on_unmatched_args/report_warning_on_invalid_formats.rs @@ -4,7 +4,7 @@ #[diagnostic::on_unmatched_args( message = "{T}! is missing arguments", //~^ WARN this format argument is not allowed in `#[diagnostic::on_unmatched_args]` - //~| NOTE only `This` is allowed as a format argument + //~| NOTE only `this` is allowed as a format argument //~| NOTE remove this format argument //~| NOTE `#[warn(malformed_diagnostic_format_literals)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default )] diff --git a/tests/ui/diagnostic_namespace/on_unmatched_args/report_warning_on_invalid_formats.stderr b/tests/ui/diagnostic_namespace/on_unmatched_args/report_warning_on_invalid_formats.stderr index e814ecacc006c..51c274b6ffee9 100644 --- a/tests/ui/diagnostic_namespace/on_unmatched_args/report_warning_on_invalid_formats.stderr +++ b/tests/ui/diagnostic_namespace/on_unmatched_args/report_warning_on_invalid_formats.stderr @@ -4,7 +4,7 @@ warning: this format argument is not allowed in `#[diagnostic::on_unmatched_args LL | message = "{T}! is missing arguments", | ^ remove this format argument | - = note: only `This` is allowed as a format argument, referring to the macro's name + = note: only `this` is allowed as a format argument, referring to the macro's name = note: `#[warn(malformed_diagnostic_format_literals)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default warning: 1 warning emitted diff --git a/tests/ui/feature-gates/feature-gate-diagnostic-on-type-error.rs b/tests/ui/feature-gates/feature-gate-diagnostic-on-type-error.rs index 355af18939e83..4786c7d496dc2 100644 --- a/tests/ui/feature-gates/feature-gate-diagnostic-on-type-error.rs +++ b/tests/ui/feature-gates/feature-gate-diagnostic-on-type-error.rs @@ -1,6 +1,6 @@ //! Test that the feature gate is required for diagnostic_on_type_error -#[diagnostic::on_type_error(note = "custom on_type_error note: expected {Expected}, found {Found}")] +#[diagnostic::on_type_error(note = "custom on_type_error note: expected {expected}, found {found}")] //~^ WARN unknown diagnostic attribute //~| NOTE this is an experimental diagnostic attribute //~| NOTE `#[warn(unknown_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default diff --git a/tests/ui/feature-gates/feature-gate-diagnostic-on-type-error.stderr b/tests/ui/feature-gates/feature-gate-diagnostic-on-type-error.stderr index f58f379aa13d0..f6a9fd3b0db40 100644 --- a/tests/ui/feature-gates/feature-gate-diagnostic-on-type-error.stderr +++ b/tests/ui/feature-gates/feature-gate-diagnostic-on-type-error.stderr @@ -1,7 +1,7 @@ warning: unknown diagnostic attribute --> $DIR/feature-gate-diagnostic-on-type-error.rs:3:1 | -LL | #[diagnostic::on_type_error(note = "custom on_type_error note: expected {Expected}, found {Found}")] +LL | #[diagnostic::on_type_error(note = "custom on_type_error note: expected {expected}, found {found}")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this is an experimental diagnostic attribute diff --git a/tests/ui/on-unimplemented/format_specs.rs b/tests/ui/on-unimplemented/format_specs.rs index f92674ab4a888..96fa84dacbffc 100644 --- a/tests/ui/on-unimplemented/format_specs.rs +++ b/tests/ui/on-unimplemented/format_specs.rs @@ -1,7 +1,7 @@ #![feature(rustc_attrs)] #[rustc_on_unimplemented( - message = "normal: {This}, path: {This:path}, resolved: {This:resolved}" + message = "normal: {this}, path: {this:path}, resolved: {this:resolved}" )] pub trait Trait<'lifetime, const CONST_GENERIC: usize, A, B> where A: Send {} diff --git a/tests/ui/on-unimplemented/on-trait.rs b/tests/ui/on-unimplemented/on-trait.rs index b327a4a03917b..984435a947964 100644 --- a/tests/ui/on-unimplemented/on-trait.rs +++ b/tests/ui/on-unimplemented/on-trait.rs @@ -3,7 +3,7 @@ #![feature(rustc_attrs)] pub mod Bar { - #[rustc_on_unimplemented(label ="test error `{Self}` with `{Bar}` `{Baz}` `{Quux}` in `{This}`")] + #[rustc_on_unimplemented(label ="test error `{Self}` with `{Bar}` `{Baz}` `{Quux}` in `{this}`")] pub trait Foo {} }