-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temporarily prohibit proc macro attributes placed after derives
... and also proc macro attributes used together with test/bench.
- Loading branch information
1 parent
32dc5a0
commit 229df02
Showing
10 changed files
with
160 additions
and
51 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 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,32 @@ | ||
// aux-build:attr_proc_macro.rs | ||
// compile-flags:--test | ||
|
||
#![feature(test)] | ||
|
||
extern crate test; | ||
extern crate attr_proc_macro; | ||
use attr_proc_macro::*; | ||
|
||
#[attr_proc_macro] // OK | ||
#[derive(Clone)] | ||
struct Before; | ||
|
||
#[derive(Clone)] | ||
#[attr_proc_macro] //~ ERROR macro attributes must be placed before `#[derive]` | ||
struct After; | ||
|
||
#[attr_proc_macro] //~ ERROR macro attributes cannot be used together with `#[test]` or `#[bench]` | ||
#[test] | ||
fn test_before() {} | ||
|
||
#[test] | ||
#[attr_proc_macro] //~ ERROR macro attributes cannot be used together with `#[test]` or `#[bench]` | ||
fn test_after() {} | ||
|
||
#[attr_proc_macro] //~ ERROR macro attributes cannot be used together with `#[test]` or `#[bench]` | ||
#[bench] | ||
fn bench_before(b: &mut test::Bencher) {} | ||
|
||
#[bench] | ||
#[attr_proc_macro] //~ ERROR macro attributes cannot be used together with `#[test]` or `#[bench]` | ||
fn bench_after(b: &mut test::Bencher) {} |
Oops, something went wrong.