forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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#61024 - petrochenkov:proctest, r=nikomatsakis
tests: Centralize proc macros commonly used for testing Many proc macros in `ui\proc-macro\auxiliary` were doing same things. (I added a fair share of those myself.) Now commonly used macros (empty, identity, etc) are collected in one place - `ui\proc-macro\auxiliary\test-macros.rs`.
- Loading branch information
Showing
72 changed files
with
475 additions
and
649 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/test/ui/custom-derive/helper-attr-blocked-by-import-ambig.rs
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
src/test/ui/custom-derive/helper-attr-blocked-by-import-ambig.stderr
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
src/test/ui/custom-derive/helper-attr-blocked-by-import.rs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
// aux-build:attr_proc_macro.rs | ||
// aux-build:test-macros.rs | ||
|
||
extern crate attr_proc_macro; | ||
use attr_proc_macro::*; | ||
#[macro_use] | ||
extern crate test_macros; | ||
|
||
#[attr_proc_macro] // OK | ||
#[identity_attr] // OK | ||
#[derive(Clone)] | ||
struct Before; | ||
|
||
#[derive(Clone)] | ||
#[attr_proc_macro] //~ ERROR macro attributes must be placed before `#[derive]` | ||
#[identity_attr] //~ ERROR macro attributes must be placed before `#[derive]` | ||
struct After; | ||
|
||
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
error: macro attributes must be placed before `#[derive]` | ||
--> $DIR/attribute-order-restricted.rs:11:1 | ||
| | ||
LL | #[attr_proc_macro] | ||
| ^^^^^^^^^^^^^^^^^^ | ||
LL | #[identity_attr] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#[macro_export] | ||
macro_rules! my_attr { () => () } | ||
macro_rules! empty_helper { () => () } |
12 changes: 0 additions & 12 deletions
12
src/test/ui/proc-macro/auxiliary/derive-helper-shadowed.rs
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
src/test/ui/proc-macro/auxiliary/derive-helper-shadowing.rs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.