-
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.
- Loading branch information
1 parent
f6caae5
commit d8af6de
Showing
5 changed files
with
52 additions
and
0 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,11 @@ | ||
// check-pass | ||
// edition:2018 | ||
|
||
use derive as my_derive; | ||
|
||
#[my_derive(Debug)] | ||
struct S; | ||
|
||
fn main() { | ||
println!("{:?}", S); // OK | ||
} |
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,21 @@ | ||
// Support for legacy derive helpers is limited and heuristic-based | ||
// (that's exactly the reason why they are deprecated). | ||
|
||
// edition:2018 | ||
// aux-build:test-macros.rs | ||
|
||
#[macro_use] | ||
extern crate test_macros; | ||
|
||
use derive as my_derive; | ||
|
||
#[my_derive(Empty)] | ||
#[empty_helper] // OK | ||
struct S1; | ||
|
||
// Legacy helper detection doesn't see through `derive` renaming. | ||
#[empty_helper] //~ ERROR cannot find attribute `empty_helper` in this scope | ||
#[my_derive(Empty)] | ||
struct S2; | ||
|
||
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,8 @@ | ||
error: cannot find attribute `empty_helper` in this scope | ||
--> $DIR/derive-helper-legacy-limits.rs:17:3 | ||
| | ||
LL | #[empty_helper] | ||
| ^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|