File: remap-path-prefix-macro.rs

package info (click to toggle)
rustc 1.88.0%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 934,128 kB
  • sloc: xml: 158,127; python: 36,062; javascript: 19,855; sh: 19,700; cpp: 18,947; ansic: 12,993; asm: 4,792; makefile: 690; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (47 lines) | stat: -rw-r--r-- 1,869 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// This test exercises `-Zremap-path-scope`, macros (like file!()) and dependency.
//
// We test different combinations with/without remap in deps, with/without remap in
// this crate but always in deps and always here but never in deps.

//@ run-pass
//@ check-run-results

//@ revisions: with-diag-in-deps with-macro-in-deps with-debuginfo-in-deps
//@ revisions: only-diag-in-deps only-macro-in-deps only-debuginfo-in-deps
//@ revisions: not-macro-in-deps

//@[with-diag-in-deps] compile-flags: --remap-path-prefix={{src-base}}=remapped
//@[with-macro-in-deps] compile-flags: --remap-path-prefix={{src-base}}=remapped
//@[with-debuginfo-in-deps] compile-flags: --remap-path-prefix={{src-base}}=remapped
//@[not-macro-in-deps] compile-flags: --remap-path-prefix={{src-base}}=remapped

//@[with-diag-in-deps] compile-flags: -Zremap-path-scope=diagnostics
//@[with-macro-in-deps] compile-flags: -Zremap-path-scope=macro
//@[with-debuginfo-in-deps] compile-flags: -Zremap-path-scope=debuginfo
//@[not-macro-in-deps] compile-flags: -Zremap-path-scope=macro

//@[with-diag-in-deps] aux-build:file-diag.rs
//@[with-macro-in-deps] aux-build:file-macro.rs
//@[with-debuginfo-in-deps] aux-build:file-debuginfo.rs
//@[only-diag-in-deps] aux-build:file-diag.rs
//@[only-macro-in-deps] aux-build:file-macro.rs
//@[only-debuginfo-in-deps] aux-build:file-debuginfo.rs
//@[not-macro-in-deps] aux-build:file.rs

#[cfg(any(with_diag_in_deps, only_diag_in_deps))]
extern crate file_diag as file;

#[cfg(any(with_macro_in_deps, only_macro_in_deps))]
extern crate file_macro as file;

#[cfg(any(with_debuginfo_in_deps, only_debuginfo_in_deps))]
extern crate file_debuginfo as file;

#[cfg(not_macro_in_deps)]
extern crate file;

fn main() {
    println!("file::my_file!() = {}", file::my_file!());
    println!("file::file() = {}", file::file());
    println!("file!() = {}", file!());
}