Skip to content

Commit 99e5699

Browse files
committed
port extern-prelude test to aux-crate
this still doesn't have the definitive answer, but at least is a working start .
1 parent b982ecf commit 99e5699

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/test/run-make-fulldeps/use-suggestions-rust-2018/ep-nested-lib.rs renamed to src/test/ui/rust-2018/auxiliary/ep-nested-lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
pub mod foo {
1414
pub mod bar {
15-
pub struct Baz;
15+
pub struct Bazz;
1616
}
1717
}

src/test/run-make-fulldeps/use-suggestions-rust-2018/use-suggestions.rs renamed to src/test/ui/rust-2018/use-suggestions-extern-prelude.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// edition:2018
12+
// aux-crate:netted=ep-nested-lib.rs
13+
1114
fn main() {
12-
let x = Baz{};
15+
let _x = Bazz{};
16+
//~^ ERROR cannot find struct, variant or union type `Bazz` in this scope
1317
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0422]: cannot find struct, variant or union type `Bazz` in this scope
2+
--> $DIR/use-suggestions-extern-prelude.rs:15:14
3+
|
4+
LL | let _x = Bazz{};
5+
| ^^^^ not found in this scope
6+
help: possible candidate is found in another module, you can import it into scope
7+
|
8+
LL | use netted::foo::bar::Bazz;
9+
|
10+
11+
error: aborting due to previous error
12+
13+
For more information about this error, try `rustc --explain E0422`.

src/tools/compiletest/src/runtest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,8 @@ impl<'test> TestCx<'test> {
15731573
rustc.envs(self.props.rustc_env.clone());
15741574

15751575
for aux_crate in &self.props.aux_crates {
1576-
rustc.arg(format!("--extern {}={}", aux_crate.key, aux_crate.value));
1576+
rustc.arg("--extern");
1577+
rustc.arg(format!("{}={}/lib{}", aux_crate.key, aux_dir.display(), &aux_crate.value.replace(".rs", ".so").replace("-","_")));
15771578
}
15781579

15791580
self.compose_and_run(

0 commit comments

Comments
 (0)