parent
c8915eebea
commit
3ed6caae60
3 changed files with 50 additions and 1 deletions
26
src/test/ui/proc-macro/issue-80760-empty-stmt.rs
Normal file
26
src/test/ui/proc-macro/issue-80760-empty-stmt.rs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
// check-pass
|
||||
// aux-build:test-macros.rs
|
||||
// compile-flags: -Z span-debug
|
||||
|
||||
#![no_std] // Don't load unnecessary hygiene information from std
|
||||
extern crate std;
|
||||
|
||||
#[macro_use]
|
||||
extern crate test_macros;
|
||||
|
||||
macro_rules! empty_stmt {
|
||||
($s:stmt) => {
|
||||
print_bang!($s);
|
||||
|
||||
// Currently, all attributes are ignored
|
||||
// on an empty statement
|
||||
#[print_attr]
|
||||
#[rustc_dummy(first)]
|
||||
#[rustc_dummy(second)]
|
||||
$s
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
empty_stmt!(;);
|
||||
}
|
||||
14
src/test/ui/proc-macro/issue-80760-empty-stmt.stdout
Normal file
14
src/test/ui/proc-macro/issue-80760-empty-stmt.stdout
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
PRINT-BANG INPUT (DISPLAY): ;
|
||||
PRINT-BANG INPUT (DEBUG): TokenStream [
|
||||
Group {
|
||||
delimiter: None,
|
||||
stream: TokenStream [
|
||||
Punct {
|
||||
ch: ';',
|
||||
spacing: Alone,
|
||||
span: $DIR/issue-80760-empty-stmt.rs:25:17: 25:18 (#0),
|
||||
},
|
||||
],
|
||||
span: $DIR/issue-80760-empty-stmt.rs:13:21: 13:23 (#4),
|
||||
},
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue