Auto merge of #79776 - petrochenkov:mvtest, r=Mark-Simulacrum

Move some tests to subdirectories

Mostly tests related to imports.
(A couple of very outdated tests is also deleted.)

Part of https://github.com/rust-lang/rust/issues/73494.
This commit is contained in:
bors 2020-12-07 00:00:00 +00:00
commit f00ace93d0
139 changed files with 71 additions and 105 deletions

View File

@ -1,8 +0,0 @@
// This is testing that users can't access the runtime crate.
mod m {
// The rt has been called both 'native' and 'rt'
use native; //~ ERROR unresolved import
}
fn main() { }

View File

@ -1,9 +0,0 @@
error[E0432]: unresolved import `native`
--> $DIR/hidden-rt-injection.rs:5:9
|
LL | use native;
| ^^^^^^ no `native` in the root
error: aborting due to previous error
For more information about this error, try `rustc --explain E0432`.

View File

@ -1,8 +0,0 @@
// This is testing that users can't access the runtime crate.
mod m {
// The rt has been called both 'native' and 'rt'
use rt; //~ ERROR unresolved import
}
fn main() { }

View File

@ -1,9 +0,0 @@
error[E0432]: unresolved import `rt`
--> $DIR/hidden-rt-injection2.rs:5:9
|
LL | use rt;
| ^^ no `rt` in the root
error: aborting due to previous error
For more information about this error, try `rustc --explain E0432`.

View File

@ -1,17 +0,0 @@
use zed::bar;
use zed::baz; //~ ERROR unresolved import `zed::baz` [E0432]
//~| no `baz` in `zed`
//~| HELP a similar name exists in the module
//~| SUGGESTION bar
mod zed {
pub fn bar() { println!("bar"); }
use foo; //~ ERROR unresolved import `foo` [E0432]
//~^ no `foo` in the root
}
fn main() {
zed::foo(); //~ ERROR `foo` is private
bar();
}

View File

@ -1,10 +0,0 @@
use baz::zed::bar; //~ ERROR unresolved import `baz::zed` [E0432]
//~^ could not find `zed` in `baz`
mod baz {}
mod zed {
pub fn bar() { println!("bar3"); }
}
fn main() {
bar();
}

View File

@ -1,4 +0,0 @@
// error-pattern: unresolved
use main::bar;
fn main() { println!("foo"); }

View File

@ -1,7 +0,0 @@
// error-pattern: import
mod a { pub use b::foo; }
mod b { pub use a::foo; }
fn main() { println!("loop"); }

View File

@ -0,0 +1,12 @@
// run-pass
mod foo {
pub fn x(y: isize) { println!("{}", y); }
}
mod bar {
use foo::x;
use foo::x as z;
pub fn thing() { x(10); z(10); }
}
pub fn main() { bar::thing(); }

View File

@ -1,12 +1,17 @@
// run-pass
mod foo {
pub fn x(y: isize) { println!("{}", y); }
use zed::bar;
use zed::baz; //~ ERROR unresolved import `zed::baz` [E0432]
//~| no `baz` in `zed`
//~| HELP a similar name exists in the module
//~| SUGGESTION bar
mod zed {
pub fn bar() { println!("bar"); }
use foo; //~ ERROR unresolved import `foo` [E0432]
//~^ no `foo` in the root
}
mod bar {
use foo::x;
use foo::x as z;
pub fn thing() { x(10); z(10); }
fn main() {
zed::foo(); //~ ERROR `foo` is private
bar();
}
pub fn main() { bar::thing(); }

View File

@ -0,0 +1,9 @@
// run-pass
use zed::bar;
mod zed {
pub fn bar() { println!("bar"); }
}
pub fn main() { bar(); }

View File

@ -1,9 +1,10 @@
// run-pass
use zed::bar;
use baz::zed::bar; //~ ERROR unresolved import `baz::zed` [E0432]
//~^ could not find `zed` in `baz`
mod baz {}
mod zed {
pub fn bar() { println!("bar"); }
pub fn bar() { println!("bar3"); }
}
fn main() {
bar();
}
pub fn main() { bar(); }

View File

@ -0,0 +1,13 @@
// run-pass
#![allow(unused_imports)]
use baz::zed;
use baz::zed::bar;
mod baz {
pub mod zed {
pub fn bar() { println!("bar2"); }
}
}
pub fn main() { bar(); }

View File

@ -1,13 +1,4 @@
// run-pass
#![allow(unused_imports)]
// error-pattern: unresolved
use main::bar;
use baz::zed;
use baz::zed::bar;
mod baz {
pub mod zed {
pub fn bar() { println!("bar2"); }
}
}
pub fn main() { bar(); }
fn main() { println!("foo"); }

View File

@ -0,0 +1,9 @@
// run-pass
use zed::bar;
mod zed {
pub fn bar() { println!("bar"); }
}
pub fn main() { let _zed = 42; bar(); }

View File

@ -1,9 +1,7 @@
// run-pass
// error-pattern: import
use zed::bar;
mod zed {
pub fn bar() { println!("bar"); }
}
mod a { pub use b::foo; }
mod b { pub use a::foo; }
pub fn main() { let _zed = 42; bar(); }
fn main() { println!("loop"); }

Some files were not shown because too many files have changed in this diff Show More