Rollup merge of #59347 - petrochenkov:nomake, r=davidtwco

Move one test from run-make-fulldeps to ui

The test was written when `--extern` without path didn't exist.
This commit is contained in:
Mazdak Farrokhzad 2019-03-22 19:31:40 +01:00 committed by GitHub
commit 4be19e36d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 57 additions and 50 deletions

View file

@ -1,11 +0,0 @@
-include ../tools.mk
all:
$(RUSTC) ep-lib.rs
$(RUSTC) ep-vec.rs
$(RUSTC) basic.rs --extern ep_lib=$(TMPDIR)/libep_lib.rlib
$(RUSTC) shadow-mod.rs --extern ep_lib=$(TMPDIR)/libep_lib.rlib
$(RUSTC) shadow-prelude.rs --extern Vec=$(TMPDIR)/libep_vec.rlib
$(RUSTC) relative-only.rs --extern ep_lib=$(TMPDIR)/libep_lib.rlib 2>&1 | $(CGREP) "unresolved import"
$(RUSTC) relative-only.rs --extern ep_lib=$(TMPDIR)/libep_lib.rlib 2>&1 | $(CGREP) "failed to resolve"

View file

@ -1,6 +0,0 @@
#![feature(extern_prelude)]
fn main() {
let s = ep_lib::S; // It works
s.external();
}

View file

@ -1,9 +0,0 @@
// Extern prelude names are not available by absolute paths
#![feature(extern_prelude)]
use ep_lib::S;
fn main() {
let s = ::ep_lib::S;
}

View file

@ -1,14 +0,0 @@
// Local module shadows `ep_lib` from extern prelude
mod ep_lib {
pub struct S;
impl S {
pub fn internal(&self) {}
}
}
fn main() {
let s = ep_lib::S;
s.internal(); // OK
}

View file

@ -1,7 +0,0 @@
// Extern prelude shadows standard library prelude
#![feature(extern_prelude)]
fn main() {
let x = Vec::new(0f32, ()); // OK
}

View file

@ -1,3 +1,3 @@
#![crate_type = "rlib"] #![crate_name = "Vec"]
pub fn new(arg1: f32, arg2: ()) {} pub fn new(arg1: f32, arg2: ()) {}

View file

@ -1,5 +1,3 @@
#![crate_type = "rlib"]
pub struct S; pub struct S;
impl S { impl S {

View file

@ -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
}

View file

@ -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`.

View file

@ -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() {}