8000 allow compiletest to pass down `--extern` flags by qmx · Pull Request #54020 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

allow compiletest to pass down --extern flags #54020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
port extern-prelude test to aux-crate
this still doesn't have the definitive answer, but at least is a working start
.
  • Loading branch information
qmx committed Oct 21, 2018
commit 99e569957011b76dd58824cab539d5c65b80f685
7 changes: 0 additions & 7 deletions src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@

pub mod foo {
pub mod bar {
pub struct Baz;
pub struct Bazz;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// edition:2018
// aux-crate:netted=ep-nested-lib.rs

fn main() {
let x = Baz{};
let _x = Bazz{};
//~^ ERROR cannot find struct, variant or union type `Bazz` in this scope
}
13 changes: 13 additions & 0 deletions src/test/ui/rust-2018/use-suggestions-extern-prelude.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error[E0422]: cannot find struct, variant or union type `Bazz` in this scope
--> $DIR/use-suggestions-extern-prelude.rs:15:14
|
LL | let _x = Bazz{};
| ^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
|
LL | use netted::foo::bar::Bazz;
|

error: aborting due to previous error

For more information about this error, try `rustc --explain E0422`.
3 changes: 2 additions & 1 deletion src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,8 @@ impl<'test> TestCx<'test> {
rustc.envs(self.props.rustc_env.clone());

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

self.compose_and_run(
Expand Down
0