forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#62133 - petrochenkov:norustc, r=eddyb
Feature gate `rustc` attributes harder Fixes rust-lang#62116
- Loading branch information
Showing
25 changed files
with
251 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/test/ui/attributes/attrs-with-no-formal-in-generics-1.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
error: trailing attribute after generic parameter | ||
--> $DIR/attrs-with-no-formal-in-generics-1.rs:9:25 | ||
--> $DIR/attrs-with-no-formal-in-generics-1.rs:9:29 | ||
| | ||
LL | impl<#[rustc_1] 'a, 'b, #[oops]> RefIntPair<'a, 'b> { | ||
| ^^^^^^^ attributes must go before parameters | ||
LL | impl<#[rustc_dummy] 'a, 'b, #[oops]> RefIntPair<'a, 'b> { | ||
| ^^^^^^^ attributes must go before parameters | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/test/ui/attributes/attrs-with-no-formal-in-generics-2.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
error: trailing attribute after generic parameter | ||
--> $DIR/attrs-with-no-formal-in-generics-2.rs:9:35 | ||
--> $DIR/attrs-with-no-formal-in-generics-2.rs:9:43 | ||
| | ||
LL | impl<#[rustc_1] 'a, #[rustc_2] T, #[oops]> RefAny<'a, T> {} | ||
| ^^^^^^^ attributes must go before parameters | ||
LL | impl<#[rustc_dummy] 'a, #[rustc_dummy] T, #[oops]> RefAny<'a, T> {} | ||
| ^^^^^^^ attributes must go before parameters | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,23 @@ | ||
// Test that `#[rustc_*]` attributes are gated by `rustc_attrs` feature gate. | ||
|
||
#[rustc_foo] | ||
//~^ ERROR unless otherwise specified, attributes with the prefix `rustc_` are reserved | ||
#![feature(decl_macro)] | ||
|
||
mod rustc { pub macro unknown() {} } | ||
mod unknown { pub macro rustc() {} } | ||
|
||
#[rustc::unknown] | ||
//~^ ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler | ||
//~| ERROR macro `rustc::unknown` may not be used in attributes | ||
fn f() {} | ||
|
||
#[unknown::rustc] | ||
//~^ ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler | ||
//~| ERROR macro `unknown::rustc` may not be used in attributes | ||
fn g() {} | ||
|
||
#[rustc_dummy] | ||
//~^ ERROR used by the test suite | ||
#[rustc_unknown] | ||
//~^ ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler | ||
//~| ERROR attribute `rustc_unknown` is currently unknown | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,60 @@ | ||
error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics | ||
--> $DIR/feature-gate-rustc-attrs.rs:3:3 | ||
error[E0658]: attributes starting with `rustc` are reserved for use by the `rustc` compiler | ||
--> $DIR/feature-gate-rustc-attrs.rs:8:3 | ||
| | ||
LL | #[rustc_foo] | ||
| ^^^^^^^^^ | ||
LL | #[rustc::unknown] | ||
| ^^^^^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/29642 | ||
= help: add #![feature(rustc_attrs)] to the crate attributes to enable | ||
|
||
error: aborting due to previous error | ||
error: macro `rustc::unknown` may not be used in attributes | ||
--> $DIR/feature-gate-rustc-attrs.rs:8:1 | ||
| | ||
LL | #[rustc::unknown] | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0658]: attributes starting with `rustc` are reserved for use by the `rustc` compiler | ||
--> $DIR/feature-gate-rustc-attrs.rs:13:12 | ||
| | ||
LL | #[unknown::rustc] | ||
| ^^^^^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/29642 | ||
= help: add #![feature(rustc_attrs)] to the crate attributes to enable | ||
|
||
error: macro `unknown::rustc` may not be used in attributes | ||
--> $DIR/feature-gate-rustc-attrs.rs:13:1 | ||
| | ||
LL | #[unknown::rustc] | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0658]: attributes starting with `rustc` are reserved for use by the `rustc` compiler | ||
--> $DIR/feature-gate-rustc-attrs.rs:20:3 | ||
| | ||
LL | #[rustc_unknown] | ||
| ^^^^^^^^^^^^^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/29642 | ||
= help: add #![feature(rustc_attrs)] to the crate attributes to enable | ||
|
||
error[E0658]: The attribute `rustc_unknown` is currently unknown to the compiler and may have meaning added to it in the future | ||
--> $DIR/feature-gate-rustc-attrs.rs:20:3 | ||
| | ||
LL | #[rustc_unknown] | ||
| ^^^^^^^^^^^^^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/29642 | ||
= help: add #![feature(custom_attribute)] to the crate attributes to enable | ||
|
||
error[E0658]: used by the test suite | ||
--> $DIR/feature-gate-rustc-attrs.rs:18:1 | ||
| | ||
LL | #[rustc_dummy] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: for more information, see https://github.com/rust-lang/rust/issues/29642 | ||
= help: add #![feature(rustc_attrs)] to the crate attributes to enable | ||
|
||
error: aborting due to 7 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
Oops, something went wrong.