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#82419 - petrochenkov:inertord, r=Aaron1011
expand: Preserve order of inert attributes during expansion Fixes rust-lang#67839 Fixes rust-lang#81871 r? `@Aaron1011`
- Loading branch information
Showing
7 changed files
with
126 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// 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] //~ ERROR cannot find attribute `empty_helper` in this scope | ||
struct Foo {} | ||
|
||
fn main() {} |
22 changes: 22 additions & 0 deletions
22
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,22 @@ | ||
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 | ||
|
||
error: cannot find attribute `empty_helper` in this scope | ||
--> $DIR/derive-helper-legacy-spurious.rs:9:3 | ||
| | ||
LL | #[empty_helper] | ||
| ^^^^^^^^^^^^ | ||
|
||
error: aborting due to 3 previous errors | ||
|
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 | ||
#[rustfmt :: attr2] #[doc = "3"] #[doc = "4"] #[rustfmt :: attr5] /// 6 | ||
#[print_attr(nodebug)] struct S ; | ||
PRINT-ATTR RE-COLLECTED (DISPLAY): #[doc = " 1"] #[rustfmt :: attr2] #[doc = "3"] #[doc = "4"] | ||
#[rustfmt :: attr5] #[doc = " 6"] #[print_attr(nodebug)] struct S ; | ||
PRINT-ATTR INPUT (DISPLAY): #[doc = " 1"] #[rustfmt :: attr2] #[doc = "3"] #[doc = "4"] | ||
#[rustfmt :: attr5] #[doc = " 6"] struct S ; |
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