Move some tests to subdirectories
This commit is contained in:
parent
0f6f2d681b
commit
4eb9da3b17
139 changed files with 71 additions and 105 deletions
|
@ -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
|
use zed::bar;
|
||||||
mod foo {
|
use zed::baz; //~ ERROR unresolved import `zed::baz` [E0432]
|
||||||
pub fn x(y: isize) { println!("{}", y); }
|
//~| 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 {
|
fn main() {
|
||||||
use foo::x;
|
zed::foo(); //~ ERROR `foo` is private
|
||||||
use foo::x as z;
|
bar();
|
||||||
pub fn thing() { x(10); z(10); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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 baz::zed::bar; //~ ERROR unresolved import `baz::zed` [E0432]
|
||||||
|
//~^ could not find `zed` in `baz`
|
||||||
use zed::bar;
|
|
||||||
|
|
||||||
|
mod baz {}
|
||||||
mod zed {
|
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
|
// error-pattern: unresolved
|
||||||
#![allow(unused_imports)]
|
use main::bar;
|
||||||
|
|
||||||
use baz::zed;
|
fn main() { println!("foo"); }
|
||||||
use baz::zed::bar;
|
|
||||||
|
|
||||||
mod baz {
|
|
||||||
pub mod zed {
|
|
||||||
pub fn bar() { println!("bar2"); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn main() { bar(); }
|
|
||||||
|
|
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 {
|
mod a { pub use b::foo; }
|
||||||
pub fn bar() { println!("bar"); }
|
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…
Add table
Add a link
Reference in a new issue