File tree Expand file tree Collapse file tree 2 files changed +11
-28
lines changed
tests/incremental/derive_macro_expansion Expand file tree Collapse file tree 2 files changed +11
-28
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,5 @@ use proc_macro::TokenStream;
10
10
pub fn derive ( _input : TokenStream ) -> TokenStream {
11
11
eprintln ! ( "invoked" ) ;
12
12
13
- return r#"
14
- pub mod nothing_mod {
15
- pub fn nothing() {
16
- eprintln!("nothing");
17
- }
18
- }
19
- "# . parse ( ) . unwrap ( ) ;
13
+ TokenStream :: new ( )
20
14
}
Original file line number Diff line number Diff line change 7
7
// FIXME(pr-time): Properly have the test check this, but how? UI-test that tests for `.stderr`?
8
8
9
9
//@ aux-build:derive_nothing.rs
10
- //@ revisions:cfail1 cfail2
11
- //@ compile-flags: -Z query-dep-graph -Zcache-derive-macros=true
12
- //@ build-pass
10
+ //@ revisions:rpass1 rpass2
11
+ //@ compile-flags: -Zquery-dep-graph -Zcache-derive-macros
13
12
14
13
#![ feature( rustc_attrs) ]
15
- #![ feature( stmt_expr_attributes) ]
16
- #![ allow( dead_code) ]
17
- #![ crate_type = "rlib" ]
18
- #![ rustc_partition_codegened( module = "proc_macro_unchanged-foo" , cfg = "cfail1" ) ]
19
- // #![rustc_partition_codegened(module="proc_macro_unchanged-foo", cfg="cfail2")]
20
-
21
- // `foo::nothing_mod` is created by the derive macro and doesn't change
22
- // BUG: this yields the same result with `-Zcache-derive-macros=false` (i.e., uncached),
23
- // not sure how to do this correctly.
24
- #![ rustc_partition_reused( module = "proc_macro_unchanged-foo-nothing_mod" , cfg = "cfail2" ) ]
25
14
26
15
#[ macro_use]
27
16
extern crate derive_nothing;
28
17
29
- pub mod foo {
30
- #[ derive( Nothing ) ]
31
- pub struct Foo ;
18
+ # [ cfg ( rpass1 ) ]
19
+ #[ derive( Nothing ) ]
20
+ pub struct Foo ;
32
21
33
- pub fn use_foo ( _f : Foo ) {
34
- nothing_mod:: nothing ( ) ;
22
+ #[ cfg( rpass2) ]
23
+ #[ derive( Nothing ) ]
24
+ #[ rustc_clean( cfg = "rpass2" , loaded_from_disk = "derive_macro_expansion" ) ]
25
+ pub struct Foo ;
35
26
36
- eprintln ! ( "foo used" ) ;
37
- }
38
- }
27
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments