mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
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:
commit
f00ace93d0
@ -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() { }
|
@ -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`.
|
@ -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() { }
|
@ -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`.
|
@ -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();
|
||||
}
|
@ -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();
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
// error-pattern: unresolved
|
||||
use main::bar;
|
||||
|
||||
fn main() { println!("foo"); }
|
@ -1,7 +0,0 @@
|
||||
// error-pattern: import
|
||||
|
||||
|
||||
mod a { pub use b::foo; }
|
||||
mod b { pub use a::foo; }
|
||||
|
||||
fn main() { println!("loop"); }
|
12
src/test/ui/imports/import-rpass.rs
Normal file
12
src/test/ui/imports/import-rpass.rs
Normal 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(); }
|
@ -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(); }
|
||||
|
9
src/test/ui/imports/import2-rpass.rs
Normal file
9
src/test/ui/imports/import2-rpass.rs
Normal file
@ -0,0 +1,9 @@
|
||||
// run-pass
|
||||
|
||||
use zed::bar;
|
||||
|
||||
mod zed {
|
||||
pub fn bar() { println!("bar"); }
|
||||
}
|
||||
|
||||
pub fn main() { bar(); }
|
@ -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(); }
|
||||
|
13
src/test/ui/imports/import3-rpass.rs
Normal file
13
src/test/ui/imports/import3-rpass.rs
Normal 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(); }
|
@ -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"); }
|
||||
|
9
src/test/ui/imports/import4-rpass.rs
Normal file
9
src/test/ui/imports/import4-rpass.rs
Normal file
@ -0,0 +1,9 @@
|
||||
// run-pass
|
||||
|
||||
use zed::bar;
|
||||
|
||||
mod zed {
|
||||
pub fn bar() { println!("bar"); }
|
||||
}
|
||||
|
||||
pub fn main() { let _zed = 42; bar(); }
|
@ -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
Loading…
Reference in New Issue
Block a user