Skip to content

Commit 637d704

Browse files
committed
Update test
1 parent f26f394 commit 637d704

File tree

2 files changed

+11
-28
lines changed

2 files changed

+11
-28
lines changed

tests/incremental/derive_macro_expansion/auxiliary/derive_nothing.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,5 @@ use proc_macro::TokenStream;
1010
pub fn derive(_input: TokenStream) -> TokenStream {
1111
eprintln!("invoked");
1212

13-
return r#"
14-
pub mod nothing_mod {
15-
pub fn nothing() {
16-
eprintln!("nothing");
17-
}
18-
}
19-
"#.parse().unwrap();
13+
TokenStream::new()
2014
}

tests/incremental/derive_macro_expansion/proc_macro_unchanged.rs

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,21 @@
77
// FIXME(pr-time): Properly have the test check this, but how? UI-test that tests for `.stderr`?
88

99
//@ 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
1312

1413
#![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")]
2514

2615
#[macro_use]
2716
extern crate derive_nothing;
2817

29-
pub mod foo {
30-
#[derive(Nothing)]
31-
pub struct Foo;
18+
#[cfg(rpass1)]
19+
#[derive(Nothing)]
20+
pub struct Foo;
3221

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;
3526

36-
eprintln!("foo used");
37-
}
38-
}
27+
fn main() {}

0 commit comments

Comments
 (0)