Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a15f484
commit c02d210
Showing
5 changed files
with
87 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// aux-build:test-macros.rs | ||
|
||
#![dummy] //~ ERROR cannot find attribute `dummy` in this scope | ||
|
||
#[macro_use] | ||
extern crate test_macros; | ||
|
||
#[derive(Empty)] //~ ERROR cannot determine resolution for the attribute macro `derive` | ||
#[empty_helper] //~ WARN derive helper attribute is used before it is introduced | ||
//~| WARN this was previously accepted | ||
struct Foo {} | ||
|
||
fn main() {} |
28 changes: 28 additions & 0 deletions
28
src/test/ui/proc-macro/derive-helper-legacy-spurious.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,28 @@ | ||
error: cannot find attribute `dummy` in this scope | ||
--> $DIR/derive-helper-legacy-spurious.rs:3:4 | ||
| | ||
LL | #![dummy] | ||
| ^^^^^ | ||
|
||
error: cannot determine resolution for the attribute macro `derive` | ||
--> $DIR/derive-helper-legacy-spurious.rs:8:3 | ||
| | ||
LL | #[derive(Empty)] | ||
| ^^^^^^ | ||
| | ||
= note: import resolution is stuck, try simplifying macro imports | ||
|
||
warning: derive helper attribute is used before it is introduced | ||
--> $DIR/derive-helper-legacy-spurious.rs:9:3 | ||
| | ||
LL | #[derive(Empty)] | ||
| ----- the attribute is introduced here | ||
LL | #[empty_helper] | ||
| ^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(legacy_derive_helpers)]` on by default | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #79202 <https://github.com/rust-lang/rust/issues/79202> | ||
|
||
error: aborting due to 2 previous errors; 1 warning emitted | ||
|
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,23 @@ | ||
// Order of inert attributes, both built-in and custom is preserved during expansion. | ||
|
||
// check-pass | ||
// compile-flags: -Z span-debug | ||
// aux-build:test-macros.rs | ||
|
||
#![no_std] // Don't load unnecessary hygiene information from std | ||
extern crate std; | ||
|
||
#[macro_use] | ||
extern crate test_macros; | ||
|
||
/// 1 | ||
#[rustfmt::attr2] | ||
#[doc = "3"] | ||
#[print_attr(nodebug)] | ||
#[doc = "4"] | ||
#[rustfmt::attr5] | ||
/// 6 | ||
#[print_attr(nodebug)] | ||
struct S; | ||
|
||
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
PRINT-ATTR INPUT (DISPLAY): /// 1 | ||
#[doc = "3"] #[doc = "4"] #[rustfmt :: attr5] /// 6 | ||
#[print_attr(nodebug)] #[rustfmt :: attr2] struct S ; | ||
PRINT-ATTR RE-COLLECTED (DISPLAY): #[doc = " 1"] #[doc = "3"] #[doc = "4"] #[rustfmt :: attr5] #[doc = " 6"] | ||
#[print_attr(nodebug)] #[rustfmt :: attr2] struct S ; | ||
PRINT-ATTR INPUT (DISPLAY): #[doc = " 1"] #[doc = "3"] #[doc = "4"] #[doc = " 6"] #[rustfmt :: attr2] | ||
#[rustfmt :: attr5] struct S ; |