]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/hygiene/auxiliary/cached_hygiene.rs
Auto merge of #83342 - Count-Count:win-console-incomplete-utf8, r=m-ou-se
[rust.git] / src / test / incremental / hygiene / auxiliary / cached_hygiene.rs
1 // revisions:rpass1 rpass2
2 // compile-flags: -Z query-dep-graph
3
4 // We use #[inline(always)] to ensure that the downstream crate
5 // will always load the MIR for these functions
6
7 #![feature(rustc_attrs)]
8
9 #[allow(unused)]
10 macro_rules! first_macro {
11     () => {
12         println!("New call!");
13     }
14 }
15
16 #[rustc_clean(except="hir_owner_nodes,typeck,optimized_mir,promoted_mir", cfg="rpass2")]
17 #[inline(always)]
18 pub fn changed_fn() {
19     // This will cause additional hygiene to be generate,
20     // which will cause the SyntaxContext/ExpnId raw ids to be
21     // different when we write out `my_fn` to the crate metadata.
22     #[cfg(rpass2)]
23     first_macro!();
24 }
25
26 macro_rules! print_loc {
27     () => {
28         println!("Caller loc: {}", std::panic::Location::caller());
29     }
30 }
31
32 #[rustc_clean(cfg="rpass2")]
33 #[inline(always)]
34 pub fn unchanged_fn() {
35     print_loc!();
36 }