From edab6c74923cacb3058fb7942577ad27e7cd32ff Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Tue, 18 Dec 2018 03:21:28 +0300 Subject: [PATCH] Workaround issues with crate loading during cross-compilation --- src/test/ui/proc-macro/dollar-crate.rs | 8 +++++++- src/test/ui/proc-macro/dollar-crate.stderr | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/test/ui/proc-macro/dollar-crate.rs b/src/test/ui/proc-macro/dollar-crate.rs index 3f4a01cb2dca9..1460e9a3b2d55 100644 --- a/src/test/ui/proc-macro/dollar-crate.rs +++ b/src/test/ui/proc-macro/dollar-crate.rs @@ -1,5 +1,4 @@ // edition:2018 -// compile-flags:--extern dollar_crate --extern dollar_crate_external // aux-build:dollar-crate.rs // aux-build:dollar-crate-external.rs @@ -7,9 +6,14 @@ // 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! { @@ -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 } diff --git a/src/test/ui/proc-macro/dollar-crate.stderr b/src/test/ui/proc-macro/dollar-crate.stderr index 75d3e17802ebd..08de3c7d1a666 100644 --- a/src/test/ui/proc-macro/dollar-crate.stderr +++ b/src/test/ui/proc-macro/dollar-crate.stderr @@ -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 | ^^^^^^^^^^^^^^^^^^^^ @@ -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 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^