Skip to content

Commit

Permalink
Workaround issues with crate loading during cross-compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Dec 19, 2018
1 parent f756257 commit edab6c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/test/ui/proc-macro/dollar-crate.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
// edition:2018
// compile-flags:--extern dollar_crate --extern dollar_crate_external
// aux-build:dollar-crate.rs
// aux-build:dollar-crate-external.rs

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

extern crate dollar_crate;
extern crate dollar_crate_external;

type S = u8;

mod local {
use crate::dollar_crate;

macro_rules! local {
() => {
dollar_crate::m! {
Expand All @@ -28,6 +32,8 @@ mod local {
}

mod external {
use crate::dollar_crate_external;

dollar_crate_external::external!(); //~ ERROR the name `D` is defined multiple times
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/proc-macro/dollar-crate.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0428]: the name `D` is defined multiple times
--> $DIR/dollar-crate.rs:23:13
--> $DIR/dollar-crate.rs:27:13
|
LL | struct D($crate::S); //~ ERROR the name `D` is defined multiple times
| ^^^^^^^^^^^^^^^^^^^^
Expand All @@ -13,7 +13,7 @@ LL | local!();
= note: `D` must be defined only once in the type namespace of this module

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

0 comments on commit edab6c7

Please sign in to comment.