From dd6760a3e5f4491cbf68cdd5c6a7fe0334f44156 Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Sun, 31 May 2026 14:33:01 +0200 Subject: [PATCH] Update uitests --- tests/ui/attributes/malformed-attrs.stderr | 18 +-- tests/ui/attributes/unstable_removed.stderr | 7 +- tests/ui/coroutine/gen_block.e2024.stderr | 22 +-- tests/ui/coroutine/gen_block.none.stderr | 40 +++--- .../feature-gate-rustc_const_unstable.rs | 4 +- .../feature-gate-rustc_const_unstable.stderr | 16 ++- .../feature-gate-staged_api.stderr | 12 +- ...43106-gating-of-builtin-attrs-error.stderr | 16 +-- .../issue-43106-gating-of-stable.rs | 14 ++ .../issue-43106-gating-of-stable.stderr | 134 ++++++++++++++++-- .../issue-43106-gating-of-unstable.rs | 14 ++ .../issue-43106-gating-of-unstable.stderr | 134 ++++++++++++++++-- tests/ui/lang-items/issue-83471.stderr | 38 ++--- .../stability-attribute/issue-106589.stderr | 12 +- ...ity-attribute-non-staged-force-unstable.rs | 10 +- ...attribute-non-staged-force-unstable.stderr | 41 +++++- .../stability-attribute-non-staged.rs | 10 +- .../stability-attribute-non-staged.stderr | 41 +++++- tests/ui/tool-attributes/diagnostic_item.rs | 1 + .../ui/tool-attributes/diagnostic_item.stderr | 1 + .../unstable_feature_bound_staged_api.stderr | 7 +- 21 files changed, 469 insertions(+), 123 deletions(-) diff --git a/tests/ui/attributes/malformed-attrs.stderr b/tests/ui/attributes/malformed-attrs.stderr index 4c9673bf805..cfa8992a559 100644 --- a/tests/ui/attributes/malformed-attrs.stderr +++ b/tests/ui/attributes/malformed-attrs.stderr @@ -126,15 +126,6 @@ error: the `#[proc_macro_derive]` attribute is only usable with crates of the `p LL | #[proc_macro_derive] | ^^^^^^^^^^^^^^^^^^^^ -error[E0658]: allow_internal_unsafe side-steps the unsafe_code lint - --> $DIR/malformed-attrs.rs:215:1 - | -LL | #[allow_internal_unsafe = 1] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: add `#![feature(allow_internal_unsafe)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - error[E0539]: malformed `windows_subsystem` attribute input --> $DIR/malformed-attrs.rs:26:1 | @@ -788,6 +779,15 @@ LL - #[macro_export = 18] LL + #[macro_export] | +error[E0658]: allow_internal_unsafe side-steps the unsafe_code lint + --> $DIR/malformed-attrs.rs:215:1 + | +LL | #[allow_internal_unsafe = 1] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add `#![feature(allow_internal_unsafe)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + error[E0565]: malformed `allow_internal_unsafe` attribute input --> $DIR/malformed-attrs.rs:215:1 | diff --git a/tests/ui/attributes/unstable_removed.stderr b/tests/ui/attributes/unstable_removed.stderr index e9c81b833f4..69a67188f37 100644 --- a/tests/ui/attributes/unstable_removed.stderr +++ b/tests/ui/attributes/unstable_removed.stderr @@ -1,4 +1,4 @@ -error[E0734]: stability attributes may not be used outside of the standard library +error[E0658]: stability attributes may not be used outside of the standard library --> $DIR/unstable_removed.rs:9:1 | LL | / #![unstable_removed( @@ -9,6 +9,9 @@ LL | | link = "https://github.com/rust-lang/rust/issues/141617", LL | | since="1.92.0" LL | | )] | |__^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0557]: feature `old_feature` has been removed --> $DIR/unstable_removed.rs:3:12 @@ -30,5 +33,5 @@ LL | #![feature(concat_idents)] error: aborting due to 3 previous errors -Some errors have detailed explanations: E0557, E0734. +Some errors have detailed explanations: E0557, E0658. For more information about an error, try `rustc --explain E0557`. diff --git a/tests/ui/coroutine/gen_block.e2024.stderr b/tests/ui/coroutine/gen_block.e2024.stderr index 347f111e79f..9590c143aa0 100644 --- a/tests/ui/coroutine/gen_block.e2024.stderr +++ b/tests/ui/coroutine/gen_block.e2024.stderr @@ -1,3 +1,14 @@ +error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks + --> $DIR/gen_block.rs:16:16 + | +LL | let _ = || yield true; + | ^^^^^^^^^^ + | +help: use `#[coroutine]` to make this closure a coroutine + | +LL | let _ = #[coroutine] || yield true; + | ++++++++++++ + error[E0658]: the `#[coroutine]` attribute is an experimental feature --> $DIR/gen_block.rs:20:13 | @@ -18,17 +29,6 @@ LL | let _ = #[coroutine] || {}; = help: add `#![feature(coroutines)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks - --> $DIR/gen_block.rs:16:16 - | -LL | let _ = || yield true; - | ^^^^^^^^^^ - | -help: use `#[coroutine]` to make this closure a coroutine - | -LL | let _ = #[coroutine] || yield true; - | ++++++++++++ - error[E0282]: type annotations needed --> $DIR/gen_block.rs:7:13 | diff --git a/tests/ui/coroutine/gen_block.none.stderr b/tests/ui/coroutine/gen_block.none.stderr index b793033b521..2e8962ec066 100644 --- a/tests/ui/coroutine/gen_block.none.stderr +++ b/tests/ui/coroutine/gen_block.none.stderr @@ -44,26 +44,6 @@ LL | let _ = #[coroutine] || yield true; = help: add `#![feature(yield_expr)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[coroutine]` attribute is an experimental feature - --> $DIR/gen_block.rs:20:13 - | -LL | let _ = #[coroutine] || yield true; - | ^^^^^^^^^^^^ - | - = note: see issue #43122 for more information - = help: add `#![feature(coroutines)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the `#[coroutine]` attribute is an experimental feature - --> $DIR/gen_block.rs:24:13 - | -LL | let _ = #[coroutine] || {}; - | ^^^^^^^^^^^^ - | - = note: see issue #43122 for more information - = help: add `#![feature(coroutines)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - error[E0658]: yield syntax is experimental --> $DIR/gen_block.rs:16:16 | @@ -85,6 +65,16 @@ help: use `#[coroutine]` to make this closure a coroutine LL | let _ = #[coroutine] || yield true; | ++++++++++++ +error[E0658]: the `#[coroutine]` attribute is an experimental feature + --> $DIR/gen_block.rs:20:13 + | +LL | let _ = #[coroutine] || yield true; + | ^^^^^^^^^^^^ + | + = note: see issue #43122 for more information + = help: add `#![feature(coroutines)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + error[E0658]: yield syntax is experimental --> $DIR/gen_block.rs:20:29 | @@ -95,6 +85,16 @@ LL | let _ = #[coroutine] || yield true; = help: add `#![feature(yield_expr)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +error[E0658]: the `#[coroutine]` attribute is an experimental feature + --> $DIR/gen_block.rs:24:13 + | +LL | let _ = #[coroutine] || {}; + | ^^^^^^^^^^^^ + | + = note: see issue #43122 for more information + = help: add `#![feature(coroutines)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + error: aborting due to 11 previous errors Some errors have detailed explanations: E0422, E0658. diff --git a/tests/ui/feature-gates/feature-gate-rustc_const_unstable.rs b/tests/ui/feature-gates/feature-gate-rustc_const_unstable.rs index 522db1643fd..9618e57683e 100644 --- a/tests/ui/feature-gates/feature-gate-rustc_const_unstable.rs +++ b/tests/ui/feature-gates/feature-gate-rustc_const_unstable.rs @@ -1,6 +1,8 @@ // Test internal const fn feature gate. -#[rustc_const_unstable(feature="fzzzzzt")] //~ ERROR stability attributes may not be used outside +#[rustc_const_unstable(feature="fzzzzzt")] +//~^ ERROR stability attributes may not be used outside +//~| ERROR missing 'issue' pub const fn bazinga() {} fn main() { diff --git a/tests/ui/feature-gates/feature-gate-rustc_const_unstable.stderr b/tests/ui/feature-gates/feature-gate-rustc_const_unstable.stderr index 869764fa456..2c3763af9db 100644 --- a/tests/ui/feature-gates/feature-gate-rustc_const_unstable.stderr +++ b/tests/ui/feature-gates/feature-gate-rustc_const_unstable.stderr @@ -1,9 +1,19 @@ -error[E0734]: stability attributes may not be used outside of the standard library +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/feature-gate-rustc_const_unstable.rs:3:1 + | +LL | #[rustc_const_unstable(feature="fzzzzzt")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0547]: missing 'issue' --> $DIR/feature-gate-rustc_const_unstable.rs:3:1 | LL | #[rustc_const_unstable(feature="fzzzzzt")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 1 previous error +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0734`. +Some errors have detailed explanations: E0547, E0658. +For more information about an error, try `rustc --explain E0547`. diff --git a/tests/ui/feature-gates/feature-gate-staged_api.stderr b/tests/ui/feature-gates/feature-gate-staged_api.stderr index 86ba509ae7d..6e717db165c 100644 --- a/tests/ui/feature-gates/feature-gate-staged_api.stderr +++ b/tests/ui/feature-gates/feature-gate-staged_api.stderr @@ -1,15 +1,21 @@ -error[E0734]: stability attributes may not be used outside of the standard library +error[E0658]: stability attributes may not be used outside of the standard library --> $DIR/feature-gate-staged_api.rs:1:1 | LL | #![stable(feature = "a", since = "3.3.3")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0734]: stability attributes may not be used outside of the standard library +error[E0658]: stability attributes may not be used outside of the standard library --> $DIR/feature-gate-staged_api.rs:8:1 | LL | #[stable(feature = "a", since = "3.3.3")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0734`. +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr index db56f22acfb..e0313bd7b80 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr @@ -1,3 +1,11 @@ +error: `#[macro_export]` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:9:1 + | +LL | #![macro_export] + | ^^^^^^^^^^^^^^^^ + | + = help: `#[macro_export]` can only be applied to macro defs + error[E0658]: use of an internal attribute --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:11:1 | @@ -8,14 +16,6 @@ LL | #![rustc_main] = note: the `#[rustc_main]` attribute is an internal implementation detail that will never be stable = note: the `#[rustc_main]` attribute is used internally to specify test entry point function -error: `#[macro_export]` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:9:1 - | -LL | #![macro_export] - | ^^^^^^^^^^^^^^^^ - | - = help: `#[macro_export]` can only be applied to macro defs - error: `#[rustc_main]` attribute cannot be used on crates --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:11:1 | diff --git a/tests/ui/feature-gates/issue-43106-gating-of-stable.rs b/tests/ui/feature-gates/issue-43106-gating-of-stable.rs index 621ec01bbe2..ee8b7f09d28 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-stable.rs +++ b/tests/ui/feature-gates/issue-43106-gating-of-stable.rs @@ -6,29 +6,43 @@ #![stable()] //~^ ERROR stability attributes may not be used outside of the standard library +//~| ERROR missing 'since' +//~| ERROR missing 'feature' #[stable()] //~^ ERROR stability attributes may not be used outside of the standard library +//~| ERROR missing 'since' +//~| ERROR missing 'feature' mod stable { mod inner { #![stable()] //~^ ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'since' + //~| ERROR missing 'feature' } #[stable()] //~^ ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'since' + //~| ERROR missing 'feature' fn f() {} #[stable()] //~^ ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'since' + //~| ERROR missing 'feature' struct S; #[stable()] //~^ ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'since' + //~| ERROR missing 'feature' type T = S; #[stable()] //~^ ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'since' + //~| ERROR missing 'feature' impl S {} } diff --git a/tests/ui/feature-gates/issue-43106-gating-of-stable.stderr b/tests/ui/feature-gates/issue-43106-gating-of-stable.stderr index bac3b018e2e..6f9b6ab18c9 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-stable.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-stable.stderr @@ -1,45 +1,151 @@ -error[E0734]: stability attributes may not be used outside of the standard library +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/issue-43106-gating-of-stable.rs:7:1 + | +LL | #![stable()] + | ^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-stable.rs:7:1 | LL | #![stable()] | ^^^^^^^^^^^^ -error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:10:1 +error[E0542]: missing 'since' + --> $DIR/issue-43106-gating-of-stable.rs:7:1 + | +LL | #![stable()] + | ^^^^^^^^^^^^ + +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/issue-43106-gating-of-stable.rs:12:1 + | +LL | #[stable()] + | ^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' + --> $DIR/issue-43106-gating-of-stable.rs:12:1 | LL | #[stable()] | ^^^^^^^^^^^ -error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:14:9 +error[E0542]: missing 'since' + --> $DIR/issue-43106-gating-of-stable.rs:12:1 + | +LL | #[stable()] + | ^^^^^^^^^^^ + +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/issue-43106-gating-of-stable.rs:18:9 + | +LL | #![stable()] + | ^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' + --> $DIR/issue-43106-gating-of-stable.rs:18:9 | LL | #![stable()] | ^^^^^^^^^^^^ -error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:18:5 +error[E0542]: missing 'since' + --> $DIR/issue-43106-gating-of-stable.rs:18:9 + | +LL | #![stable()] + | ^^^^^^^^^^^^ + +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/issue-43106-gating-of-stable.rs:24:5 + | +LL | #[stable()] + | ^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' + --> $DIR/issue-43106-gating-of-stable.rs:24:5 | LL | #[stable()] | ^^^^^^^^^^^ -error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:22:5 +error[E0542]: missing 'since' + --> $DIR/issue-43106-gating-of-stable.rs:24:5 | LL | #[stable()] | ^^^^^^^^^^^ -error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:26:5 +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/issue-43106-gating-of-stable.rs:30:5 | LL | #[stable()] | ^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0734]: stability attributes may not be used outside of the standard library +error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-stable.rs:30:5 | LL | #[stable()] | ^^^^^^^^^^^ -error: aborting due to 7 previous errors +error[E0542]: missing 'since' + --> $DIR/issue-43106-gating-of-stable.rs:30:5 + | +LL | #[stable()] + | ^^^^^^^^^^^ -For more information about this error, try `rustc --explain E0734`. +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/issue-43106-gating-of-stable.rs:36:5 + | +LL | #[stable()] + | ^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' + --> $DIR/issue-43106-gating-of-stable.rs:36:5 + | +LL | #[stable()] + | ^^^^^^^^^^^ + +error[E0542]: missing 'since' + --> $DIR/issue-43106-gating-of-stable.rs:36:5 + | +LL | #[stable()] + | ^^^^^^^^^^^ + +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/issue-43106-gating-of-stable.rs:42:5 + | +LL | #[stable()] + | ^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' + --> $DIR/issue-43106-gating-of-stable.rs:42:5 + | +LL | #[stable()] + | ^^^^^^^^^^^ + +error[E0542]: missing 'since' + --> $DIR/issue-43106-gating-of-stable.rs:42:5 + | +LL | #[stable()] + | ^^^^^^^^^^^ + +error: aborting due to 21 previous errors + +Some errors have detailed explanations: E0542, E0546, E0658. +For more information about an error, try `rustc --explain E0542`. diff --git a/tests/ui/feature-gates/issue-43106-gating-of-unstable.rs b/tests/ui/feature-gates/issue-43106-gating-of-unstable.rs index d507bcd8f15..eb19ebb2cc7 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-unstable.rs +++ b/tests/ui/feature-gates/issue-43106-gating-of-unstable.rs @@ -6,29 +6,43 @@ #![unstable()] //~^ ERROR stability attributes may not be used outside of the standard library +//~| ERROR missing 'issue' +//~| ERROR missing 'feature' #[unstable()] //~^ ERROR stability attributes may not be used outside of the standard library +//~| ERROR missing 'issue' +//~| ERROR missing 'feature' mod unstable { mod inner { #![unstable()] //~^ ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'issue' + //~| ERROR missing 'feature' } #[unstable()] //~^ ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'issue' + //~| ERROR missing 'feature' fn f() {} #[unstable()] //~^ ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'issue' + //~| ERROR missing 'feature' struct S; #[unstable()] //~^ ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'issue' + //~| ERROR missing 'feature' type T = S; #[unstable()] //~^ ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'issue' + //~| ERROR missing 'feature' impl S {} } diff --git a/tests/ui/feature-gates/issue-43106-gating-of-unstable.stderr b/tests/ui/feature-gates/issue-43106-gating-of-unstable.stderr index 9ea60f83800..f024f1e3001 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-unstable.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-unstable.stderr @@ -1,45 +1,151 @@ -error[E0734]: stability attributes may not be used outside of the standard library +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/issue-43106-gating-of-unstable.rs:7:1 + | +LL | #![unstable()] + | ^^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-unstable.rs:7:1 | LL | #![unstable()] | ^^^^^^^^^^^^^^ -error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:10:1 +error[E0547]: missing 'issue' + --> $DIR/issue-43106-gating-of-unstable.rs:7:1 + | +LL | #![unstable()] + | ^^^^^^^^^^^^^^ + +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/issue-43106-gating-of-unstable.rs:12:1 + | +LL | #[unstable()] + | ^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' + --> $DIR/issue-43106-gating-of-unstable.rs:12:1 | LL | #[unstable()] | ^^^^^^^^^^^^^ -error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:14:9 +error[E0547]: missing 'issue' + --> $DIR/issue-43106-gating-of-unstable.rs:12:1 + | +LL | #[unstable()] + | ^^^^^^^^^^^^^ + +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/issue-43106-gating-of-unstable.rs:18:9 + | +LL | #![unstable()] + | ^^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' + --> $DIR/issue-43106-gating-of-unstable.rs:18:9 | LL | #![unstable()] | ^^^^^^^^^^^^^^ -error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:18:5 +error[E0547]: missing 'issue' + --> $DIR/issue-43106-gating-of-unstable.rs:18:9 + | +LL | #![unstable()] + | ^^^^^^^^^^^^^^ + +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/issue-43106-gating-of-unstable.rs:24:5 + | +LL | #[unstable()] + | ^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' + --> $DIR/issue-43106-gating-of-unstable.rs:24:5 | LL | #[unstable()] | ^^^^^^^^^^^^^ -error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:22:5 +error[E0547]: missing 'issue' + --> $DIR/issue-43106-gating-of-unstable.rs:24:5 | LL | #[unstable()] | ^^^^^^^^^^^^^ -error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:26:5 +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/issue-43106-gating-of-unstable.rs:30:5 | LL | #[unstable()] | ^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0734]: stability attributes may not be used outside of the standard library +error[E0546]: missing 'feature' --> $DIR/issue-43106-gating-of-unstable.rs:30:5 | LL | #[unstable()] | ^^^^^^^^^^^^^ -error: aborting due to 7 previous errors +error[E0547]: missing 'issue' + --> $DIR/issue-43106-gating-of-unstable.rs:30:5 + | +LL | #[unstable()] + | ^^^^^^^^^^^^^ -For more information about this error, try `rustc --explain E0734`. +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/issue-43106-gating-of-unstable.rs:36:5 + | +LL | #[unstable()] + | ^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' + --> $DIR/issue-43106-gating-of-unstable.rs:36:5 + | +LL | #[unstable()] + | ^^^^^^^^^^^^^ + +error[E0547]: missing 'issue' + --> $DIR/issue-43106-gating-of-unstable.rs:36:5 + | +LL | #[unstable()] + | ^^^^^^^^^^^^^ + +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/issue-43106-gating-of-unstable.rs:42:5 + | +LL | #[unstable()] + | ^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' + --> $DIR/issue-43106-gating-of-unstable.rs:42:5 + | +LL | #[unstable()] + | ^^^^^^^^^^^^^ + +error[E0547]: missing 'issue' + --> $DIR/issue-43106-gating-of-unstable.rs:42:5 + | +LL | #[unstable()] + | ^^^^^^^^^^^^^ + +error: aborting due to 21 previous errors + +Some errors have detailed explanations: E0546, E0547, E0658. +For more information about an error, try `rustc --explain E0546`. diff --git a/tests/ui/lang-items/issue-83471.stderr b/tests/ui/lang-items/issue-83471.stderr index 1d5b1c4cd3e..b54080148e3 100644 --- a/tests/ui/lang-items/issue-83471.stderr +++ b/tests/ui/lang-items/issue-83471.stderr @@ -4,6 +4,25 @@ error[E0573]: expected type, found built-in attribute `export_name` LL | fn call(export_name); | ^^^^^^^^^^^ not a type +warning: anonymous parameters are deprecated and will be removed in the next edition + --> $DIR/issue-83471.rs:24:13 + | +LL | fn call(export_name); + | ^^^^^^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: export_name` + | + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! + = note: for more information, see + = note: `#[warn(anonymous_parameters)]` (part of `#[warn(rust_2018_compatibility)]`) on by default + +error[E0718]: `fn` lang item must be applied to a trait with 1 generic argument + --> $DIR/issue-83471.rs:20:1 + | +LL | #[lang = "fn"] + | ^^^^^^^^^^^^^^ +... +LL | trait Fn { + | - this trait has 0 generic arguments + error[E0658]: lang items are subject to change --> $DIR/issue-83471.rs:8:1 | @@ -40,25 +59,6 @@ LL | #[lang = "fn"] = help: add `#![feature(lang_items)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -warning: anonymous parameters are deprecated and will be removed in the next edition - --> $DIR/issue-83471.rs:24:13 - | -LL | fn call(export_name); - | ^^^^^^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: export_name` - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018! - = note: for more information, see - = note: `#[warn(anonymous_parameters)]` (part of `#[warn(rust_2018_compatibility)]`) on by default - -error[E0718]: `fn` lang item must be applied to a trait with 1 generic argument - --> $DIR/issue-83471.rs:20:1 - | -LL | #[lang = "fn"] - | ^^^^^^^^^^^^^^ -... -LL | trait Fn { - | - this trait has 0 generic arguments - error[E0425]: cannot find function `a` in this scope --> $DIR/issue-83471.rs:30:5 | diff --git a/tests/ui/stability-attribute/issue-106589.stderr b/tests/ui/stability-attribute/issue-106589.stderr index c14ad2da04b..40b0dcec651 100644 --- a/tests/ui/stability-attribute/issue-106589.stderr +++ b/tests/ui/stability-attribute/issue-106589.stderr @@ -1,15 +1,21 @@ -error[E0734]: stability attributes may not be used outside of the standard library +error[E0658]: stability attributes may not be used outside of the standard library --> $DIR/issue-106589.rs:3:1 | LL | #![stable(feature = "foo", since = "1.0.0")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0734]: stability attributes may not be used outside of the standard library +error[E0658]: stability attributes may not be used outside of the standard library --> $DIR/issue-106589.rs:6:1 | LL | #[unstable(feature = "foo", issue = "none")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0734`. +For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs b/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs index e7d3b67506a..ebd70e0a124 100644 --- a/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs +++ b/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs @@ -1,5 +1,11 @@ //@ compile-flags:-Zforce-unstable-if-unmarked -#[unstable()] //~ ERROR: stability attributes may not be used -#[stable()] //~ ERROR: stability attributes may not be used +#[unstable()] +//~^ ERROR stability attributes may not be used +//~| ERROR missing 'feature' +//~| ERROR missing 'issue' +#[stable()] +//~^ ERROR stability attributes may not be used +//~| ERROR missing 'feature' +//~| ERROR missing 'since' fn main() {} diff --git a/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr b/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr index 45d965ea0a0..eac32a6cec2 100644 --- a/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr +++ b/tests/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr @@ -1,15 +1,46 @@ -error[E0734]: stability attributes may not be used outside of the standard library +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/stability-attribute-non-staged-force-unstable.rs:3:1 + | +LL | #[unstable()] + | ^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' --> $DIR/stability-attribute-non-staged-force-unstable.rs:3:1 | LL | #[unstable()] | ^^^^^^^^^^^^^ -error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/stability-attribute-non-staged-force-unstable.rs:4:1 +error[E0547]: missing 'issue' + --> $DIR/stability-attribute-non-staged-force-unstable.rs:3:1 + | +LL | #[unstable()] + | ^^^^^^^^^^^^^ + +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/stability-attribute-non-staged-force-unstable.rs:7:1 + | +LL | #[stable()] + | ^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' + --> $DIR/stability-attribute-non-staged-force-unstable.rs:7:1 | LL | #[stable()] | ^^^^^^^^^^^ -error: aborting due to 2 previous errors +error[E0542]: missing 'since' + --> $DIR/stability-attribute-non-staged-force-unstable.rs:7:1 + | +LL | #[stable()] + | ^^^^^^^^^^^ -For more information about this error, try `rustc --explain E0734`. +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0542, E0546, E0547, E0658. +For more information about an error, try `rustc --explain E0542`. diff --git a/tests/ui/stability-attribute/stability-attribute-non-staged.rs b/tests/ui/stability-attribute/stability-attribute-non-staged.rs index 4015f2f971e..0e16db32ce9 100644 --- a/tests/ui/stability-attribute/stability-attribute-non-staged.rs +++ b/tests/ui/stability-attribute/stability-attribute-non-staged.rs @@ -1,3 +1,9 @@ -#[unstable()] //~ ERROR: stability attributes may not be used -#[stable()] //~ ERROR: stability attributes may not be used +#[unstable()] +//~^ ERROR: stability attributes may not be used +//~| ERROR missing 'feature' +//~| ERROR missing 'issue' +#[stable()] +//~^ ERROR: stability attributes may not be used +//~| ERROR missing 'feature' +//~| ERROR missing 'since' fn main() {} diff --git a/tests/ui/stability-attribute/stability-attribute-non-staged.stderr b/tests/ui/stability-attribute/stability-attribute-non-staged.stderr index 391f3c2744d..2443e0300a3 100644 --- a/tests/ui/stability-attribute/stability-attribute-non-staged.stderr +++ b/tests/ui/stability-attribute/stability-attribute-non-staged.stderr @@ -1,15 +1,46 @@ -error[E0734]: stability attributes may not be used outside of the standard library +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/stability-attribute-non-staged.rs:1:1 + | +LL | #[unstable()] + | ^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' --> $DIR/stability-attribute-non-staged.rs:1:1 | LL | #[unstable()] | ^^^^^^^^^^^^^ -error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/stability-attribute-non-staged.rs:2:1 +error[E0547]: missing 'issue' + --> $DIR/stability-attribute-non-staged.rs:1:1 + | +LL | #[unstable()] + | ^^^^^^^^^^^^^ + +error[E0658]: stability attributes may not be used outside of the standard library + --> $DIR/stability-attribute-non-staged.rs:5:1 + | +LL | #[stable()] + | ^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0546]: missing 'feature' + --> $DIR/stability-attribute-non-staged.rs:5:1 | LL | #[stable()] | ^^^^^^^^^^^ -error: aborting due to 2 previous errors +error[E0542]: missing 'since' + --> $DIR/stability-attribute-non-staged.rs:5:1 + | +LL | #[stable()] + | ^^^^^^^^^^^ -For more information about this error, try `rustc --explain E0734`. +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0542, E0546, E0547, E0658. +For more information about an error, try `rustc --explain E0542`. diff --git a/tests/ui/tool-attributes/diagnostic_item.rs b/tests/ui/tool-attributes/diagnostic_item.rs index 806b140feba..60817ae3180 100644 --- a/tests/ui/tool-attributes/diagnostic_item.rs +++ b/tests/ui/tool-attributes/diagnostic_item.rs @@ -1,5 +1,6 @@ #[rustc_diagnostic_item = "foomp"] //~^ ERROR use of an internal attribute [E0658] +//~| NOTE the `#[rustc_diagnostic_item]` attribute is an internal implementation detail that will never be stable //~| NOTE the `#[rustc_diagnostic_item]` attribute allows the compiler to reference types from the standard library for diagnostic purposes struct Foomp; fn main() {} diff --git a/tests/ui/tool-attributes/diagnostic_item.stderr b/tests/ui/tool-attributes/diagnostic_item.stderr index d37044281a1..35e00fd726c 100644 --- a/tests/ui/tool-attributes/diagnostic_item.stderr +++ b/tests/ui/tool-attributes/diagnostic_item.stderr @@ -5,6 +5,7 @@ LL | #[rustc_diagnostic_item = "foomp"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable + = note: the `#[rustc_diagnostic_item]` attribute is an internal implementation detail that will never be stable = note: the `#[rustc_diagnostic_item]` attribute allows the compiler to reference types from the standard library for diagnostic purposes error: aborting due to 1 previous error diff --git a/tests/ui/unstable-feature-bound/unstable_feature_bound_staged_api.stderr b/tests/ui/unstable-feature-bound/unstable_feature_bound_staged_api.stderr index 35ab89e6ad9..4f6ff5117a0 100644 --- a/tests/ui/unstable-feature-bound/unstable_feature_bound_staged_api.stderr +++ b/tests/ui/unstable-feature-bound/unstable_feature_bound_staged_api.stderr @@ -1,9 +1,12 @@ -error[E0734]: stability attributes may not be used outside of the standard library +error[E0658]: stability attributes may not be used outside of the standard library --> $DIR/unstable_feature_bound_staged_api.rs:8:1 | LL | #[unstable_feature_bound(feat_bar)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add `#![feature(staged_api)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0734`. +For more information about this error, try `rustc --explain E0658`.