diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-01-18 20:37:14 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-03-03 18:50:26 +0100 |
| commit | 3c7947ee43b14f124b41f5de7c247dc8e47a18fa (patch) | |
| tree | 8a525aa066f1fee7113e6f111b0da55f9414e36e /src | |
| parent | 969f8735dc97a142c70768fde65937dafa6f4c0e (diff) | |
| download | rust-3c7947ee43b14f124b41f5de7c247dc8e47a18fa.tar.gz rust-3c7947ee43b14f124b41f5de7c247dc8e47a18fa.zip | |
Gate stability attrs with other attributes.
Diffstat (limited to 'src')
12 files changed, 175 insertions, 107 deletions
diff --git a/src/test/ui/deprecation/deprecation-in-staged-api.stderr b/src/test/ui/deprecation/deprecation-in-staged-api.stderr index cf977fa4b7b..5c14f5ed356 100644 --- a/src/test/ui/deprecation/deprecation-in-staged-api.stderr +++ b/src/test/ui/deprecation/deprecation-in-staged-api.stderr @@ -3,8 +3,6 @@ error: `#[deprecated]` cannot be used in staged API | LL | #[deprecated] | ^^^^^^^^^^^^^ use `#[rustc_deprecated]` instead -LL | fn main() {} - | ------------ error: aborting due to previous error diff --git a/src/test/ui/feature-gates/feature-gate-staged_api.stderr b/src/test/ui/feature-gates/feature-gate-staged_api.stderr index a71d26ce16f..951bb5a1740 100644 --- a/src/test/ui/feature-gates/feature-gate-staged_api.stderr +++ b/src/test/ui/feature-gates/feature-gate-staged_api.stderr @@ -1,15 +1,15 @@ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/feature-gate-staged_api.rs:1:1 - | -LL | #![stable(feature = "a", since = "b")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0734]: stability attributes may not be used outside of the standard library --> $DIR/feature-gate-staged_api.rs:8:1 | LL | #[stable(feature = "a", since = "b")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +error[E0734]: stability attributes may not be used outside of the standard library + --> $DIR/feature-gate-staged_api.rs:1:1 + | +LL | #![stable(feature = "a", since = "b")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0734`. diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-rustc_deprecated.rs b/src/test/ui/feature-gates/issue-43106-gating-of-rustc_deprecated.rs index a01d85515a8..3acfbd0ca23 100644 --- a/src/test/ui/feature-gates/issue-43106-gating-of-rustc_deprecated.rs +++ b/src/test/ui/feature-gates/issue-43106-gating-of-rustc_deprecated.rs @@ -6,25 +6,38 @@ #![rustc_deprecated()] //~^ ERROR stability attributes may not be used outside of the standard library +//~| ERROR missing 'since' [E0542] #[rustc_deprecated()] //~^ ERROR stability attributes may not be used outside of the standard library +//~| ERROR missing 'since' [E0542] mod rustc_deprecated { - mod inner { #![rustc_deprecated()] } - //~^ ERROR stability attributes may not be used outside of the standard library + mod inner { + #![rustc_deprecated()] + //~^ ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'since' [E0542] + } - #[rustc_deprecated()] fn f() { } + #[rustc_deprecated()] //~^ ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'since' [E0542] + fn f() {} - #[rustc_deprecated()] struct S; + #[rustc_deprecated()] //~^ ERROR stability attributes may not be used outside of the standard library - //~| ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'since' [E0542] + //~| ERROR missing 'since' [E0542] + struct S; - #[rustc_deprecated()] type T = S; + #[rustc_deprecated()] //~^ ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'since' [E0542] + type T = S; - #[rustc_deprecated()] impl S { } + #[rustc_deprecated()] //~^ ERROR stability attributes may not be used outside of the standard library + //~| ERROR missing 'since' [E0542] + impl S {} } fn main() {} diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-rustc_deprecated.stderr b/src/test/ui/feature-gates/issue-43106-gating-of-rustc_deprecated.stderr index 3c4dcfec02b..4ec78f318c2 100644 --- a/src/test/ui/feature-gates/issue-43106-gating-of-rustc_deprecated.stderr +++ b/src/test/ui/feature-gates/issue-43106-gating-of-rustc_deprecated.stderr @@ -1,51 +1,94 @@ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:7:1 + --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:16:9 | -LL | #![rustc_deprecated()] - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | #![rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:10:1 + --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:21:5 | -LL | #[rustc_deprecated()] - | ^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:13:17 + --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:26:5 | -LL | mod inner { #![rustc_deprecated()] } - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:16:5 + --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:32:5 | -LL | #[rustc_deprecated()] fn f() { } +LL | #[rustc_deprecated()] | ^^^^^^^^^^^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:19:5 + --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:37:5 | -LL | #[rustc_deprecated()] struct S; +LL | #[rustc_deprecated()] | ^^^^^^^^^^^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:19:5 + --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:11:1 | -LL | #[rustc_deprecated()] struct S; - | ^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:23:5 + --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:7:1 + | +LL | #![rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0542]: missing 'since' + --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:7:1 + | +LL | #![rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0542]: missing 'since' + --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:11:1 + | +LL | #[rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0542]: missing 'since' + --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:16:9 + | +LL | #![rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0542]: missing 'since' + --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:21:5 | -LL | #[rustc_deprecated()] type T = S; +LL | #[rustc_deprecated()] | ^^^^^^^^^^^^^^^^^^^^^ -error[E0734]: stability attributes may not be used outside of the standard library +error[E0542]: missing 'since' --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:26:5 | -LL | #[rustc_deprecated()] impl S { } +LL | #[rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0542]: missing 'since' + --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:26:5 + | +LL | #[rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0542]: missing 'since' + --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:32:5 + | +LL | #[rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0542]: missing 'since' + --> $DIR/issue-43106-gating-of-rustc_deprecated.rs:37:5 + | +LL | #[rustc_deprecated()] | ^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 8 previous errors +error: aborting due to 15 previous errors -For more information about this error, try `rustc --explain E0734`. +Some errors have detailed explanations: E0542, E0734. +For more information about an error, try `rustc --explain E0542`. diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-stable.rs b/src/test/ui/feature-gates/issue-43106-gating-of-stable.rs index 73ff965307f..621ec01bbe2 100644 --- a/src/test/ui/feature-gates/issue-43106-gating-of-stable.rs +++ b/src/test/ui/feature-gates/issue-43106-gating-of-stable.rs @@ -10,21 +10,26 @@ #[stable()] //~^ ERROR stability attributes may not be used outside of the standard library mod stable { - mod inner { #![stable()] } - //~^ ERROR stability attributes may not be used outside of the standard library + mod inner { + #![stable()] + //~^ ERROR stability attributes may not be used outside of the standard library + } - #[stable()] fn f() { } + #[stable()] //~^ ERROR stability attributes may not be used outside of the standard library + fn f() {} - #[stable()] struct S; + #[stable()] //~^ ERROR stability attributes may not be used outside of the standard library - //~| ERROR stability attributes may not be used outside of the standard library + struct S; - #[stable()] type T = S; + #[stable()] //~^ ERROR stability attributes may not be used outside of the standard library + type T = S; - #[stable()] impl S { } + #[stable()] //~^ ERROR stability attributes may not be used outside of the standard library + impl S {} } fn main() {} diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-stable.stderr b/src/test/ui/feature-gates/issue-43106-gating-of-stable.stderr index 2573db1d684..677fef3a926 100644 --- a/src/test/ui/feature-gates/issue-43106-gating-of-stable.stderr +++ b/src/test/ui/feature-gates/issue-43106-gating-of-stable.stderr @@ -1,51 +1,45 @@ error[E0734]: stability attributes may not be used outside of the standard library - --> $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 + --> $DIR/issue-43106-gating-of-stable.rs:14:9 | -LL | #[stable()] - | ^^^^^^^^^^^ +LL | #![stable()] + | ^^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:13:17 + --> $DIR/issue-43106-gating-of-stable.rs:18:5 | -LL | mod inner { #![stable()] } - | ^^^^^^^^^^^^ +LL | #[stable()] + | ^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:16:5 + --> $DIR/issue-43106-gating-of-stable.rs:22:5 | -LL | #[stable()] fn f() { } +LL | #[stable()] | ^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:19:5 + --> $DIR/issue-43106-gating-of-stable.rs:26:5 | -LL | #[stable()] struct S; +LL | #[stable()] | ^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:19:5 + --> $DIR/issue-43106-gating-of-stable.rs:30:5 | -LL | #[stable()] struct S; +LL | #[stable()] | ^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:23:5 + --> $DIR/issue-43106-gating-of-stable.rs:10:1 | -LL | #[stable()] type T = S; - | ^^^^^^^^^^^ +LL | #[stable()] + | ^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-stable.rs:26:5 + --> $DIR/issue-43106-gating-of-stable.rs:7:1 | -LL | #[stable()] impl S { } - | ^^^^^^^^^^^ +LL | #![stable()] + | ^^^^^^^^^^^^ -error: aborting due to 8 previous errors +error: aborting due to 7 previous errors For more information about this error, try `rustc --explain E0734`. diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-unstable.rs b/src/test/ui/feature-gates/issue-43106-gating-of-unstable.rs index d8339b00c12..d507bcd8f15 100644 --- a/src/test/ui/feature-gates/issue-43106-gating-of-unstable.rs +++ b/src/test/ui/feature-gates/issue-43106-gating-of-unstable.rs @@ -10,21 +10,26 @@ #[unstable()] //~^ ERROR stability attributes may not be used outside of the standard library mod unstable { - mod inner { #![unstable()] } - //~^ ERROR stability attributes may not be used outside of the standard library + mod inner { + #![unstable()] + //~^ ERROR stability attributes may not be used outside of the standard library + } - #[unstable()] fn f() { } + #[unstable()] //~^ ERROR stability attributes may not be used outside of the standard library + fn f() {} - #[unstable()] struct S; + #[unstable()] //~^ ERROR stability attributes may not be used outside of the standard library - //~| ERROR stability attributes may not be used outside of the standard library + struct S; - #[unstable()] type T = S; + #[unstable()] //~^ ERROR stability attributes may not be used outside of the standard library + type T = S; - #[unstable()] impl S { } + #[unstable()] //~^ ERROR stability attributes may not be used outside of the standard library + impl S {} } fn main() {} diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-unstable.stderr b/src/test/ui/feature-gates/issue-43106-gating-of-unstable.stderr index 500675e054c..a2f361878c6 100644 --- a/src/test/ui/feature-gates/issue-43106-gating-of-unstable.stderr +++ b/src/test/ui/feature-gates/issue-43106-gating-of-unstable.stderr @@ -1,51 +1,45 @@ error[E0734]: stability attributes may not be used outside of the standard library - --> $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 + --> $DIR/issue-43106-gating-of-unstable.rs:14:9 | -LL | #[unstable()] - | ^^^^^^^^^^^^^ +LL | #![unstable()] + | ^^^^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:13:17 + --> $DIR/issue-43106-gating-of-unstable.rs:18:5 | -LL | mod inner { #![unstable()] } - | ^^^^^^^^^^^^^^ +LL | #[unstable()] + | ^^^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:16:5 + --> $DIR/issue-43106-gating-of-unstable.rs:22:5 | -LL | #[unstable()] fn f() { } +LL | #[unstable()] | ^^^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:19:5 + --> $DIR/issue-43106-gating-of-unstable.rs:26:5 | -LL | #[unstable()] struct S; +LL | #[unstable()] | ^^^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:19:5 + --> $DIR/issue-43106-gating-of-unstable.rs:30:5 | -LL | #[unstable()] struct S; +LL | #[unstable()] | ^^^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:23:5 + --> $DIR/issue-43106-gating-of-unstable.rs:10:1 | -LL | #[unstable()] type T = S; - | ^^^^^^^^^^^^^ +LL | #[unstable()] + | ^^^^^^^^^^^^^ error[E0734]: stability attributes may not be used outside of the standard library - --> $DIR/issue-43106-gating-of-unstable.rs:26:5 + --> $DIR/issue-43106-gating-of-unstable.rs:7:1 | -LL | #[unstable()] impl S { } - | ^^^^^^^^^^^^^ +LL | #![unstable()] + | ^^^^^^^^^^^^^^ -error: aborting due to 8 previous errors +error: aborting due to 7 previous errors For more information about this error, try `rustc --explain E0734`. diff --git a/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs b/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs index 1f0a7a8f8a5..1627d1d3f9f 100644 --- a/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs +++ b/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs @@ -3,4 +3,5 @@ #[unstable()] //~ ERROR: stability attributes may not be used #[stable()] //~ ERROR: stability attributes may not be used #[rustc_deprecated()] //~ ERROR: stability attributes may not be used -fn main() { } +//~^ ERROR missing 'since' +fn main() {} diff --git a/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr b/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr index 32b0f405d6f..a2b2d3cbe59 100644 --- a/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr @@ -16,6 +16,13 @@ error[E0734]: stability attributes may not be used outside of the standard libra LL | #[rustc_deprecated()] | ^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors +error[E0542]: missing 'since' + --> $DIR/stability-attribute-non-staged-force-unstable.rs:5:1 + | +LL | #[rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0734`. +Some errors have detailed explanations: E0542, E0734. +For more information about an error, try `rustc --explain E0542`. diff --git a/src/test/ui/stability-attribute/stability-attribute-non-staged.rs b/src/test/ui/stability-attribute/stability-attribute-non-staged.rs index fc2c2b587fe..dfbd9ea5ebf 100644 --- a/src/test/ui/stability-attribute/stability-attribute-non-staged.rs +++ b/src/test/ui/stability-attribute/stability-attribute-non-staged.rs @@ -1,4 +1,5 @@ #[unstable()] //~ ERROR: stability attributes may not be used #[stable()] //~ ERROR: stability attributes may not be used #[rustc_deprecated()] //~ ERROR: stability attributes may not be used -fn main() { } +//~^ ERROR missing 'since' +fn main() {} diff --git a/src/test/ui/stability-attribute/stability-attribute-non-staged.stderr b/src/test/ui/stability-attribute/stability-attribute-non-staged.stderr index 7648effc480..9af8d1df4ea 100644 --- a/src/test/ui/stability-attribute/stability-attribute-non-staged.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-non-staged.stderr @@ -16,6 +16,13 @@ error[E0734]: stability attributes may not be used outside of the standard libra LL | #[rustc_deprecated()] | ^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors +error[E0542]: missing 'since' + --> $DIR/stability-attribute-non-staged.rs:3:1 + | +LL | #[rustc_deprecated()] + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0734`. +Some errors have detailed explanations: E0542, E0734. +For more information about an error, try `rustc --explain E0542`. |
