]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/source_loc_macros.rs
Rollup merge of #35286 - dns2utf8:doc_never_expression, r=nikomatsakis
[rust.git] / src / test / incremental / source_loc_macros.rs
1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // This test makes sure that different expansions of the file!(), line!(),
12 // column!() macros get picked up by the incr. comp. hash.
13
14 // revisions:rpass1 rpass2
15
16 // compile-flags: -Z query-dep-graph
17
18 #![feature(rustc_attrs)]
19
20 #[rustc_clean(label="Hir", cfg="rpass2")]
21 fn line_same() {
22     let _ = line!();
23 }
24
25 #[rustc_clean(label="Hir", cfg="rpass2")]
26 fn col_same() {
27     let _ = column!();
28 }
29
30 #[rustc_clean(label="Hir", cfg="rpass2")]
31 fn file_same() {
32     let _ = file!();
33 }
34
35 #[cfg(rpass1)]
36 fn line_different() {
37     let _ = line!();
38 }
39
40 #[cfg(rpass2)]
41 #[rustc_dirty(label="Hir", cfg="rpass2")]
42 fn line_different() {
43     let _ = line!();
44 }
45
46 #[cfg(rpass1)]
47 fn col_different() {
48     let _ = column!();
49 }
50
51 #[cfg(rpass2)]
52 #[rustc_dirty(label="Hir", cfg="rpass2")]
53 fn col_different() {
54     let _ =        column!();
55 }
56
57 fn main() {
58     line_same();
59     line_different();
60     col_same();
61     col_different();
62     file_same();
63 }