Skip to content
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

Move one test from run-make-fulldeps to ui #59347

Merged
merged 1 commit into from
Mar 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 0 additions & 11 deletions src/test/run-make-fulldeps/extern-prelude/Makefile

This file was deleted.

6 changes: 0 additions & 6 deletions src/test/run-make-fulldeps/extern-prelude/basic.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/test/run-make-fulldeps/extern-prelude/relative-only.rs

This file was deleted.

14 changes: 0 additions & 14 deletions src/test/run-make-fulldeps/extern-prelude/shadow-mod.rs

This file was deleted.

7 changes: 0 additions & 7 deletions src/test/run-make-fulldeps/extern-prelude/shadow-prelude.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#![crate_type = "rlib"]
#![crate_name = "Vec"]

pub fn new(arg1: f32, arg2: ()) {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![crate_type = "rlib"]

pub struct S;

impl S {
Expand Down
9 changes: 9 additions & 0 deletions src/test/ui/extern-prelude-fail.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// compile-flags:--extern extern_prelude
// aux-build:extern-prelude.rs

// Extern prelude names are not available by absolute paths

fn main() {
use extern_prelude::S; //~ ERROR unresolved import `extern_prelude`
let s = ::extern_prelude::S; //~ ERROR failed to resolve
}
16 changes: 16 additions & 0 deletions src/test/ui/extern-prelude-fail.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
error[E0432]: unresolved import `extern_prelude`
--> $DIR/extern-prelude-fail.rs:7:9
|
LL | use extern_prelude::S;
| ^^^^^^^^^^^^^^ maybe a missing `extern crate extern_prelude;`?

error[E0433]: failed to resolve: maybe a missing `extern crate extern_prelude;`?
--> $DIR/extern-prelude-fail.rs:8:15
|
LL | let s = ::extern_prelude::S;
| ^^^^^^^^^^^^^^ maybe a missing `extern crate extern_prelude;`?

error: aborting due to 2 previous errors

Some errors occurred: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
31 changes: 31 additions & 0 deletions src/test/ui/extern-prelude.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// compile-pass
// compile-flags:--extern extern_prelude --extern Vec
// aux-build:extern-prelude.rs
// aux-build:extern-prelude-vec.rs

fn basic() {
// It works
let s = extern_prelude::S;
s.external();
}

fn shadow_mod() {
// Local module shadows `extern_prelude` from extern prelude
mod extern_prelude {
pub struct S;

impl S {
pub fn internal(&self) {}
}
}

let s = extern_prelude::S;
s.internal(); // OK
}

fn shadow_prelude() {
// Extern prelude shadows standard library prelude
let x = Vec::new(0f32, ()); // OK
}

fn main() {}