-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature gate macro attributes in
#[derive]
output
- Loading branch information
1 parent
dbdbd30
commit f6caae5
Showing
7 changed files
with
124 additions
and
29 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
28 changes: 28 additions & 0 deletions
28
src/test/ui/proc-macro/attribute-after-derive-feature-gate.rs
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// gate-test-macro_attributes_in_derive_output | ||
// aux-build: test-macros.rs | ||
|
||
#![feature(proc_macro_hygiene)] | ||
#![feature(stmt_expr_attributes)] | ||
|
||
#[macro_use] | ||
extern crate test_macros; | ||
|
||
#[derive(Empty)] | ||
#[empty_attr] //~ ERROR macro attributes in `#[derive]` output are unstable | ||
struct S1 { | ||
field: [u8; 10], | ||
} | ||
|
||
#[derive(Empty)] | ||
#[empty_helper] | ||
#[empty_attr] //~ ERROR macro attributes in `#[derive]` output are unstable | ||
struct S2 { | ||
field: [u8; 10], | ||
} | ||
|
||
#[derive(Empty)] | ||
struct S3 { | ||
field: [u8; #[identity_attr] 10], //~ ERROR macro attributes in `#[derive]` output are unstable | ||
} | ||
|
||
fn main() {} |
30 changes: 30 additions & 0 deletions
30
src/test/ui/proc-macro/attribute-after-derive-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
error[E0658]: macro attributes in `#[derive]` output are unstable | ||
--> $DIR/attribute-after-derive-feature-gate.rs:11:3 | ||
| | ||
LL | #[empty_attr] | ||
| ^^^^^^^^^^ | ||
| | ||
= note: see issue #81119 <https://github.com/rust-lang/rust/issues/81119> for more information | ||
= help: add `#![feature(macro_attributes_in_derive_output)]` to the crate attributes to enable | ||
|
||
error[E0658]: macro attributes in `#[derive]` output are unstable | ||
--> $DIR/attribute-after-derive-feature-gate.rs:18:3 | ||
| | ||
LL | #[empty_attr] | ||
| ^^^^^^^^^^ | ||
| | ||
= note: see issue #81119 <https://github.com/rust-lang/rust/issues/81119> for more information | ||
= help: add `#![feature(macro_attributes_in_derive_output)]` to the crate attributes to enable | ||
|
||
error[E0658]: macro attributes in `#[derive]` output are unstable | ||
--> $DIR/attribute-after-derive-feature-gate.rs:25:19 | ||
| | ||
LL | field: [u8; #[identity_attr] 10], | ||
| ^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #81119 <https://github.com/rust-lang/rust/issues/81119> for more information | ||
= help: add `#![feature(macro_attributes_in_derive_output)]` to the crate attributes to enable | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
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