File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ //@ force-host
2+ //@ no-prefer-dynamic
3+ //@ compile-flags: --crate-type proc-macro
4+
5+ #![ crate_type = "proc-macro" ]
6+ #![ crate_name = "just_some_proc" ]
7+
8+ extern crate proc_macro;
9+
10+ use proc_macro:: TokenStream ;
11+
12+ #[ proc_macro_attribute]
13+ pub fn repro ( _args : TokenStream , _input : TokenStream ) -> TokenStream {
14+ "struct Repro;" . parse ( ) . unwrap ( )
15+ }
Original file line number Diff line number Diff line change 1+ // Regression test for <https://github.com/rust-lang/rust/issues/148184>.
2+ // It ensures that the macro expansion correctly handles its "class stack".
3+
4+ //@ compile-flags: -Zunstable-options --generate-macro-expansion
5+ //@ aux-build:one-line-expand.rs
6+
7+ #![ crate_name = "foo" ]
8+
9+ extern crate just_some_proc;
10+
11+ //@ has 'src/foo/one-line-expand.rs.html'
12+ //@ has - '//*[@class="comment"]' '//'
13+ //@ has - '//*[@class="original"]' '#[just_some_proc::repro]'
14+ //@ has - '//*[@class="original"]/*[@class="attr"]' '#[just_some_proc::repro]'
15+ //@ has - '//code/*[@class="kw"]' 'struct '
16+
17+ //
18+ #[ just_some_proc:: repro]
19+ struct Repro ;
You can’t perform that action at this time.
0 commit comments