Auto merge of #140716 - Urgau:improve-remap_scope-tests, r= · rust-lang/rust@b206ca0 (original) (raw)

``

1

`` +

// This test exercises -Zremap-path-scope, diagnostics printing paths and dependency.

``

``

2

`+

//

`

``

3

`+

// We test different combinations with/without remap in deps, with/without remap in this

`

``

4

`+

// crate but always in deps and always here but never in deps.

`

``

5

+

``

6

`+

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

`

``

7

`+

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

`

``

8

`+

//@ revisions: not-diag-in-deps

`

``

9

+

``

10

`+

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

`

``

11

`+

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

`

``

12

`+

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

`

``

13

`+

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

`

``

14

+

``

15

`+

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

`

``

16

`+

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

`

``

17

`+

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

`

``

18

`+

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

`

``

19

+

``

20

`+

//@[with-diag-in-deps] aux-build:trait-diag.rs

`

``

21

`+

//@[with-macro-in-deps] aux-build:trait-macro.rs

`

``

22

`+

//@[with-debuginfo-in-deps] aux-build:trait-debuginfo.rs

`

``

23

`+

//@[only-diag-in-deps] aux-build:trait-diag.rs

`

``

24

`+

//@[only-macro-in-deps] aux-build:trait-macro.rs

`

``

25

`+

//@[only-debuginfo-in-deps] aux-build:trait-debuginfo.rs

`

``

26

`+

//@[not-diag-in-deps] aux-build:trait.rs

`

``

27

+

``

28

`+

// The $SRC_DIR*.rs:LL:COL normalisation doesn't kick in automatically

`

``

29

`+

// as the remapped revision will not begin with $SRC_DIR_REAL,

`

``

30

`+

// so we have to do it ourselves.

`

``

31

`+

//@ normalize-stderr: ".rs:\d+:\d+" -> ".rs:LL:COL"

`

``

32

+

``

33

`+

#[cfg(any(with_diag_in_deps, only_diag_in_deps))]

`

``

34

`+

extern crate trait_diag as r#trait;

`

``

35

+

``

36

`+

#[cfg(any(with_macro_in_deps, only_macro_in_deps))]

`

``

37

`+

extern crate trait_macro as r#trait;

`

``

38

+

``

39

`+

#[cfg(any(with_debuginfo_in_deps, only_debuginfo_in_deps))]

`

``

40

`+

extern crate trait_debuginfo as r#trait;

`

``

41

+

``

42

`+

#[cfg(not_diag_in_deps)]

`

``

43

`+

extern crate r#trait as r#trait;

`

``

44

+

``

45

`+

struct A;

`

``

46

+

``

47

`+

impl r#trait::Trait for A {}

`

``

48

`` +

//[with-macro-in-deps]~^ ERROR A doesn't implement std::fmt::Display

``

``

49

`` +

//[with-debuginfo-in-deps]~^^ ERROR A doesn't implement std::fmt::Display

``

``

50

`` +

//[only-diag-in-deps]~^^^ ERROR A doesn't implement std::fmt::Display

``

``

51

`` +

//[only-macro-in-deps]~^^^^ ERROR A doesn't implement std::fmt::Display

``

``

52

`` +

//[only-debuginfo-in-deps]~^^^^^ ERROR A doesn't implement std::fmt::Display

``

``

53

+

``

54

`` +

//[with-diag-in-deps]~? ERROR A doesn't implement std::fmt::Display

``

``

55

`` +

//[not-diag-in-deps]~? ERROR A doesn't implement std::fmt::Display

``

``

56

+

``

57

`+

fn main() {}

`