From 5984023714893618e7ce05f44847f250fe67c5ac Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Fri, 2 Oct 2026 09:16:24 +0200 Subject: [PATCH] Stabilize `#[diagnostic::on_unknown]` This commit just removes the feature gate and moves the attribute to be stable. There haven't been any problems so far, it seems to work and the `#[diagnostic]` namespace guarantees that changes to this can happen at later points as well so there is no risk of stabilizing it. --- .../src/attributes/diagnostic/on_unknown.rs | 4 +- compiler/rustc_feature/src/accepted.rs | 2 + compiler/rustc_feature/src/unstable.rs | 2 - .../rustc_resolve/src/diagnostics/impls.rs | 13 +- compiler/rustc_span/src/lib.rs | 2 +- .../diagnostic-on-unknown.md | 196 ------------------ .../on_unknown/auxiliary/other.rs | 1 - .../on_unknown/auxiliary/other_crate_level.rs | 1 - .../on_unknown/combined_use_and_module.rs | 1 - .../on_unknown/combined_use_and_module.stderr | 2 +- .../on_unknown/crate_level.rs | 1 - .../on_unknown/crate_level.stderr | 10 +- .../on_unknown/incorrect_format_string.rs | 2 - .../on_unknown/incorrect_format_string.stderr | 30 +-- .../on_unknown/incorrect_locations.rs | 1 - .../on_unknown/incorrect_locations.stderr | 22 +- .../incorrect_unstable_positions.rs | 1 - .../incorrect_unstable_positions.stderr | 2 +- .../on_unknown/late_res.rs | 1 - .../on_unknown/late_res.stderr | 12 +- .../on_unknown/malformed_attribute.rs | 1 - .../on_unknown/malformed_attribute.stderr | 10 +- .../on_unknown/multiple.rs | 1 - .../on_unknown/multiple.stderr | 4 +- .../on_unknown/multiple_errors.rs | 2 - .../on_unknown/multiple_errors.stderr | 8 +- .../on_unknown/on_module.rs | 1 - .../on_unknown/on_module.stderr | 2 +- .../on_unknown/on_module_inner.rs | 1 - .../on_unknown/on_module_inner.stderr | 2 +- .../on_unknown/on_module_no_body.rs | 1 - .../on_unknown/on_module_no_body.stderr | 2 +- .../on_unknown/point_at_macro_argument.rs | 1 - .../on_unknown/point_at_macro_argument.stderr | 4 +- .../on_unknown/this_format_argument.rs | 1 - .../on_unknown/this_format_argument.stderr | 12 +- .../on_unknown/unknown_import.rs | 1 - .../on_unknown/unknown_import.stderr | 2 +- .../feature-gate-diagnostic-on-unknown.rs | 8 - .../feature-gate-diagnostic-on-unknown.stderr | 26 --- 40 files changed, 72 insertions(+), 324 deletions(-) delete mode 100644 src/doc/unstable-book/src/language-features/diagnostic-on-unknown.md delete mode 100644 tests/ui/feature-gates/feature-gate-diagnostic-on-unknown.rs delete mode 100644 tests/ui/feature-gates/feature-gate-diagnostic-on-unknown.stderr diff --git a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs index 58e2d37f7cdaf..745d84b4c8c92 100644 --- a/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs +++ b/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_unknown.rs @@ -14,10 +14,8 @@ impl AttributeParser for OnUnknownParser { const ATTRIBUTES: AcceptMapping = &[( &[sym::diagnostic, sym::on_unknown], template!(List: &[r#"/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...""#]), - AttributeStability::Stable, // Unstable, stability checked manually below + AttributeStability::Stable, |this, cx, args| { - gate_diagnostic_attr!(diagnostic_on_unknown); - let span = cx.attr_span; this.span = Some(span); let mode = Mode::DiagnosticOnUnknown; diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 4eb7408244728..72f196ef6451f 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -191,6 +191,8 @@ declare_features! ( (accepted, destructuring_assignment, "1.59.0", Some(71126)), /// Allows using the `#[diagnostic]` attribute tool namespace (accepted, diagnostic_namespace, "1.78.0", Some(111996)), + /// Allows giving unresolved imports a custom diagnostic message + (accepted, diagnostic_on_unknown, "CURRENT_RUSTC_VERSION", Some(152900)), /// Controls errors in trait implementations. (accepted, do_not_recommend, "1.85.0", Some(51992)), /// Allows `#[doc(alias = "...")]`. diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 1af55be52abde..f55c0325a318d 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -497,8 +497,6 @@ declare_features! ( (unstable, diagnostic_on_move, "1.96.0", Some(154181)), /// Allows giving custom types diagnostic messages on type errors (unstable, diagnostic_on_type_error, "1.98.0", Some(155382)), - /// Allows giving unresolved imports a custom diagnostic message - (unstable, diagnostic_on_unknown, "1.96.0", Some(152900)), /// Allows macros to customize macro argument matcher diagnostics. (unstable, diagnostic_on_unmatched_args, "1.97.0", Some(155642)), /// Used by macros to not show their bodies in error messages. No-op with `-Z macro-backtrace`. diff --git a/compiler/rustc_resolve/src/diagnostics/impls.rs b/compiler/rustc_resolve/src/diagnostics/impls.rs index 744e7c22265ea..b47ae36e3f17d 100644 --- a/compiler/rustc_resolve/src/diagnostics/impls.rs +++ b/compiler/rustc_resolve/src/diagnostics/impls.rs @@ -4395,13 +4395,12 @@ impl OnUnknownData { r: &Resolver<'_, '_>, attrs: &[ast::Attribute], ) -> Option { - if r.features.diagnostic_on_unknown() - && let Some(Attribute::Parsed(AttributeKind::OnUnknown { directive, .. })) = - AttributeParser::parse_limited_sym( - r.tcx.sess, - attrs, - &[sym::diagnostic, sym::on_unknown], - ) + if let Some(Attribute::Parsed(AttributeKind::OnUnknown { directive, .. })) = + AttributeParser::parse_limited_sym( + r.tcx.sess, + attrs, + &[sym::diagnostic, sym::on_unknown], + ) { Some(Self { directive: directive? }) } else { diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index ddec29eca6517..59011b3c16faf 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -17,10 +17,10 @@ // tidy-alphabetical-start #![allow(internal_features)] +#![cfg_attr(bootstrap, feature(diagnostic_on_unknown))] #![cfg_attr(target_arch = "loongarch64", feature(stdarch_loongarch))] #![feature(core_io_borrowed_buf)] #![feature(decl_macro)] -#![feature(diagnostic_on_unknown)] #![feature(map_try_insert)] #![feature(negative_impls)] #![feature(read_buf)] 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 deleted file mode 100644 index dee89a6916353..0000000000000 --- a/src/doc/unstable-book/src/language-features/diagnostic-on-unknown.md +++ /dev/null @@ -1,196 +0,0 @@ -# `diagnostic_on_unknown` - -The tracking issue for this feature is: [#152900](https://github.com/rust-lang/rust/issues/152900) - ------------------------- - -The `diagnostic_on_unknown` feature allows use of the `#[diagnostic::on_unknown]` attribute. It should be -placed on use and module declarations as well as the crate root, though it is not an error to be located in other -positions. This attribute is a hint to the compiler to supplement the error message when the -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}`. - -The original error message will not be suppressed but is emitted as a note instead. - -### On use declarations - -```rust,edition2018,compile_fail,E0432 -#![feature(diagnostic_on_unknown)] - -#[diagnostic::on_unknown( - message = "`{Unresolved}` doesn't exist", - label = "you did something silly here" -)] -use doesnt_exist; -``` -This will result in the following error: -```text -error[E0432]: `doesnt_exist` doesn't exist - --> src/lib.rs:7:5 - | -7 | use doesnt_exist; - | ^^^^^^^^^^^^ you did something silly here - | - = note: unresolved import `doesnt_exist` - -For more information about this error, try `rustc --explain E0432`. -``` - -### On module declarations - -```rust,edition2018,compile_fail,E0432 -#![feature(diagnostic_on_unknown)] - -#[diagnostic::on_unknown( - message = "module `{This}` is empty, there is no `{Unresolved}` here", - label = "can't import something from an empty module" -)] -mod empty {} - -use empty::what; -``` -This will result in the following error: - -```text -error[E0432]: module `empty` is empty, there is no `what` here - --> src/lib.rs:9:5 - | -9 | use empty::what; - | ^^^^^^^---- - | | - | can't import something from an empty module - | - = note: unresolved import `empty::what` -``` - -### On the crate root - -This additionally requires the `#![feature(custom_inner_attributes)]` feature: - -```rust,edition2018,compile_fail,E0432 -#![feature(diagnostic_on_unknown)] -#![feature(custom_inner_attributes)] -#![diagnostic::on_unknown(message = "Say `{Unresolved}` again!")] - -use self::what; -``` -### Example - -Consider the following pair of macros, one which creates a hidden module with a constant and another that reads it. - -```rust -#![feature(macro_metavar_expr, macro_attr)] - -macro_rules! instrument { - attr() { $vis:vis fn $fn_name:ident ($($arg_name:ident : $arg_ty:ty),*) $(-> $ret:ty)? $body:block } => { - $vis fn $fn_name ($($arg_name:$arg_ty),*) $(-> $ret)? $body - #[doc(hidden)] - $vis mod $fn_name { - pub const LEN: usize = ${ count($arg_name) }; - } - } -} - -macro_rules! count_args { - ($name:ident) => {{ - $name::LEN - }} -} - -#[instrument] -fn add(a: u8, b: u8) -> u8 { - a + b -} - -fn main() { - let n = count_args!(add); - println!("`add` has {n} arguments"); -} -``` - -If the `#[instrument]` macro is omitted it will emit this confusing error: -```text -error[E0433]: cannot find module or crate `add` in this scope - --> src/main.rs:25:25 - | -25 | let n = count_args!(add); - | ^^^ function `add` is not a crate or module -``` - -`#[diagnostic::on_unknown]` can be used to customize this error message: - -```rust,edition2018,compile_fail,E0432 -#![feature(diagnostic_on_unknown)] -# #![feature(macro_metavar_expr, macro_attr)] -# -# #[allow(unused_macros)] -# macro_rules! instrument { -# attr() { $vis:vis fn $fn_name:ident ($($arg_name:ident : $arg_ty:ty),*) $(-> $ret:ty)? $body:block } => { -# $vis fn $fn_name ($($arg_name:$arg_ty),*) $(-> $ret)? $body -# #[doc(hidden)] -# $vis mod $fn_name { -# pub const LEN: usize = ${ count($arg_name) }; -# } -# } -# } - -macro_rules! count_args { - ($name:ident) => {{ - #[diagnostic::on_unknown( - message = "cannot count arguments of `{Unresolved}`", - label = "`{Unresolved}` is not a function decorated \ - with the `#[instrument]` macro" - )] - use $name::LEN as length; - length - }} -} - -// #[instrument] -fn add(a: u8, b: u8) -> u8 { - a + b -} - -fn main() { - let n = count_args!(add); - println!("`add` has {n} arguments"); -} -``` -This produces: -```text -error[E0432]: cannot count arguments of `add` - --> src/main.rs:33:25 - | -33 | let n = count_args!(add); - | ^^^ `add` is not a function decorated with - | the `#[instrument]` macro - | - = note: unresolved import `add` -``` - -### Edition differences - -In the 2015 edition, use paths are relative to the crate root. For example, `use empty` will be resolved relative to the crate root and resolution will not encounter the `mod empty {}` declaration. -```rust,edition2015,compile_fail,E0432 -#![feature(diagnostic_on_unknown)] - -mod foo { - #[diagnostic::on_unknown(message = "oh oh")] - mod empty {} - - use empty::what; -} -``` - -```text -error[E0432]: unresolved import `empty` - --> src/main.rs:9:8 - | -9 | use empty::what; - | ^^^^^ - | -``` diff --git a/tests/ui/diagnostic_namespace/on_unknown/auxiliary/other.rs b/tests/ui/diagnostic_namespace/on_unknown/auxiliary/other.rs index 616c214f1b03e..e2d7f48405b1f 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/auxiliary/other.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/auxiliary/other.rs @@ -1,5 +1,4 @@ #![crate_type = "lib"] -#![feature(diagnostic_on_unknown)] #[diagnostic::on_unknown(message = "you silly, this module is empty")] pub mod empty {} 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..49b3d96acc961 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 @@ -1,5 +1,4 @@ #![feature(custom_inner_attributes)] -#![feature(diagnostic_on_unknown)] #![crate_type = "lib"] #![diagnostic::on_unknown(message = "you silly, the crate `{This}` is empty")] diff --git a/tests/ui/diagnostic_namespace/on_unknown/combined_use_and_module.rs b/tests/ui/diagnostic_namespace/on_unknown/combined_use_and_module.rs index bb5584a01cac4..a29667bc6e5f9 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/combined_use_and_module.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/combined_use_and_module.rs @@ -1,5 +1,4 @@ #![crate_type = "lib"] -#![feature(diagnostic_on_unknown)] #[diagnostic::on_unknown( message = "THIS MUST NEVER BE SHOWN", diff --git a/tests/ui/diagnostic_namespace/on_unknown/combined_use_and_module.stderr b/tests/ui/diagnostic_namespace/on_unknown/combined_use_and_module.stderr index f123dc2841902..eed936d16dcb9 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/combined_use_and_module.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/combined_use_and_module.stderr @@ -1,5 +1,5 @@ error[E0432]: the message - --> $DIR/combined_use_and_module.rs:22:9 + --> $DIR/combined_use_and_module.rs:21:9 | LL | pub use constants::THREE; | ^^^^^^^^^^^----- diff --git a/tests/ui/diagnostic_namespace/on_unknown/crate_level.rs b/tests/ui/diagnostic_namespace/on_unknown/crate_level.rs index 3b0a5ef8e3ab5..2c6a0f0f1bb77 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/crate_level.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/crate_level.rs @@ -3,7 +3,6 @@ // See https://doc.rust-lang.org/nightly/reference/items/use-declarations.html#r-items.use.path.edition2018 #![feature(custom_inner_attributes)] -#![feature(diagnostic_on_unknown)] #![crate_type = "lib"] // Only applies to the root, not everything in the entire crate diff --git a/tests/ui/diagnostic_namespace/on_unknown/crate_level.stderr b/tests/ui/diagnostic_namespace/on_unknown/crate_level.stderr index c8fd1e93e7e1c..3be53003a2c92 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/crate_level.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/crate_level.stderr @@ -1,5 +1,5 @@ error[E0432]: crate_level `crate_level_test` - --> $DIR/crate_level.rs:14:9 + --> $DIR/crate_level.rs:13:9 | LL | pub use crate::foo; | ^^^^^^^--- @@ -9,7 +9,7 @@ LL | pub use crate::foo; = note: unresolved import `crate::foo` error[E0432]: unresolved import `bar` - --> $DIR/crate_level.rs:17:9 + --> $DIR/crate_level.rs:16:9 | LL | pub use ::bar; | ^^--- @@ -17,13 +17,13 @@ LL | pub use ::bar; | no external crate `bar` error[E0432]: unresolved import `baz` - --> $DIR/crate_level.rs:20:9 + --> $DIR/crate_level.rs:19:9 | LL | pub use baz; | ^^^ no external crate `baz` error[E0432]: unresolved import `crate::module::waz` - --> $DIR/crate_level.rs:23:9 + --> $DIR/crate_level.rs:22:9 | LL | pub use crate::module::waz; | ^^^^^^^^^^^^^^^--- @@ -31,7 +31,7 @@ LL | pub use crate::module::waz; | no `waz` in `module` error[E0432]: unresolved import `module::bluz` - --> $DIR/crate_level.rs:26:9 + --> $DIR/crate_level.rs:25:9 | LL | pub use module::bluz; | ^^^^^^^^---- 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..a0d346600d90e 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/incorrect_format_string.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/incorrect_format_string.rs @@ -1,5 +1,3 @@ -#![feature(diagnostic_on_unknown)] - #[diagnostic::on_unknown(message = "foo {}")] //~^ WARN: positional arguments are not permitted in diagnostic attributes use std::does_not_exist; 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..a1773bf465f64 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/incorrect_format_string.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/incorrect_format_string.stderr @@ -1,5 +1,5 @@ error[E0432]: foo {} - --> $DIR/incorrect_format_string.rs:5:5 + --> $DIR/incorrect_format_string.rs:3:5 | LL | use std::does_not_exist; | ^^^^^-------------- @@ -9,7 +9,7 @@ LL | use std::does_not_exist; = note: unresolved import `std::does_not_exist` error[E0432]: foo {A} - --> $DIR/incorrect_format_string.rs:10:5 + --> $DIR/incorrect_format_string.rs:8:5 | LL | use std::does_not_exist2; | ^^^^^--------------- @@ -19,7 +19,7 @@ LL | use std::does_not_exist2; = note: unresolved import `std::does_not_exist2` error[E0432]: unresolved import `std::does_not_exist3` - --> $DIR/incorrect_format_string.rs:15:5 + --> $DIR/incorrect_format_string.rs:13:5 | LL | use std::does_not_exist3; | ^^^^^--------------- @@ -27,7 +27,7 @@ LL | use std::does_not_exist3; | foo {} error[E0432]: unresolved import `std::does_not_exist4` - --> $DIR/incorrect_format_string.rs:20:5 + --> $DIR/incorrect_format_string.rs:18:5 | LL | use std::does_not_exist4; | ^^^^^--------------- @@ -35,7 +35,7 @@ LL | use std::does_not_exist4; | foo {A} error[E0432]: unresolved import `std::does_not_exist5` - --> $DIR/incorrect_format_string.rs:25:5 + --> $DIR/incorrect_format_string.rs:23:5 | LL | use std::does_not_exist5; | ^^^^^--------------- @@ -45,7 +45,7 @@ LL | use std::does_not_exist5; = note: foo {} error[E0432]: unresolved import `std::does_not_exist6` - --> $DIR/incorrect_format_string.rs:33:5 + --> $DIR/incorrect_format_string.rs:31:5 | LL | use std::does_not_exist6; | ^^^^^--------------- @@ -55,7 +55,7 @@ LL | use std::does_not_exist6; = note: foo {Self} {ItemContext} {Trait} {A} warning: positional arguments are not permitted in diagnostic attributes - --> $DIR/incorrect_format_string.rs:3:42 + --> $DIR/incorrect_format_string.rs:1:42 | LL | #[diagnostic::on_unknown(message = "foo {}")] | ^ remove this format argument @@ -64,7 +64,7 @@ LL | #[diagnostic::on_unknown(message = "foo {}")] = note: `#[warn(malformed_diagnostic_format_literals)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default warning: this format argument is not allowed in `#[diagnostic::on_unknown]` - --> $DIR/incorrect_format_string.rs:8:42 + --> $DIR/incorrect_format_string.rs:6:42 | LL | #[diagnostic::on_unknown(message = "foo {A}")] | ^ remove this format argument @@ -72,7 +72,7 @@ LL | #[diagnostic::on_unknown(message = "foo {A}")] = 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 + --> $DIR/incorrect_format_string.rs:11:40 | LL | #[diagnostic::on_unknown(label = "foo {}")] | ^ remove this format argument @@ -80,7 +80,7 @@ LL | #[diagnostic::on_unknown(label = "foo {}")] = help: you can print empty braces by escaping them warning: this format argument is not allowed in `#[diagnostic::on_unknown]` - --> $DIR/incorrect_format_string.rs:18:40 + --> $DIR/incorrect_format_string.rs:16:40 | LL | #[diagnostic::on_unknown(label = "foo {A}")] | ^ remove this format argument @@ -88,7 +88,7 @@ LL | #[diagnostic::on_unknown(label = "foo {A}")] = 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 + --> $DIR/incorrect_format_string.rs:21:39 | LL | #[diagnostic::on_unknown(note = "foo {}")] | ^ remove this format argument @@ -96,7 +96,7 @@ LL | #[diagnostic::on_unknown(note = "foo {}")] = help: you can print empty braces by escaping them warning: this format argument is not allowed in `#[diagnostic::on_unknown]` - --> $DIR/incorrect_format_string.rs:28:39 + --> $DIR/incorrect_format_string.rs:26:39 | LL | #[diagnostic::on_unknown(note = "foo {Self} {ItemContext} {Trait} {A}")] | ^^^^ remove this format argument @@ -104,7 +104,7 @@ LL | #[diagnostic::on_unknown(note = "foo {Self} {ItemContext} {Trait} {A}")] = 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 + --> $DIR/incorrect_format_string.rs:26:46 | LL | #[diagnostic::on_unknown(note = "foo {Self} {ItemContext} {Trait} {A}")] | ^^^^^^^^^^^ remove this format argument @@ -112,7 +112,7 @@ LL | #[diagnostic::on_unknown(note = "foo {Self} {ItemContext} {Trait} {A}")] = 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:26:60 | LL | #[diagnostic::on_unknown(note = "foo {Self} {ItemContext} {Trait} {A}")] | ^^^^^ remove this format argument @@ -120,7 +120,7 @@ LL | #[diagnostic::on_unknown(note = "foo {Self} {ItemContext} {Trait} {A}")] = 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:26:68 | LL | #[diagnostic::on_unknown(note = "foo {Self} {ItemContext} {Trait} {A}")] | ^ remove this format argument diff --git a/tests/ui/diagnostic_namespace/on_unknown/incorrect_locations.rs b/tests/ui/diagnostic_namespace/on_unknown/incorrect_locations.rs index f82e52f2f6a3e..a9b293ec481ad 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/incorrect_locations.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/incorrect_locations.rs @@ -1,6 +1,5 @@ //@ check-pass #![allow(dead_code, unused_imports)] -#![feature(diagnostic_on_unknown)] #[diagnostic::on_unknown(message = "foo")] //~^WARN cannot be used on diff --git a/tests/ui/diagnostic_namespace/on_unknown/incorrect_locations.stderr b/tests/ui/diagnostic_namespace/on_unknown/incorrect_locations.stderr index 150a5521792f5..6f2610e4c680b 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/incorrect_locations.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/incorrect_locations.stderr @@ -1,5 +1,5 @@ warning: the `diagnostic::on_unknown` attribute cannot be used on extern crates - --> $DIR/incorrect_locations.rs:5:3 + --> $DIR/incorrect_locations.rs:4:3 | LL | #[diagnostic::on_unknown(message = "foo")] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | #[diagnostic::on_unknown(message = "foo")] = note: `#[warn(misplaced_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default warning: the `diagnostic::on_unknown` attribute cannot be used on constants - --> $DIR/incorrect_locations.rs:9:3 + --> $DIR/incorrect_locations.rs:8:3 | LL | #[diagnostic::on_unknown(message = "foo")] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -16,7 +16,7 @@ LL | #[diagnostic::on_unknown(message = "foo")] = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements warning: the `diagnostic::on_unknown` attribute cannot be used on statics - --> $DIR/incorrect_locations.rs:13:3 + --> $DIR/incorrect_locations.rs:12:3 | LL | #[diagnostic::on_unknown(message = "foo")] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -24,7 +24,7 @@ LL | #[diagnostic::on_unknown(message = "foo")] = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements warning: the `diagnostic::on_unknown` attribute cannot be used on type aliases - --> $DIR/incorrect_locations.rs:17:3 + --> $DIR/incorrect_locations.rs:16:3 | LL | #[diagnostic::on_unknown(message = "foo")] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -32,7 +32,7 @@ LL | #[diagnostic::on_unknown(message = "foo")] = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements warning: the `diagnostic::on_unknown` attribute cannot be used on enums - --> $DIR/incorrect_locations.rs:21:3 + --> $DIR/incorrect_locations.rs:20:3 | LL | #[diagnostic::on_unknown(message = "foo")] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -40,7 +40,7 @@ LL | #[diagnostic::on_unknown(message = "foo")] = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements warning: the `diagnostic::on_unknown` attribute cannot be used on inherent impl blocks - --> $DIR/incorrect_locations.rs:25:3 + --> $DIR/incorrect_locations.rs:24:3 | LL | #[diagnostic::on_unknown(message = "foo")] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -48,7 +48,7 @@ LL | #[diagnostic::on_unknown(message = "foo")] = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements warning: the `diagnostic::on_unknown` attribute cannot be used on foreign modules - --> $DIR/incorrect_locations.rs:29:3 + --> $DIR/incorrect_locations.rs:28:3 | LL | #[diagnostic::on_unknown(message = "foo")] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -56,7 +56,7 @@ LL | #[diagnostic::on_unknown(message = "foo")] = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements warning: the `diagnostic::on_unknown` attribute cannot be used on functions - --> $DIR/incorrect_locations.rs:33:3 + --> $DIR/incorrect_locations.rs:32:3 | LL | #[diagnostic::on_unknown(message = "foo")] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -64,7 +64,7 @@ LL | #[diagnostic::on_unknown(message = "foo")] = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements warning: the `diagnostic::on_unknown` attribute cannot be used on structs - --> $DIR/incorrect_locations.rs:37:3 + --> $DIR/incorrect_locations.rs:36:3 | LL | #[diagnostic::on_unknown(message = "foo")] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -72,7 +72,7 @@ LL | #[diagnostic::on_unknown(message = "foo")] = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements warning: the `diagnostic::on_unknown` attribute cannot be used on traits - --> $DIR/incorrect_locations.rs:41:3 + --> $DIR/incorrect_locations.rs:40:3 | LL | #[diagnostic::on_unknown(message = "foo")] | ^^^^^^^^^^^^^^^^^^^^^^ @@ -80,7 +80,7 @@ LL | #[diagnostic::on_unknown(message = "foo")] = help: the `diagnostic::on_unknown` attribute can be applied to crates, modules, and use statements warning: the `diagnostic::on_unknown` attribute cannot be used on trait impl blocks - --> $DIR/incorrect_locations.rs:45:3 + --> $DIR/incorrect_locations.rs:44:3 | LL | #[diagnostic::on_unknown(message = "foo")] | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/diagnostic_namespace/on_unknown/incorrect_unstable_positions.rs b/tests/ui/diagnostic_namespace/on_unknown/incorrect_unstable_positions.rs index 0191c66dd7e80..f04a0f99dae79 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/incorrect_unstable_positions.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/incorrect_unstable_positions.rs @@ -1,7 +1,6 @@ //@ check-pass #![feature(custom_inner_attributes)] -#![feature(diagnostic_on_unknown)] #![feature(stmt_expr_attributes)] fn main() { diff --git a/tests/ui/diagnostic_namespace/on_unknown/incorrect_unstable_positions.stderr b/tests/ui/diagnostic_namespace/on_unknown/incorrect_unstable_positions.stderr index f69a545526ca4..d0ed6775bcf51 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/incorrect_unstable_positions.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/incorrect_unstable_positions.stderr @@ -1,5 +1,5 @@ warning: the `diagnostic::on_unknown` attribute cannot be used on expressions - --> $DIR/incorrect_unstable_positions.rs:8:7 + --> $DIR/incorrect_unstable_positions.rs:7:7 | LL | #[diagnostic::on_unknown(message = "anonymous block")] | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/diagnostic_namespace/on_unknown/late_res.rs b/tests/ui/diagnostic_namespace/on_unknown/late_res.rs index 08527c3a8e06e..00d49d409e71b 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/late_res.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/late_res.rs @@ -1,5 +1,4 @@ #![crate_type = "lib"] -#![feature(diagnostic_on_unknown)] #[diagnostic::on_unknown( message = "it works `{This}` `{Unresolved}`", diff --git a/tests/ui/diagnostic_namespace/on_unknown/late_res.stderr b/tests/ui/diagnostic_namespace/on_unknown/late_res.stderr index 77ac28e1164ee..297ebbe2d7be6 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/late_res.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/late_res.stderr @@ -1,5 +1,5 @@ error[E0531]: it works `empty` `blah` - --> $DIR/late_res.rs:13:16 + --> $DIR/late_res.rs:12:16 | LL | empty::blah => {} | ^^^^ label it works @@ -8,7 +8,7 @@ LL | empty::blah => {} = note: note it works error[E0425]: it works `empty` `blah` - --> $DIR/late_res.rs:21:27 + --> $DIR/late_res.rs:20:27 | LL | println!("{}", empty::blah); | ^^^^ label it works @@ -17,7 +17,7 @@ LL | println!("{}", empty::blah); = note: note it works error[E0425]: it works `empty` `blah` - --> $DIR/late_res.rs:28:16 + --> $DIR/late_res.rs:27:16 | LL | empty::blah, | ^^^^ label it works @@ -26,7 +26,7 @@ LL | empty::blah, = note: note it works error[E0425]: it works `empty` `blah2` - --> $DIR/late_res.rs:33:16 + --> $DIR/late_res.rs:32:16 | LL | empty::blah2, | ^^^^^ label it works @@ -35,7 +35,7 @@ LL | empty::blah2, = note: note it works error[E0425]: message - --> $DIR/late_res.rs:47:19 + --> $DIR/late_res.rs:46:19 | LL | const X: u32 = x::WAHT; | ^^^^ label @@ -43,7 +43,7 @@ LL | const X: u32 = x::WAHT; = note: cannot find value `WAHT` in module `x` = note: note note: similarly named constant `WHAT` defined here - --> $DIR/late_res.rs:43:5 + --> $DIR/late_res.rs:42:5 | LL | const WHAT: u32 = 1; | ^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.rs b/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.rs index ee91eb7c73001..7a72614a7e185 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.rs @@ -1,4 +1,3 @@ -#![feature(diagnostic_on_unknown)] #[diagnostic::on_unknown] //~^WARN missing options for `diagnostic::on_unknown` attribute use std::str::FromStr; diff --git a/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.stderr b/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.stderr index 3aefd4c2960e9..cd769e371731b 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/malformed_attribute.stderr @@ -1,5 +1,5 @@ error[E0432]: Foo - --> $DIR/malformed_attribute.rs:16:5 + --> $DIR/malformed_attribute.rs:15:5 | LL | use std::str::NotExisting; | ^^^^^^^^^^----------- @@ -9,7 +9,7 @@ LL | use std::str::NotExisting; = note: unresolved import `std::str::NotExisting` warning: missing options for `diagnostic::on_unknown` attribute - --> $DIR/malformed_attribute.rs:2:1 + --> $DIR/malformed_attribute.rs:1:1 | LL | #[diagnostic::on_unknown] | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -18,7 +18,7 @@ LL | #[diagnostic::on_unknown] = note: `#[warn(malformed_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default warning: malformed `diagnostic::on_unknown` attribute - --> $DIR/malformed_attribute.rs:6:26 + --> $DIR/malformed_attribute.rs:5:26 | LL | #[diagnostic::on_unknown(foo = "bar", message = "foo")] | ^^^^^^^^^^^ invalid option found here @@ -26,7 +26,7 @@ LL | #[diagnostic::on_unknown(foo = "bar", message = "foo")] = help: only `message`, `note` and `label` are allowed as options warning: `label` is ignored due to previous definition of `label` - --> $DIR/malformed_attribute.rs:10:41 + --> $DIR/malformed_attribute.rs:9:41 | LL | #[diagnostic::on_unknown(label = "foo", label = "bar")] | ------------- ^^^^^^^^^^^^^ `label` is later redundantly declared here @@ -34,7 +34,7 @@ LL | #[diagnostic::on_unknown(label = "foo", label = "bar")] | `label` is first declared here warning: `message` is ignored due to previous definition of `message` - --> $DIR/malformed_attribute.rs:14:43 + --> $DIR/malformed_attribute.rs:13:43 | LL | #[diagnostic::on_unknown(message = "Foo", message = "Bar")] | --------------- ^^^^^^^^^^^^^^^ `message` is later redundantly declared here diff --git a/tests/ui/diagnostic_namespace/on_unknown/multiple.rs b/tests/ui/diagnostic_namespace/on_unknown/multiple.rs index 89e2974768c28..7ff23be95aeb2 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/multiple.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/multiple.rs @@ -1,5 +1,4 @@ #![crate_type = "lib"] -#![feature(diagnostic_on_unknown)] #[diagnostic::on_unknown( message = "NEVER SHOWN", diff --git a/tests/ui/diagnostic_namespace/on_unknown/multiple.stderr b/tests/ui/diagnostic_namespace/on_unknown/multiple.stderr index e9e54a66ed33c..574daf67efaba 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/multiple.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/multiple.stderr @@ -1,5 +1,5 @@ error[E0432]: the same message - --> $DIR/multiple.rs:21:5 + --> $DIR/multiple.rs:20:5 | LL | x::Bar, | ^^^--- @@ -22,7 +22,7 @@ LL | z::Baz, = note: note z error[E0432]: unresolved imports `different::nothing`, `x::Buz` - --> $DIR/multiple.rs:35:5 + --> $DIR/multiple.rs:34:5 | LL | different::nothing, | ^^^^^^^^^^^------- diff --git a/tests/ui/diagnostic_namespace/on_unknown/multiple_errors.rs b/tests/ui/diagnostic_namespace/on_unknown/multiple_errors.rs index 3ccf2fc5f6cab..08a2a6439b5b9 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/multiple_errors.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/multiple_errors.rs @@ -1,5 +1,3 @@ -#![feature(diagnostic_on_unknown)] - mod test1 { #[diagnostic::on_unknown( message = "custom message", diff --git a/tests/ui/diagnostic_namespace/on_unknown/multiple_errors.stderr b/tests/ui/diagnostic_namespace/on_unknown/multiple_errors.stderr index 5456f125b917b..c653b6ce2895c 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/multiple_errors.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/multiple_errors.stderr @@ -1,5 +1,5 @@ error[E0432]: custom message - --> $DIR/multiple_errors.rs:9:20 + --> $DIR/multiple_errors.rs:7:20 | LL | use std::vec::{NonExisting, Vec, Whatever}; | ^^^^^^^^^^^ ^^^^^^^^ custom label @@ -10,7 +10,7 @@ LL | use std::vec::{NonExisting, Vec, Whatever}; = note: custom note error[E0432]: custom message - --> $DIR/multiple_errors.rs:19:15 + --> $DIR/multiple_errors.rs:17:15 | LL | use std::{Whatever, vec::NonExisting, vec::Vec, *}; | ^^^^^^^^ ^^^^^----------- @@ -22,7 +22,7 @@ LL | use std::{Whatever, vec::NonExisting, vec::Vec, *}; = note: custom note error[E0432]: custom message - --> $DIR/multiple_errors.rs:31:15 + --> $DIR/multiple_errors.rs:29:15 | LL | vec::{NonExisting, Vec}, | ^^^^^^^^^^^ custom label @@ -31,7 +31,7 @@ LL | vec::{NonExisting, Vec}, = note: custom note error[E0432]: custom message - --> $DIR/multiple_errors.rs:44:20 + --> $DIR/multiple_errors.rs:42:20 | LL | vec::{Vec, non_existing::*}, | ^^^^^^^^^^^^ custom label diff --git a/tests/ui/diagnostic_namespace/on_unknown/on_module.rs b/tests/ui/diagnostic_namespace/on_unknown/on_module.rs index 50977ff0acf6d..8c541bd9f4d0f 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/on_module.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/on_module.rs @@ -1,5 +1,4 @@ #![crate_type = "lib"] -#![feature(diagnostic_on_unknown)] #[diagnostic::on_unknown(message = "oh no, `{Unresolved}` is not in module `{This}`")] pub mod x { diff --git a/tests/ui/diagnostic_namespace/on_unknown/on_module.stderr b/tests/ui/diagnostic_namespace/on_unknown/on_module.stderr index 37a38f87f4a1c..fb404bc8dc19e 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/on_module.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/on_module.stderr @@ -1,5 +1,5 @@ error[E0432]: oh no, `Bar` is not in module `x` - --> $DIR/on_module.rs:9:9 + --> $DIR/on_module.rs:8:9 | LL | pub use x::Bar; | ^^^--- 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..174182e1b005e 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/on_module_inner.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/on_module_inner.rs @@ -1,5 +1,4 @@ #![crate_type = "lib"] -#![feature(diagnostic_on_unknown)] #![feature(custom_inner_attributes)] pub mod x { diff --git a/tests/ui/diagnostic_namespace/on_unknown/on_module_inner.stderr b/tests/ui/diagnostic_namespace/on_unknown/on_module_inner.stderr index 0d5673b367ae5..c8641bd5a56b3 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/on_module_inner.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/on_module_inner.stderr @@ -1,5 +1,5 @@ error[E0432]: oh no, `Bar` is not in module `x` - --> $DIR/on_module_inner.rs:10:9 + --> $DIR/on_module_inner.rs:9:9 | LL | pub use x::Bar; | ^^^--- 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..3bc33052d56c0 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,5 +1,4 @@ #![crate_type = "lib"] -#![feature(diagnostic_on_unknown)] #[diagnostic::on_unknown(message = "oh no, that is not in aux module `{This}`")] #[path = "auxiliary/module.rs"] diff --git a/tests/ui/diagnostic_namespace/on_unknown/on_module_no_body.stderr b/tests/ui/diagnostic_namespace/on_unknown/on_module_no_body.stderr index 3f729e7f50b69..d1d1e6530686f 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/on_module_no_body.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/on_module_no_body.stderr @@ -1,5 +1,5 @@ error[E0432]: oh no, that is not in aux module `x` - --> $DIR/on_module_no_body.rs:8:9 + --> $DIR/on_module_no_body.rs:7:9 | LL | pub use x::Bar; | ^^^--- diff --git a/tests/ui/diagnostic_namespace/on_unknown/point_at_macro_argument.rs b/tests/ui/diagnostic_namespace/on_unknown/point_at_macro_argument.rs index b7aa11cfa6d67..6fb760b9980e3 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/point_at_macro_argument.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/point_at_macro_argument.rs @@ -1,6 +1,5 @@ //! Test that the `label` span points at the identifier passed to the macro. -#![feature(diagnostic_on_unknown)] #![crate_type = "lib"] mod things {} diff --git a/tests/ui/diagnostic_namespace/on_unknown/point_at_macro_argument.stderr b/tests/ui/diagnostic_namespace/on_unknown/point_at_macro_argument.stderr index 035d140d9ecec..7678415918813 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/point_at_macro_argument.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/point_at_macro_argument.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `things::what` - --> $DIR/point_at_macro_argument.rs:12:17 + --> $DIR/point_at_macro_argument.rs:11:17 | LL | macro_rules! mac { ... @@ -13,7 +13,7 @@ LL | mac!(what); | in this macro invocation error[E0432]: unresolved import `things::what2` - --> $DIR/point_at_macro_argument.rs:12:17 + --> $DIR/point_at_macro_argument.rs:11:17 | LL | macro_rules! mac { ... 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..90f7b20de1246 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/this_format_argument.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/this_format_argument.rs @@ -1,4 +1,3 @@ -#![feature(diagnostic_on_unknown)] #![crate_type = "lib"] pub mod foo {} diff --git a/tests/ui/diagnostic_namespace/on_unknown/this_format_argument.stderr b/tests/ui/diagnostic_namespace/on_unknown/this_format_argument.stderr index 98e1278ff0f5f..413c67a97daf1 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/this_format_argument.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/this_format_argument.stderr @@ -1,5 +1,5 @@ error[E0432]: unresolved import `foo::Foo` - --> $DIR/this_format_argument.rs:7:5 + --> $DIR/this_format_argument.rs:6:5 | LL | use foo::Foo; | ^^^^^--- @@ -9,7 +9,7 @@ LL | use foo::Foo; = note: the name of this item is a single ident: `Foo` error[E0432]: unresolved import `foo::foo` - --> $DIR/this_format_argument.rs:13:10 + --> $DIR/this_format_argument.rs:12:10 | LL | use foo::foo::Foo; | ^^^ could not find `foo` in `foo` @@ -17,7 +17,7 @@ LL | use foo::foo::Foo; = note: the name of this item is a single ident: `foo` error[E0432]: unresolved imports `foo::Bar`, `foo::Foo` - --> $DIR/this_format_argument.rs:19:11 + --> $DIR/this_format_argument.rs:18:11 | LL | use foo::{Bar, Foo}; | ^^^ ^^^ no `Foo` in `foo` @@ -27,7 +27,7 @@ LL | use foo::{Bar, Foo}; = note: the name of this item is two idents: `Bar, Foo` error[E0432]: unresolved imports `foo::Foo`, `foo::bar` - --> $DIR/this_format_argument.rs:27:5 + --> $DIR/this_format_argument.rs:26:5 | LL | Foo, | ^^^ no `Foo` in `foo` @@ -38,7 +38,7 @@ LL | bar::{Baz, Biz}, = note: the name of this item is many idents: `Foo, bar` error[E0432]: unresolved import `doesnt_exist` - --> $DIR/this_format_argument.rs:36:9 + --> $DIR/this_format_argument.rs:35:9 | LL | pub use doesnt_exist::*; | ^^^^^^^^^^^^ use of unresolved module or unlinked crate `doesnt_exist` @@ -50,7 +50,7 @@ LL + extern crate doesnt_exist; | error[E0432]: unresolved import `foo::Foo` - --> $DIR/this_format_argument.rs:42:5 + --> $DIR/this_format_argument.rs:41:5 | LL | use foo::Foo as DoNotUseForThisParam; | ^^^^^---^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/diagnostic_namespace/on_unknown/unknown_import.rs b/tests/ui/diagnostic_namespace/on_unknown/unknown_import.rs index d09a87dcfea1a..ef196b1fadf9f 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/unknown_import.rs +++ b/tests/ui/diagnostic_namespace/on_unknown/unknown_import.rs @@ -1,4 +1,3 @@ -#![feature(diagnostic_on_unknown)] pub mod foo { pub struct Bar; } diff --git a/tests/ui/diagnostic_namespace/on_unknown/unknown_import.stderr b/tests/ui/diagnostic_namespace/on_unknown/unknown_import.stderr index 09609f3207ba7..23785c2989a1a 100644 --- a/tests/ui/diagnostic_namespace/on_unknown/unknown_import.stderr +++ b/tests/ui/diagnostic_namespace/on_unknown/unknown_import.stderr @@ -1,5 +1,5 @@ error[E0432]: first message - --> $DIR/unknown_import.rs:12:5 + --> $DIR/unknown_import.rs:11:5 | LL | use foo::Foo; | ^^^^^--- diff --git a/tests/ui/feature-gates/feature-gate-diagnostic-on-unknown.rs b/tests/ui/feature-gates/feature-gate-diagnostic-on-unknown.rs deleted file mode 100644 index 11cc0d50e0c94..0000000000000 --- a/tests/ui/feature-gates/feature-gate-diagnostic-on-unknown.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![deny(warnings)] - -#[diagnostic::on_unknown(message = "Tada")] -//~^ ERROR: unknown diagnostic attribute -use std::vec::NotExisting; -//~^ ERROR: unresolved import `std::vec::NotExisting` - -fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-diagnostic-on-unknown.stderr b/tests/ui/feature-gates/feature-gate-diagnostic-on-unknown.stderr deleted file mode 100644 index d9a22ccf9eaa6..0000000000000 --- a/tests/ui/feature-gates/feature-gate-diagnostic-on-unknown.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error[E0432]: unresolved import `std::vec::NotExisting` - --> $DIR/feature-gate-diagnostic-on-unknown.rs:5:5 - | -LL | use std::vec::NotExisting; - | ^^^^^^^^^^----------- - | | - | no `NotExisting` in `vec` - -error: unknown diagnostic attribute - --> $DIR/feature-gate-diagnostic-on-unknown.rs:3:1 - | -LL | #[diagnostic::on_unknown(message = "Tada")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: this is an experimental diagnostic attribute - = help: add `#![feature(diagnostic_on_unknown)]` to the crate attributes to enable -note: the lint level is defined here - --> $DIR/feature-gate-diagnostic-on-unknown.rs:1:9 - | -LL | #![deny(warnings)] - | ^^^^^^^^ - = note: `#[deny(unknown_diagnostic_attributes)]` implied by `#[deny(warnings)]` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0432`.