-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Expand file tree
/
Copy pathremap-path-prefix.rs
More file actions
28 lines (23 loc) · 1.41 KB
/
remap-path-prefix.rs
File metadata and controls
28 lines (23 loc) · 1.41 KB
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
// This test exercises `--remap-path-prefix` and `--remap-path-scope` with macros,
// like file!() and a diagnostic with compile_error!().
//
// See the compiler test suite for a more advanced tests, we just want to
// make sure here that rustdoc passes the right scopes to the underline rustc APIs.
//@ revisions: with-diag-scope with-macro-scope with-debuginfo-scope with-doc-scope
//@ revisions: without-scopes without-remap
//@[with-diag-scope] compile-flags: --remap-path-prefix={{src-base}}=remapped
//@[with-macro-scope] compile-flags: --remap-path-prefix={{src-base}}=remapped
//@[with-debuginfo-scope] compile-flags: --remap-path-prefix={{src-base}}=remapped
//@[with-doc-scope] compile-flags: --remap-path-prefix={{src-base}}=remapped
//@[without-scopes] compile-flags: --remap-path-prefix={{src-base}}=remapped
//@[with-diag-scope] compile-flags: -Zunstable-options --remap-path-scope=diagnostics
//@[with-macro-scope] compile-flags: -Zunstable-options --remap-path-scope=macro
//@[with-debuginfo-scope] compile-flags: -Zunstable-options --remap-path-scope=debuginfo
//@[with-doc-scope] compile-flags: -Zunstable-options --remap-path-scope=documentation
compile_error!(concat!("file!() = ", file!()));
//[with-macro-scope]~^ ERROR file!()
//[with-debuginfo-scope]~^^ ERROR file!()
//[with-doc-scope]~^^^ ERROR file!()
//[without-remap]~^^^^ ERROR file!()
//[with-diag-scope]~? ERROR file!()
//[without-scopes]~? ERROR file!()