Skip to content

Commit edab6c7

Browse files
committed
Workaround issues with crate loading during cross-compilation
1 parent f756257 commit edab6c7

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/test/ui/proc-macro/dollar-crate.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
// edition:2018
2-
// compile-flags:--extern dollar_crate --extern dollar_crate_external
32
// aux-build:dollar-crate.rs
43
// aux-build:dollar-crate-external.rs
54

65
// Anonymize unstable non-dummy spans while still showing dummy spans `0..0`.
76
// normalize-stdout-test "bytes\([^0]\w*\.\.(\w+)\)" -> "bytes(LO..$1)"
87
// normalize-stdout-test "bytes\((\w+)\.\.[^0]\w*\)" -> "bytes($1..HI)"
98

9+
extern crate dollar_crate;
10+
extern crate dollar_crate_external;
11+
1012
type S = u8;
1113

1214
mod local {
15+
use crate::dollar_crate;
16+
1317
macro_rules! local {
1418
() => {
1519
dollar_crate::m! {
@@ -28,6 +32,8 @@ mod local {
2832
}
2933

3034
mod external {
35+
use crate::dollar_crate_external;
36+
3137
dollar_crate_external::external!(); //~ ERROR the name `D` is defined multiple times
3238
}
3339

src/test/ui/proc-macro/dollar-crate.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0428]: the name `D` is defined multiple times
2-
--> $DIR/dollar-crate.rs:23:13
2+
--> $DIR/dollar-crate.rs:27:13
33
|
44
LL | struct D($crate::S); //~ ERROR the name `D` is defined multiple times
55
| ^^^^^^^^^^^^^^^^^^^^
@@ -13,7 +13,7 @@ LL | local!();
1313
= note: `D` must be defined only once in the type namespace of this module
1414

1515
error[E0428]: the name `D` is defined multiple times
16-
--> $DIR/dollar-crate.rs:31:5
16+
--> $DIR/dollar-crate.rs:37:5
1717
|
1818
LL | dollar_crate_external::external!(); //~ ERROR the name `D` is defined multiple times
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)