diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/resolve | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/resolve')
271 files changed, 0 insertions, 7046 deletions
diff --git a/src/test/ui/resolve/associated-fn-called-as-fn.rs b/src/test/ui/resolve/associated-fn-called-as-fn.rs deleted file mode 100644 index f31f3d67b..000000000 --- a/src/test/ui/resolve/associated-fn-called-as-fn.rs +++ /dev/null @@ -1,32 +0,0 @@ -struct S; -impl Foo for S { - fn parse(s:&str) { - for c in s.chars() { - match c { - '0'..='9' => collect_primary(&c), //~ ERROR cannot find function `collect_primary` - //~^ HELP you might have meant to call the associated function - '+' | '-' => println!("We got a sign: {}", c), - _ => println!("Not a number!") - } - } - } -} -trait Foo { - fn collect_primary(ch:&char) { } - fn parse(s:&str); -} -trait Bar { - fn collect_primary(ch:&char) { } - fn parse(s:&str) { - for c in s.chars() { - match c { - '0'..='9' => collect_primary(&c), //~ ERROR cannot find function `collect_primary` - //~^ HELP you might have meant to call the associated function - '+' | '-' => println!("We got a sign: {}", c), - _ => println!("Not a number!") - } - } - } -} - -fn main() {} diff --git a/src/test/ui/resolve/associated-fn-called-as-fn.stderr b/src/test/ui/resolve/associated-fn-called-as-fn.stderr deleted file mode 100644 index fbdea30d5..000000000 --- a/src/test/ui/resolve/associated-fn-called-as-fn.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0425]: cannot find function `collect_primary` in this scope - --> $DIR/associated-fn-called-as-fn.rs:6:30 - | -LL | '0'..='9' => collect_primary(&c), - | ^^^^^^^^^^^^^^^ help: you might have meant to call the associated function: `Self::collect_primary` - -error[E0425]: cannot find function `collect_primary` in this scope - --> $DIR/associated-fn-called-as-fn.rs:23:30 - | -LL | '0'..='9' => collect_primary(&c), - | ^^^^^^^^^^^^^^^ help: you might have meant to call the associated function: `Self::collect_primary` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo.rs b/src/test/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo.rs deleted file mode 100644 index cf769f31b..000000000 --- a/src/test/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo.rs +++ /dev/null @@ -1,3 +0,0 @@ -#![crate_type="lib"] - -pub const X: () = (); diff --git a/src/test/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo2.rs b/src/test/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo2.rs deleted file mode 100644 index 81c16ede9..000000000 --- a/src/test/ui/resolve/auxiliary/blind-item-mixed-crate-use-item-foo2.rs +++ /dev/null @@ -1,3 +0,0 @@ -#![crate_type="lib"] - -pub const Y: () = (); diff --git a/src/test/ui/resolve/auxiliary/extern-prelude-vec.rs b/src/test/ui/resolve/auxiliary/extern-prelude-vec.rs deleted file mode 100644 index a643c8889..000000000 --- a/src/test/ui/resolve/auxiliary/extern-prelude-vec.rs +++ /dev/null @@ -1,3 +0,0 @@ -#![crate_name = "Vec"] - -pub fn new(arg1: f32, arg2: ()) {} diff --git a/src/test/ui/resolve/auxiliary/extern-prelude.rs b/src/test/ui/resolve/auxiliary/extern-prelude.rs deleted file mode 100644 index 2fdfd85a1..000000000 --- a/src/test/ui/resolve/auxiliary/extern-prelude.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub struct S; - -impl S { - pub fn external(&self) {} -} diff --git a/src/test/ui/resolve/auxiliary/issue-19452-aux.rs b/src/test/ui/resolve/auxiliary/issue-19452-aux.rs deleted file mode 100644 index 9c7bcec51..000000000 --- a/src/test/ui/resolve/auxiliary/issue-19452-aux.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub enum Homura { - Madoka { age: u32 } -} diff --git a/src/test/ui/resolve/auxiliary/issue-21221-3.rs b/src/test/ui/resolve/auxiliary/issue-21221-3.rs deleted file mode 100644 index 176c23180..000000000 --- a/src/test/ui/resolve/auxiliary/issue-21221-3.rs +++ /dev/null @@ -1,19 +0,0 @@ -// testing whether the lookup mechanism picks up types -// defined in the outside crate - -#![crate_type="lib"] - -pub mod outer { - // should suggest this - pub trait OuterTrait {} - - // should not suggest this since the module is private - mod private_module { - pub trait OuterTrait {} - } - - // should not suggest since the trait is private - pub mod public_module { - trait OuterTrait {} - } -} diff --git a/src/test/ui/resolve/auxiliary/issue-21221-4.rs b/src/test/ui/resolve/auxiliary/issue-21221-4.rs deleted file mode 100644 index 5e0d6cbdf..000000000 --- a/src/test/ui/resolve/auxiliary/issue-21221-4.rs +++ /dev/null @@ -1,12 +0,0 @@ -// testing whether the lookup mechanism picks up types -// defined in the outside crate - -#![crate_type="lib"] - -mod foo { - // should not be suggested => foo is private - pub trait T {} -} - -// should be suggested -pub use foo::T; diff --git a/src/test/ui/resolve/auxiliary/issue-3907.rs b/src/test/ui/resolve/auxiliary/issue-3907.rs deleted file mode 100644 index 5dc502930..000000000 --- a/src/test/ui/resolve/auxiliary/issue-3907.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub trait Foo { - fn bar(); -} diff --git a/src/test/ui/resolve/auxiliary/issue-80079.rs b/src/test/ui/resolve/auxiliary/issue-80079.rs deleted file mode 100644 index 190ca75ab..000000000 --- a/src/test/ui/resolve/auxiliary/issue-80079.rs +++ /dev/null @@ -1,18 +0,0 @@ -#![crate_type = "lib"] - -pub mod public { - use private_import; - - // should not be suggested since it is private - struct Foo; - - mod private_module { - // should not be suggested since it is private - pub struct Foo; - } -} - -mod private_import { - // should not be suggested since it is private - pub struct Foo; -} diff --git a/src/test/ui/resolve/auxiliary/namespaced_enums.rs b/src/test/ui/resolve/auxiliary/namespaced_enums.rs deleted file mode 100644 index d3548c76c..000000000 --- a/src/test/ui/resolve/auxiliary/namespaced_enums.rs +++ /dev/null @@ -1,10 +0,0 @@ -pub enum Foo { - A, - B(isize), - C { a: isize }, -} - -impl Foo { - pub fn foo() {} - pub fn bar(&self) {} -} diff --git a/src/test/ui/resolve/auxiliary/privacy-struct-ctor.rs b/src/test/ui/resolve/auxiliary/privacy-struct-ctor.rs deleted file mode 100644 index 6d0bc7285..000000000 --- a/src/test/ui/resolve/auxiliary/privacy-struct-ctor.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub mod m { - pub struct S(u8); - - pub mod n { - pub(in m) struct Z(pub(in m::n) u8); - } -} - -pub use m::S; diff --git a/src/test/ui/resolve/bad-env-capture.rs b/src/test/ui/resolve/bad-env-capture.rs deleted file mode 100644 index 83fd2544f..000000000 --- a/src/test/ui/resolve/bad-env-capture.rs +++ /dev/null @@ -1,6 +0,0 @@ -// error-pattern: can't capture dynamic environment in a fn item -fn foo() { - let x: isize; - fn bar() { log(debug, x); } -} -fn main() { foo(); } diff --git a/src/test/ui/resolve/bad-env-capture.stderr b/src/test/ui/resolve/bad-env-capture.stderr deleted file mode 100644 index 59b1fabfd..000000000 --- a/src/test/ui/resolve/bad-env-capture.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error[E0434]: can't capture dynamic environment in a fn item - --> $DIR/bad-env-capture.rs:4:27 - | -LL | fn bar() { log(debug, x); } - | ^ - | - = help: use the `|| { ... }` closure form instead - -error[E0425]: cannot find value `debug` in this scope - --> $DIR/bad-env-capture.rs:4:20 - | -LL | fn bar() { log(debug, x); } - | ^^^^^ not found in this scope - -error[E0425]: cannot find function `log` in this scope - --> $DIR/bad-env-capture.rs:4:16 - | -LL | fn bar() { log(debug, x); } - | ^^^ not found in this scope - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0425, E0434. -For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/bad-env-capture2.rs b/src/test/ui/resolve/bad-env-capture2.rs deleted file mode 100644 index b04569c9d..000000000 --- a/src/test/ui/resolve/bad-env-capture2.rs +++ /dev/null @@ -1,5 +0,0 @@ -// error-pattern: can't capture dynamic environment in a fn item -fn foo(x: isize) { - fn bar() { log(debug, x); } -} -fn main() { foo(2); } diff --git a/src/test/ui/resolve/bad-env-capture2.stderr b/src/test/ui/resolve/bad-env-capture2.stderr deleted file mode 100644 index 811c259de..000000000 --- a/src/test/ui/resolve/bad-env-capture2.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error[E0434]: can't capture dynamic environment in a fn item - --> $DIR/bad-env-capture2.rs:3:27 - | -LL | fn bar() { log(debug, x); } - | ^ - | - = help: use the `|| { ... }` closure form instead - -error[E0425]: cannot find value `debug` in this scope - --> $DIR/bad-env-capture2.rs:3:20 - | -LL | fn bar() { log(debug, x); } - | ^^^^^ not found in this scope - -error[E0425]: cannot find function `log` in this scope - --> $DIR/bad-env-capture2.rs:3:16 - | -LL | fn bar() { log(debug, x); } - | ^^^ not found in this scope - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0425, E0434. -For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/bad-env-capture3.rs b/src/test/ui/resolve/bad-env-capture3.rs deleted file mode 100644 index 62f12fd1a..000000000 --- a/src/test/ui/resolve/bad-env-capture3.rs +++ /dev/null @@ -1,8 +0,0 @@ -// error-pattern: can't capture dynamic environment in a fn item -fn foo(x: isize) { - fn mth() { - fn bar() { log(debug, x); } - } -} - -fn main() { foo(2); } diff --git a/src/test/ui/resolve/bad-env-capture3.stderr b/src/test/ui/resolve/bad-env-capture3.stderr deleted file mode 100644 index eab37fde9..000000000 --- a/src/test/ui/resolve/bad-env-capture3.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error[E0434]: can't capture dynamic environment in a fn item - --> $DIR/bad-env-capture3.rs:4:31 - | -LL | fn bar() { log(debug, x); } - | ^ - | - = help: use the `|| { ... }` closure form instead - -error[E0425]: cannot find value `debug` in this scope - --> $DIR/bad-env-capture3.rs:4:24 - | -LL | fn bar() { log(debug, x); } - | ^^^^^ not found in this scope - -error[E0425]: cannot find function `log` in this scope - --> $DIR/bad-env-capture3.rs:4:20 - | -LL | fn bar() { log(debug, x); } - | ^^^ not found in this scope - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0425, E0434. -For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/bad-expr-path.rs b/src/test/ui/resolve/bad-expr-path.rs deleted file mode 100644 index 31fc9cf2c..000000000 --- a/src/test/ui/resolve/bad-expr-path.rs +++ /dev/null @@ -1,8 +0,0 @@ -mod m1 {} - -fn main(arguments: Vec<String>) { //~ ERROR `main` function has wrong type - log(debug, m1::arguments); - //~^ ERROR cannot find function `log` in this scope - //~| ERROR cannot find value `debug` in this scope - //~| ERROR cannot find value `arguments` in module `m1` -} diff --git a/src/test/ui/resolve/bad-expr-path.stderr b/src/test/ui/resolve/bad-expr-path.stderr deleted file mode 100644 index 8261e8e53..000000000 --- a/src/test/ui/resolve/bad-expr-path.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error[E0425]: cannot find value `debug` in this scope - --> $DIR/bad-expr-path.rs:4:9 - | -LL | log(debug, m1::arguments); - | ^^^^^ not found in this scope - -error[E0425]: cannot find value `arguments` in module `m1` - --> $DIR/bad-expr-path.rs:4:20 - | -LL | log(debug, m1::arguments); - | ^^^^^^^^^ not found in `m1` - -error[E0425]: cannot find function `log` in this scope - --> $DIR/bad-expr-path.rs:4:5 - | -LL | log(debug, m1::arguments); - | ^^^ not found in this scope - -error[E0580]: `main` function has wrong type - --> $DIR/bad-expr-path.rs:3:1 - | -LL | fn main(arguments: Vec<String>) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters - | - = note: expected fn pointer `fn()` - found fn pointer `fn(Vec<String>)` - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0425, E0580. -For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/bad-expr-path2.rs b/src/test/ui/resolve/bad-expr-path2.rs deleted file mode 100644 index eb88edb90..000000000 --- a/src/test/ui/resolve/bad-expr-path2.rs +++ /dev/null @@ -1,10 +0,0 @@ -mod m1 { - pub mod arguments {} -} - -fn main(arguments: Vec<String>) { //~ ERROR `main` function has wrong type - log(debug, m1::arguments); - //~^ ERROR cannot find function `log` in this scope - //~| ERROR cannot find value `debug` in this scope - //~| ERROR expected value, found module `m1::arguments` -} diff --git a/src/test/ui/resolve/bad-expr-path2.stderr b/src/test/ui/resolve/bad-expr-path2.stderr deleted file mode 100644 index 6e11296d9..000000000 --- a/src/test/ui/resolve/bad-expr-path2.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error[E0425]: cannot find value `debug` in this scope - --> $DIR/bad-expr-path2.rs:6:9 - | -LL | log(debug, m1::arguments); - | ^^^^^ not found in this scope - -error[E0423]: expected value, found module `m1::arguments` - --> $DIR/bad-expr-path2.rs:6:16 - | -LL | log(debug, m1::arguments); - | ^^^^^^^^^^^^^ not a value - -error[E0425]: cannot find function `log` in this scope - --> $DIR/bad-expr-path2.rs:6:5 - | -LL | log(debug, m1::arguments); - | ^^^ not found in this scope - -error[E0580]: `main` function has wrong type - --> $DIR/bad-expr-path2.rs:5:1 - | -LL | fn main(arguments: Vec<String>) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters - | - = note: expected fn pointer `fn()` - found fn pointer `fn(Vec<String>)` - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0423, E0425, E0580. -For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/ui/resolve/bad-module.rs b/src/test/ui/resolve/bad-module.rs deleted file mode 100644 index b23e97c2c..000000000 --- a/src/test/ui/resolve/bad-module.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - let foo = thing::len(Vec::new()); - //~^ ERROR failed to resolve: use of undeclared crate or module `thing` - - let foo = foo::bar::baz(); - //~^ ERROR failed to resolve: use of undeclared crate or module `foo` -} diff --git a/src/test/ui/resolve/bad-module.stderr b/src/test/ui/resolve/bad-module.stderr deleted file mode 100644 index 558760c67..000000000 --- a/src/test/ui/resolve/bad-module.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `foo` - --> $DIR/bad-module.rs:5:15 - | -LL | let foo = foo::bar::baz(); - | ^^^ use of undeclared crate or module `foo` - -error[E0433]: failed to resolve: use of undeclared crate or module `thing` - --> $DIR/bad-module.rs:2:15 - | -LL | let foo = thing::len(Vec::new()); - | ^^^^^ use of undeclared crate or module `thing` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/resolve/bad-type-env-capture.rs b/src/test/ui/resolve/bad-type-env-capture.rs deleted file mode 100644 index 53dfb1313..000000000 --- a/src/test/ui/resolve/bad-type-env-capture.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn foo<T>() { - fn bar(b: T) { } //~ ERROR can't use generic parameters from outer -} -fn main() { } diff --git a/src/test/ui/resolve/bad-type-env-capture.stderr b/src/test/ui/resolve/bad-type-env-capture.stderr deleted file mode 100644 index b6282c2d0..000000000 --- a/src/test/ui/resolve/bad-type-env-capture.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0401]: can't use generic parameters from outer function - --> $DIR/bad-type-env-capture.rs:2:15 - | -LL | fn foo<T>() { - | - type parameter from outer function -LL | fn bar(b: T) { } - | - ^ use of generic parameter from outer function - | | - | help: try using a local generic parameter instead: `<T>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/resolve/blind-item-local-shadow.rs b/src/test/ui/resolve/blind-item-local-shadow.rs deleted file mode 100644 index 942aeb6fd..000000000 --- a/src/test/ui/resolve/blind-item-local-shadow.rs +++ /dev/null @@ -1,13 +0,0 @@ -// run-pass - -#![allow(dead_code)] -#![allow(unused_imports)] -mod bar { - pub fn foo() -> bool { true } -} - -fn main() { - let foo = || false; - use bar::foo; - assert_eq!(foo(), false); -} diff --git a/src/test/ui/resolve/blind-item-mixed-crate-use-item.rs b/src/test/ui/resolve/blind-item-mixed-crate-use-item.rs deleted file mode 100644 index 36d8ab151..000000000 --- a/src/test/ui/resolve/blind-item-mixed-crate-use-item.rs +++ /dev/null @@ -1,26 +0,0 @@ -// run-pass -// aux-build:blind-item-mixed-crate-use-item-foo.rs -// aux-build:blind-item-mixed-crate-use-item-foo2.rs - -// pretty-expanded FIXME #23616 - -mod m { - pub fn f<T>(_: T, _: (), _: ()) { } - pub fn g<T>(_: T, _: (), _: ()) { } -} - -const BAR: () = (); -struct Data; -use m::f; -extern crate blind_item_mixed_crate_use_item_foo as foo; - -fn main() { - const BAR2: () = (); - struct Data2; - use m::g; - - extern crate blind_item_mixed_crate_use_item_foo2 as foo2; - - f(Data, BAR, foo::X); - g(Data2, BAR2, foo2::Y); -} diff --git a/src/test/ui/resolve/blind-item-mixed-use-item.rs b/src/test/ui/resolve/blind-item-mixed-use-item.rs deleted file mode 100644 index 4a3905496..000000000 --- a/src/test/ui/resolve/blind-item-mixed-use-item.rs +++ /dev/null @@ -1,20 +0,0 @@ -// run-pass -// pretty-expanded FIXME #23616 - -mod m { - pub fn f<T>(_: T, _: ()) { } - pub fn g<T>(_: T, _: ()) { } -} - -const BAR: () = (); -struct Data; -use m::f; - -fn main() { - const BAR2: () = (); - struct Data2; - use m::g; - - f(Data, BAR); - g(Data2, BAR2); -} diff --git a/src/test/ui/resolve/block-with-trait-parent.rs b/src/test/ui/resolve/block-with-trait-parent.rs deleted file mode 100644 index bc86f94e9..000000000 --- a/src/test/ui/resolve/block-with-trait-parent.rs +++ /dev/null @@ -1,14 +0,0 @@ -// check-pass - -trait Trait { - fn method(&self) { - // Items inside a block turn it into a module internally. - struct S; - impl Trait for S {} - - // OK, `Trait` is in scope here from method resolution point of view. - S.method(); - } -} - -fn main() {} diff --git a/src/test/ui/resolve/crate-called-as-function.rs b/src/test/ui/resolve/crate-called-as-function.rs deleted file mode 100644 index e8f52c0c0..000000000 --- a/src/test/ui/resolve/crate-called-as-function.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - ::foo() //~ cannot find external crate `foo` in the crate root -} diff --git a/src/test/ui/resolve/crate-called-as-function.stderr b/src/test/ui/resolve/crate-called-as-function.stderr deleted file mode 100644 index eb42349af..000000000 --- a/src/test/ui/resolve/crate-called-as-function.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0425]: cannot find external crate `foo` in the crate root - --> $DIR/crate-called-as-function.rs:2:7 - | -LL | ::foo() - | ^^^ not found in the crate root - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/crate-in-paths.rs b/src/test/ui/resolve/crate-in-paths.rs deleted file mode 100644 index 7ebd25918..000000000 --- a/src/test/ui/resolve/crate-in-paths.rs +++ /dev/null @@ -1,10 +0,0 @@ -// edition:2018 - -mod bar { - pub(crate) struct Foo; -} - -fn main() { - Foo; - //~^ ERROR cannot find value `Foo` in this scope [E0425] -} diff --git a/src/test/ui/resolve/crate-in-paths.stderr b/src/test/ui/resolve/crate-in-paths.stderr deleted file mode 100644 index b7cf49507..000000000 --- a/src/test/ui/resolve/crate-in-paths.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0425]: cannot find value `Foo` in this scope - --> $DIR/crate-in-paths.rs:8:5 - | -LL | Foo; - | ^^^ not found in this scope - | -help: consider importing this unit struct - | -LL | use crate::bar::Foo; - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/editions-crate-root-2015.rs b/src/test/ui/resolve/editions-crate-root-2015.rs deleted file mode 100644 index 4c890e3ae..000000000 --- a/src/test/ui/resolve/editions-crate-root-2015.rs +++ /dev/null @@ -1,21 +0,0 @@ -// edition:2015 - -mod inner { - fn global_inner(_: ::nonexistant::Foo) { - //~^ ERROR failed to resolve: maybe a missing crate `nonexistant`? - } - fn crate_inner(_: crate::nonexistant::Foo) { - //~^ ERROR failed to resolve: maybe a missing crate `nonexistant`? - } - - fn bare_global(_: ::nonexistant) { - //~^ ERROR cannot find type `nonexistant` in the crate root - } - fn bare_crate(_: crate::nonexistant) { - //~^ ERROR cannot find type `nonexistant` in the crate root - } -} - -fn main() { - -} diff --git a/src/test/ui/resolve/editions-crate-root-2015.stderr b/src/test/ui/resolve/editions-crate-root-2015.stderr deleted file mode 100644 index 00cdd0c58..000000000 --- a/src/test/ui/resolve/editions-crate-root-2015.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error[E0433]: failed to resolve: maybe a missing crate `nonexistant`? - --> $DIR/editions-crate-root-2015.rs:4:26 - | -LL | fn global_inner(_: ::nonexistant::Foo) { - | ^^^^^^^^^^^ maybe a missing crate `nonexistant`? - | - = help: consider adding `extern crate nonexistant` to use the `nonexistant` crate - -error[E0433]: failed to resolve: maybe a missing crate `nonexistant`? - --> $DIR/editions-crate-root-2015.rs:7:30 - | -LL | fn crate_inner(_: crate::nonexistant::Foo) { - | ^^^^^^^^^^^ maybe a missing crate `nonexistant`? - | - = help: consider adding `extern crate nonexistant` to use the `nonexistant` crate - -error[E0412]: cannot find type `nonexistant` in the crate root - --> $DIR/editions-crate-root-2015.rs:11:25 - | -LL | fn bare_global(_: ::nonexistant) { - | ^^^^^^^^^^^ not found in the crate root - -error[E0412]: cannot find type `nonexistant` in the crate root - --> $DIR/editions-crate-root-2015.rs:14:29 - | -LL | fn bare_crate(_: crate::nonexistant) { - | ^^^^^^^^^^^ not found in the crate root - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0412, E0433. -For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/ui/resolve/editions-crate-root-2018.rs b/src/test/ui/resolve/editions-crate-root-2018.rs deleted file mode 100644 index 61e4329bb..000000000 --- a/src/test/ui/resolve/editions-crate-root-2018.rs +++ /dev/null @@ -1,21 +0,0 @@ -// edition:2018 - -mod inner { - fn global_inner(_: ::nonexistant::Foo) { - //~^ ERROR failed to resolve: could not find `nonexistant` in the list of imported crates - } - fn crate_inner(_: crate::nonexistant::Foo) { - //~^ ERROR failed to resolve: could not find `nonexistant` in the crate root - } - - fn bare_global(_: ::nonexistant) { - //~^ ERROR cannot find crate `nonexistant` in the list of imported crates - } - fn bare_crate(_: crate::nonexistant) { - //~^ ERROR cannot find type `nonexistant` in the crate root - } -} - -fn main() { - -} diff --git a/src/test/ui/resolve/editions-crate-root-2018.stderr b/src/test/ui/resolve/editions-crate-root-2018.stderr deleted file mode 100644 index 967a5a2fc..000000000 --- a/src/test/ui/resolve/editions-crate-root-2018.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error[E0433]: failed to resolve: could not find `nonexistant` in the list of imported crates - --> $DIR/editions-crate-root-2018.rs:4:26 - | -LL | fn global_inner(_: ::nonexistant::Foo) { - | ^^^^^^^^^^^ could not find `nonexistant` in the list of imported crates - -error[E0433]: failed to resolve: could not find `nonexistant` in the crate root - --> $DIR/editions-crate-root-2018.rs:7:30 - | -LL | fn crate_inner(_: crate::nonexistant::Foo) { - | ^^^^^^^^^^^ could not find `nonexistant` in the crate root - -error[E0412]: cannot find crate `nonexistant` in the list of imported crates - --> $DIR/editions-crate-root-2018.rs:11:25 - | -LL | fn bare_global(_: ::nonexistant) { - | ^^^^^^^^^^^ not found in the list of imported crates - -error[E0412]: cannot find type `nonexistant` in the crate root - --> $DIR/editions-crate-root-2018.rs:14:29 - | -LL | fn bare_crate(_: crate::nonexistant) { - | ^^^^^^^^^^^ not found in the crate root - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0412, E0433. -For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/ui/resolve/enums-are-namespaced-xc.rs b/src/test/ui/resolve/enums-are-namespaced-xc.rs deleted file mode 100644 index dfc16d6ce..000000000 --- a/src/test/ui/resolve/enums-are-namespaced-xc.rs +++ /dev/null @@ -1,11 +0,0 @@ -// aux-build:namespaced_enums.rs -extern crate namespaced_enums; - -fn main() { - let _ = namespaced_enums::A; - //~^ ERROR cannot find value `A` - let _ = namespaced_enums::B(10); - //~^ ERROR cannot find function, tuple struct or tuple variant `B` - let _ = namespaced_enums::C { a: 10 }; - //~^ ERROR cannot find struct, variant or union type `C` -} diff --git a/src/test/ui/resolve/enums-are-namespaced-xc.stderr b/src/test/ui/resolve/enums-are-namespaced-xc.stderr deleted file mode 100644 index 6448e596d..000000000 --- a/src/test/ui/resolve/enums-are-namespaced-xc.stderr +++ /dev/null @@ -1,52 +0,0 @@ -error[E0425]: cannot find value `A` in crate `namespaced_enums` - --> $DIR/enums-are-namespaced-xc.rs:5:31 - | -LL | let _ = namespaced_enums::A; - | ^ not found in `namespaced_enums` - | -help: consider importing this unit variant - | -LL | use namespaced_enums::Foo::A; - | -help: if you import `A`, refer to it directly - | -LL - let _ = namespaced_enums::A; -LL + let _ = A; - | - -error[E0425]: cannot find function, tuple struct or tuple variant `B` in crate `namespaced_enums` - --> $DIR/enums-are-namespaced-xc.rs:7:31 - | -LL | let _ = namespaced_enums::B(10); - | ^ not found in `namespaced_enums` - | -help: consider importing this tuple variant - | -LL | use namespaced_enums::Foo::B; - | -help: if you import `B`, refer to it directly - | -LL - let _ = namespaced_enums::B(10); -LL + let _ = B(10); - | - -error[E0422]: cannot find struct, variant or union type `C` in crate `namespaced_enums` - --> $DIR/enums-are-namespaced-xc.rs:9:31 - | -LL | let _ = namespaced_enums::C { a: 10 }; - | ^ not found in `namespaced_enums` - | -help: consider importing this variant - | -LL | use namespaced_enums::Foo::C; - | -help: if you import `C`, refer to it directly - | -LL - let _ = namespaced_enums::C { a: 10 }; -LL + let _ = C { a: 10 }; - | - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0422, E0425. -For more information about an error, try `rustc --explain E0422`. diff --git a/src/test/ui/resolve/enums-pats-not-idents.rs b/src/test/ui/resolve/enums-pats-not-idents.rs deleted file mode 100644 index 5b918eef6..000000000 --- a/src/test/ui/resolve/enums-pats-not-idents.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - let a(1) = 13; //~ ERROR cannot find tuple struct or tuple variant `a` in this scope -} diff --git a/src/test/ui/resolve/enums-pats-not-idents.stderr b/src/test/ui/resolve/enums-pats-not-idents.stderr deleted file mode 100644 index 072b88716..000000000 --- a/src/test/ui/resolve/enums-pats-not-idents.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0531]: cannot find tuple struct or tuple variant `a` in this scope - --> $DIR/enums-pats-not-idents.rs:2:9 - | -LL | let a(1) = 13; - | ^ not found in this scope - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0531`. diff --git a/src/test/ui/resolve/export-fully-qualified.rs b/src/test/ui/resolve/export-fully-qualified.rs deleted file mode 100644 index 4e73a2c54..000000000 --- a/src/test/ui/resolve/export-fully-qualified.rs +++ /dev/null @@ -1,11 +0,0 @@ -// In this test baz isn't resolved when called as foo.baz even though -// it's called from inside foo. This is somewhat surprising and may -// want to change eventually. - -mod foo { - pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared crate or module `foo` - - fn baz() { } -} - -fn main() { } diff --git a/src/test/ui/resolve/export-fully-qualified.stderr b/src/test/ui/resolve/export-fully-qualified.stderr deleted file mode 100644 index 7ee352e12..000000000 --- a/src/test/ui/resolve/export-fully-qualified.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `foo` - --> $DIR/export-fully-qualified.rs:6:20 - | -LL | pub fn bar() { foo::baz(); } - | ^^^ use of undeclared crate or module `foo` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/resolve/extern-prelude-fail.rs b/src/test/ui/resolve/extern-prelude-fail.rs deleted file mode 100644 index 7d387025a..000000000 --- a/src/test/ui/resolve/extern-prelude-fail.rs +++ /dev/null @@ -1,9 +0,0 @@ -// 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 -} diff --git a/src/test/ui/resolve/extern-prelude-fail.stderr b/src/test/ui/resolve/extern-prelude-fail.stderr deleted file mode 100644 index a1591914b..000000000 --- a/src/test/ui/resolve/extern-prelude-fail.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0432]: unresolved import `extern_prelude` - --> $DIR/extern-prelude-fail.rs:7:9 - | -LL | use extern_prelude::S; - | ^^^^^^^^^^^^^^ maybe a missing crate `extern_prelude`? - | - = help: consider adding `extern crate extern_prelude` to use the `extern_prelude` crate - -error[E0433]: failed to resolve: maybe a missing crate `extern_prelude`? - --> $DIR/extern-prelude-fail.rs:8:15 - | -LL | let s = ::extern_prelude::S; - | ^^^^^^^^^^^^^^ maybe a missing crate `extern_prelude`? - | - = help: consider adding `extern crate extern_prelude` to use the `extern_prelude` crate - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0432, E0433. -For more information about an error, try `rustc --explain E0432`. diff --git a/src/test/ui/resolve/extern-prelude.rs b/src/test/ui/resolve/extern-prelude.rs deleted file mode 100644 index 50fed6034..000000000 --- a/src/test/ui/resolve/extern-prelude.rs +++ /dev/null @@ -1,31 +0,0 @@ -// build-pass (FIXME(62277): could be check-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() {} diff --git a/src/test/ui/resolve/filter-intrinsics.rs b/src/test/ui/resolve/filter-intrinsics.rs deleted file mode 100644 index c0956ef85..000000000 --- a/src/test/ui/resolve/filter-intrinsics.rs +++ /dev/null @@ -1,10 +0,0 @@ -fn main() { - // Should suggest only `std::mem::size_of` - let _ = size_of::<usize>(); - //~^ ERROR cannot find - - // Should suggest `std::intrinsics::fabsf64`, - // since there is no non-intrinsic to suggest. - let _ = fabsf64(1.0); - //~^ ERROR cannot find -} diff --git a/src/test/ui/resolve/filter-intrinsics.stderr b/src/test/ui/resolve/filter-intrinsics.stderr deleted file mode 100644 index 955070891..000000000 --- a/src/test/ui/resolve/filter-intrinsics.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0425]: cannot find function `size_of` in this scope - --> $DIR/filter-intrinsics.rs:3:13 - | -LL | let _ = size_of::<usize>(); - | ^^^^^^^ not found in this scope - | -help: consider importing this function - | -LL | use std::mem::size_of; - | - -error[E0425]: cannot find function `fabsf64` in this scope - --> $DIR/filter-intrinsics.rs:8:13 - | -LL | let _ = fabsf64(1.0); - | ^^^^^^^ not found in this scope - | -help: consider importing this function - | -LL | use std::intrinsics::fabsf64; - | - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/impl-items-vis-unresolved.rs b/src/test/ui/resolve/impl-items-vis-unresolved.rs deleted file mode 100644 index 1494c1cf9..000000000 --- a/src/test/ui/resolve/impl-items-vis-unresolved.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Visibilities on impl items expanded from macros are resolved (issue #64705). - -macro_rules! perftools_inline { - ($($item:tt)*) => ( - $($item)* - ); -} - -mod state { - pub struct RawFloatState; - impl RawFloatState { - perftools_inline! { - pub(super) fn new() {} // OK - } - } -} - -pub struct RawFloatState; -impl RawFloatState { - perftools_inline! { - pub(super) fn new() {} - //~^ ERROR failed to resolve: there are too many leading `super` keywords - } -} - -fn main() {} diff --git a/src/test/ui/resolve/impl-items-vis-unresolved.stderr b/src/test/ui/resolve/impl-items-vis-unresolved.stderr deleted file mode 100644 index f2293d28e..000000000 --- a/src/test/ui/resolve/impl-items-vis-unresolved.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0433]: failed to resolve: there are too many leading `super` keywords - --> $DIR/impl-items-vis-unresolved.rs:21:13 - | -LL | pub(super) fn new() {} - | ^^^^^ there are too many leading `super` keywords - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/resolve/issue-100365.rs b/src/test/ui/resolve/issue-100365.rs deleted file mode 100644 index 1d8835036..000000000 --- a/src/test/ui/resolve/issue-100365.rs +++ /dev/null @@ -1,50 +0,0 @@ -fn main() { - let addr = Into::<std::net::IpAddr>.into([127, 0, 0, 1]); - //~^ ERROR expected value, found trait `Into` - //~| HELP use the path separator - - let _ = Into.into(()); - //~^ ERROR expected value, found trait `Into` - //~| HELP use the path separator - - let _ = Into::<()>.into; - //~^ ERROR expected value, found trait `Into` - //~| HELP use the path separator -} - -macro_rules! Trait { - () => { - ::std::iter::Iterator - //~^ ERROR expected value, found trait `std::iter::Iterator` - //~| ERROR expected value, found trait `std::iter::Iterator` - }; -} - -macro_rules! create { - () => { - Into::<String>.into("") - //~^ ERROR expected value, found trait `Into` - //~| HELP use the path separator - }; -} - -fn interaction_with_macros() { - // - // Note that if the receiver is a macro call, we do not want to suggest to replace - // `.` with `::` as that would be a syntax error. - // Since the receiver is a trait and not a type, we cannot suggest to surround - // it with angle brackets. It would be interpreted as a trait object type void of - // `dyn` which is most likely not what the user intended to write. - // `<_ as Trait!()>::` is also not an option as it's equally syntactically invalid. - // - - Trait!().map(std::convert::identity); // no `help` here! - - Trait!().map; // no `help` here! - - // - // Ensure that the suggestion is shown for expressions inside of macro definitions. - // - - let _ = create!(); -} diff --git a/src/test/ui/resolve/issue-100365.stderr b/src/test/ui/resolve/issue-100365.stderr deleted file mode 100644 index 372d77266..000000000 --- a/src/test/ui/resolve/issue-100365.stderr +++ /dev/null @@ -1,54 +0,0 @@ -error[E0423]: expected value, found trait `Into` - --> $DIR/issue-100365.rs:2:16 - | -LL | let addr = Into::<std::net::IpAddr>.into([127, 0, 0, 1]); - | ^^^^^^^^^^^^^^^^^^^^^^^^- help: use the path separator to refer to an item: `::` - -error[E0423]: expected value, found trait `Into` - --> $DIR/issue-100365.rs:6:13 - | -LL | let _ = Into.into(()); - | ^^^^- help: use the path separator to refer to an item: `::` - -error[E0423]: expected value, found trait `Into` - --> $DIR/issue-100365.rs:10:13 - | -LL | let _ = Into::<()>.into; - | ^^^^^^^^^^- help: use the path separator to refer to an item: `::` - -error[E0423]: expected value, found trait `std::iter::Iterator` - --> $DIR/issue-100365.rs:17:9 - | -LL | ::std::iter::Iterator - | ^^^^^^^^^^^^^^^^^^^^^ not a value -... -LL | Trait!().map(std::convert::identity); // no `help` here! - | -------- in this macro invocation - | - = note: this error originates in the macro `Trait` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0423]: expected value, found trait `std::iter::Iterator` - --> $DIR/issue-100365.rs:17:9 - | -LL | ::std::iter::Iterator - | ^^^^^^^^^^^^^^^^^^^^^ not a value -... -LL | Trait!().map; // no `help` here! - | -------- in this macro invocation - | - = note: this error originates in the macro `Trait` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0423]: expected value, found trait `Into` - --> $DIR/issue-100365.rs:25:9 - | -LL | Into::<String>.into("") - | ^^^^^^^^^^^^^^- help: use the path separator to refer to an item: `::` -... -LL | let _ = create!(); - | --------- in this macro invocation - | - = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 6 previous errors - -For more information about this error, try `rustc --explain E0423`. diff --git a/src/test/ui/resolve/issue-101749-2.rs b/src/test/ui/resolve/issue-101749-2.rs deleted file mode 100644 index 4d3d46944..000000000 --- a/src/test/ui/resolve/issue-101749-2.rs +++ /dev/null @@ -1,16 +0,0 @@ -struct Rectangle { - width: i32, - height: i32, -} -impl Rectangle { - fn new(width: i32, height: i32) -> Self { - Self { width, height } - } -} - -fn main() { - let rect = Rectangle::new(3, 4); - // `area` is not implemented for `Rectangle`, so this should not suggest - let _ = rect::area(); - //~^ ERROR failed to resolve: use of undeclared crate or module `rect` -} diff --git a/src/test/ui/resolve/issue-101749-2.stderr b/src/test/ui/resolve/issue-101749-2.stderr deleted file mode 100644 index 370d4b145..000000000 --- a/src/test/ui/resolve/issue-101749-2.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `rect` - --> $DIR/issue-101749-2.rs:14:13 - | -LL | let _ = rect::area(); - | ^^^^ use of undeclared crate or module `rect` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/resolve/issue-101749.fixed b/src/test/ui/resolve/issue-101749.fixed deleted file mode 100644 index 3e5544296..000000000 --- a/src/test/ui/resolve/issue-101749.fixed +++ /dev/null @@ -1,19 +0,0 @@ -// run-rustfix -struct Rectangle { - width: i32, - height: i32, -} -impl Rectangle { - fn new(width: i32, height: i32) -> Self { - Self { width, height } - } - fn area(&self) -> i32 { - self.height * self.width - } -} - -fn main() { - let rect = Rectangle::new(3, 4); - let _ = rect.area(); - //~^ ERROR failed to resolve: use of undeclared crate or module `rect` -} diff --git a/src/test/ui/resolve/issue-101749.rs b/src/test/ui/resolve/issue-101749.rs deleted file mode 100644 index fd67ccab6..000000000 --- a/src/test/ui/resolve/issue-101749.rs +++ /dev/null @@ -1,19 +0,0 @@ -// run-rustfix -struct Rectangle { - width: i32, - height: i32, -} -impl Rectangle { - fn new(width: i32, height: i32) -> Self { - Self { width, height } - } - fn area(&self) -> i32 { - self.height * self.width - } -} - -fn main() { - let rect = Rectangle::new(3, 4); - let _ = rect::area(); - //~^ ERROR failed to resolve: use of undeclared crate or module `rect` -} diff --git a/src/test/ui/resolve/issue-101749.stderr b/src/test/ui/resolve/issue-101749.stderr deleted file mode 100644 index dd29d7fc0..000000000 --- a/src/test/ui/resolve/issue-101749.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `rect` - --> $DIR/issue-101749.rs:17:13 - | -LL | let _ = rect::area(); - | ^^^^ use of undeclared crate or module `rect` - | -help: you may have meant to call an instance method - | -LL | let _ = rect.area(); - | ~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/resolve/issue-10200.rs b/src/test/ui/resolve/issue-10200.rs deleted file mode 100644 index fe36a7e00..000000000 --- a/src/test/ui/resolve/issue-10200.rs +++ /dev/null @@ -1,9 +0,0 @@ -struct Foo(bool); -fn foo(_: usize) -> Foo { Foo(false) } - -fn main() { - match Foo(true) { - foo(x) //~ ERROR expected tuple struct or tuple variant, found function `foo` - => () - } -} diff --git a/src/test/ui/resolve/issue-10200.stderr b/src/test/ui/resolve/issue-10200.stderr deleted file mode 100644 index e60489f5b..000000000 --- a/src/test/ui/resolve/issue-10200.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0532]: expected tuple struct or tuple variant, found function `foo` - --> $DIR/issue-10200.rs:6:9 - | -LL | struct Foo(bool); - | ----------------- similarly named tuple struct `Foo` defined here -... -LL | foo(x) - | ^^^ help: a tuple struct with a similar name exists (notice the capitalization): `Foo` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/ui/resolve/issue-102946.rs b/src/test/ui/resolve/issue-102946.rs deleted file mode 100644 index c6feca6f3..000000000 --- a/src/test/ui/resolve/issue-102946.rs +++ /dev/null @@ -1,7 +0,0 @@ -impl Error for str::Utf8Error { - //~^ ERROR cannot find trait `Error` in this scope - //~| ERROR ambiguous associated type - fn description(&self) {} -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-102946.stderr b/src/test/ui/resolve/issue-102946.stderr deleted file mode 100644 index 65be0258e..000000000 --- a/src/test/ui/resolve/issue-102946.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error[E0405]: cannot find trait `Error` in this scope - --> $DIR/issue-102946.rs:1:6 - | -LL | impl Error for str::Utf8Error { - | ^^^^^ not found in this scope - | -help: consider importing this trait - | -LL | use std::error::Error; - | - -error[E0223]: ambiguous associated type - --> $DIR/issue-102946.rs:1:16 - | -LL | impl Error for str::Utf8Error { - | ^^^^^^^^^^^^^^ - | -help: you are looking for the module in `std`, not the primitive type - | -LL | impl Error for std::str::Utf8Error { - | +++++ - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0223, E0405. -For more information about an error, try `rustc --explain E0223`. diff --git a/src/test/ui/resolve/issue-103202.rs b/src/test/ui/resolve/issue-103202.rs deleted file mode 100644 index 469d9d7c8..000000000 --- a/src/test/ui/resolve/issue-103202.rs +++ /dev/null @@ -1,7 +0,0 @@ -struct S {} - -impl S { - fn f(self: &S::x) {} //~ ERROR ambiguous associated type -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-103202.stderr b/src/test/ui/resolve/issue-103202.stderr deleted file mode 100644 index 880389371..000000000 --- a/src/test/ui/resolve/issue-103202.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0223]: ambiguous associated type - --> $DIR/issue-103202.rs:4:17 - | -LL | fn f(self: &S::x) {} - | ^^^^ help: use fully-qualified syntax: `<S as Trait>::x` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0223`. diff --git a/src/test/ui/resolve/issue-103474.rs b/src/test/ui/resolve/issue-103474.rs deleted file mode 100644 index 14f2259e1..000000000 --- a/src/test/ui/resolve/issue-103474.rs +++ /dev/null @@ -1,28 +0,0 @@ -struct S {} -impl S { - fn first(&self) {} - - fn second(&self) { - first() - //~^ ERROR cannot find function `first` in this scope - } - - fn third(&self) { - no_method_err() - //~^ ERROR cannot find function `no_method_err` in this scope - } -} - -// https://github.com/rust-lang/rust/pull/103531#discussion_r1004728080 -struct Foo { - i: i32, -} - -impl Foo { - fn needs_self() { - this.i - //~^ ERROR cannot find value `this` in this scope - } -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-103474.stderr b/src/test/ui/resolve/issue-103474.stderr deleted file mode 100644 index 415d23155..000000000 --- a/src/test/ui/resolve/issue-103474.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0425]: cannot find value `this` in this scope - --> $DIR/issue-103474.rs:23:9 - | -LL | this.i - | ^^^^ not found in this scope - | -help: you might have meant to use `self` here instead - | -LL | self.i - | ~~~~ -help: if you meant to use `self`, you are also missing a `self` receiver argument - | -LL | fn needs_self(&self) { - | +++++ - -error[E0425]: cannot find function `first` in this scope - --> $DIR/issue-103474.rs:6:9 - | -LL | first() - | ^^^^^ not found in this scope - | -help: consider using the associated function - | -LL | self.first() - | +++++ - -error[E0425]: cannot find function `no_method_err` in this scope - --> $DIR/issue-103474.rs:11:9 - | -LL | no_method_err() - | ^^^^^^^^^^^^^ not found in this scope - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/issue-105069.rs b/src/test/ui/resolve/issue-105069.rs deleted file mode 100644 index 73455cf77..000000000 --- a/src/test/ui/resolve/issue-105069.rs +++ /dev/null @@ -1,11 +0,0 @@ -use self::A::*; -use V; //~ ERROR `V` is ambiguous -use self::B::*; -enum A { - V -} -enum B { - V -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-105069.stderr b/src/test/ui/resolve/issue-105069.stderr deleted file mode 100644 index 1e6c9c6e2..000000000 --- a/src/test/ui/resolve/issue-105069.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0659]: `V` is ambiguous - --> $DIR/issue-105069.rs:2:5 - | -LL | use V; - | ^ ambiguous name - | - = note: ambiguous because of multiple potential import sources -note: `V` could refer to the variant imported here - --> $DIR/issue-105069.rs:1:5 - | -LL | use self::A::*; - | ^^^^^^^^^^ -note: `V` could also refer to the variant imported here - --> $DIR/issue-105069.rs:3:5 - | -LL | use self::B::*; - | ^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0659`. diff --git a/src/test/ui/resolve/issue-12796.rs b/src/test/ui/resolve/issue-12796.rs deleted file mode 100644 index 942d6b9a5..000000000 --- a/src/test/ui/resolve/issue-12796.rs +++ /dev/null @@ -1,9 +0,0 @@ -trait Trait { - fn outer(&self) { - fn inner(_: &Self) { - //~^ ERROR can't use generic parameters from outer function - } - } -} - -fn main() { } diff --git a/src/test/ui/resolve/issue-12796.stderr b/src/test/ui/resolve/issue-12796.stderr deleted file mode 100644 index a01fd2d65..000000000 --- a/src/test/ui/resolve/issue-12796.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0401]: can't use generic parameters from outer function - --> $DIR/issue-12796.rs:3:22 - | -LL | fn inner(_: &Self) { - | ^^^^ - | | - | use of generic parameter from outer function - | can't use `Self` here - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/resolve/issue-14254.rs b/src/test/ui/resolve/issue-14254.rs deleted file mode 100644 index 78add29ca..000000000 --- a/src/test/ui/resolve/issue-14254.rs +++ /dev/null @@ -1,105 +0,0 @@ -trait Foo { - fn bar(&self); - fn baz(&self) { } - fn bah(_: Option<&Self>) { } -} - -struct BarTy { - x : isize, - y : f64, -} - -impl BarTy { - fn a() {} - fn b(&self) {} -} - -impl Foo for *const BarTy { - fn bar(&self) { - baz(); - //~^ ERROR cannot find function `baz` - a; - //~^ ERROR cannot find value `a` - } -} - -impl<'a> Foo for &'a BarTy { - fn bar(&self) { - baz(); - //~^ ERROR cannot find function `baz` - x; - //~^ ERROR cannot find value `x` - y; - //~^ ERROR cannot find value `y` - a; - //~^ ERROR cannot find value `a` - bah; - //~^ ERROR cannot find value `bah` - b; - //~^ ERROR cannot find value `b` - } -} - -impl<'a> Foo for &'a mut BarTy { - fn bar(&self) { - baz(); - //~^ ERROR cannot find function `baz` - x; - //~^ ERROR cannot find value `x` - y; - //~^ ERROR cannot find value `y` - a; - //~^ ERROR cannot find value `a` - bah; - //~^ ERROR cannot find value `bah` - b; - //~^ ERROR cannot find value `b` - } -} - -impl Foo for Box<BarTy> { - fn bar(&self) { - baz(); - //~^ ERROR cannot find function `baz` - bah; - //~^ ERROR cannot find value `bah` - } -} - -impl Foo for *const isize { - fn bar(&self) { - baz(); - //~^ ERROR cannot find function `baz` - bah; - //~^ ERROR cannot find value `bah` - } -} - -impl<'a> Foo for &'a isize { - fn bar(&self) { - baz(); - //~^ ERROR cannot find function `baz` - bah; - //~^ ERROR cannot find value `bah` - } -} - -impl<'a> Foo for &'a mut isize { - fn bar(&self) { - baz(); - //~^ ERROR cannot find function `baz` - bah; - //~^ ERROR cannot find value `bah` - } -} - -impl Foo for Box<isize> { - fn bar(&self) { - baz(); - //~^ ERROR cannot find function `baz` - bah; - //~^ ERROR cannot find value `bah` - } -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-14254.stderr b/src/test/ui/resolve/issue-14254.stderr deleted file mode 100644 index 690a40f7e..000000000 --- a/src/test/ui/resolve/issue-14254.stderr +++ /dev/null @@ -1,182 +0,0 @@ -error[E0425]: cannot find value `a` in this scope - --> $DIR/issue-14254.rs:21:9 - | -LL | a; - | ^ not found in this scope - -error[E0425]: cannot find value `x` in this scope - --> $DIR/issue-14254.rs:30:9 - | -LL | x; - | ^ help: you might have meant to use the available field: `self.x` - -error[E0425]: cannot find value `y` in this scope - --> $DIR/issue-14254.rs:32:9 - | -LL | y; - | ^ help: you might have meant to use the available field: `self.y` - -error[E0425]: cannot find value `a` in this scope - --> $DIR/issue-14254.rs:34:9 - | -LL | a; - | ^ not found in this scope - -error[E0425]: cannot find value `bah` in this scope - --> $DIR/issue-14254.rs:36:9 - | -LL | bah; - | ^^^ - | -help: you might have meant to refer to the associated function - | -LL | Self::bah; - | ~~~~~~~~~ - -error[E0425]: cannot find value `b` in this scope - --> $DIR/issue-14254.rs:38:9 - | -LL | b; - | ^ not found in this scope - -error[E0425]: cannot find value `x` in this scope - --> $DIR/issue-14254.rs:47:9 - | -LL | x; - | ^ help: you might have meant to use the available field: `self.x` - -error[E0425]: cannot find value `y` in this scope - --> $DIR/issue-14254.rs:49:9 - | -LL | y; - | ^ help: you might have meant to use the available field: `self.y` - -error[E0425]: cannot find value `a` in this scope - --> $DIR/issue-14254.rs:51:9 - | -LL | a; - | ^ not found in this scope - -error[E0425]: cannot find value `bah` in this scope - --> $DIR/issue-14254.rs:53:9 - | -LL | bah; - | ^^^ - | -help: you might have meant to refer to the associated function - | -LL | Self::bah; - | ~~~~~~~~~ - -error[E0425]: cannot find value `b` in this scope - --> $DIR/issue-14254.rs:55:9 - | -LL | b; - | ^ not found in this scope - -error[E0425]: cannot find value `bah` in this scope - --> $DIR/issue-14254.rs:64:9 - | -LL | bah; - | ^^^ - | -help: you might have meant to refer to the associated function - | -LL | Self::bah; - | ~~~~~~~~~ - -error[E0425]: cannot find value `bah` in this scope - --> $DIR/issue-14254.rs:73:9 - | -LL | bah; - | ^^^ - | -help: you might have meant to refer to the associated function - | -LL | Self::bah; - | ~~~~~~~~~ - -error[E0425]: cannot find value `bah` in this scope - --> $DIR/issue-14254.rs:82:9 - | -LL | bah; - | ^^^ - | -help: you might have meant to refer to the associated function - | -LL | Self::bah; - | ~~~~~~~~~ - -error[E0425]: cannot find value `bah` in this scope - --> $DIR/issue-14254.rs:91:9 - | -LL | bah; - | ^^^ - | -help: you might have meant to refer to the associated function - | -LL | Self::bah; - | ~~~~~~~~~ - -error[E0425]: cannot find value `bah` in this scope - --> $DIR/issue-14254.rs:100:9 - | -LL | bah; - | ^^^ - | -help: you might have meant to refer to the associated function - | -LL | Self::bah; - | ~~~~~~~~~ - -error[E0425]: cannot find function `baz` in this scope - --> $DIR/issue-14254.rs:19:9 - | -LL | baz(); - | ^^^ help: you might have meant to call the method: `self.baz` - -error[E0425]: cannot find function `baz` in this scope - --> $DIR/issue-14254.rs:28:9 - | -LL | baz(); - | ^^^ help: you might have meant to call the method: `self.baz` - -error[E0425]: cannot find function `baz` in this scope - --> $DIR/issue-14254.rs:45:9 - | -LL | baz(); - | ^^^ help: you might have meant to call the method: `self.baz` - -error[E0425]: cannot find function `baz` in this scope - --> $DIR/issue-14254.rs:62:9 - | -LL | baz(); - | ^^^ help: you might have meant to call the method: `self.baz` - -error[E0425]: cannot find function `baz` in this scope - --> $DIR/issue-14254.rs:71:9 - | -LL | baz(); - | ^^^ help: you might have meant to call the method: `self.baz` - -error[E0425]: cannot find function `baz` in this scope - --> $DIR/issue-14254.rs:80:9 - | -LL | baz(); - | ^^^ help: you might have meant to call the method: `self.baz` - -error[E0425]: cannot find function `baz` in this scope - --> $DIR/issue-14254.rs:89:9 - | -LL | baz(); - | ^^^ help: you might have meant to call the method: `self.baz` - -error[E0425]: cannot find function `baz` in this scope - --> $DIR/issue-14254.rs:98:9 - | -LL | baz(); - | ^^^ help: you might have meant to call the method: `self.baz` - -error: aborting due to 24 previous errors - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/issue-16058.rs b/src/test/ui/resolve/issue-16058.rs deleted file mode 100644 index 048aaf65f..000000000 --- a/src/test/ui/resolve/issue-16058.rs +++ /dev/null @@ -1,18 +0,0 @@ -// ignore-sgx std::os::fortanix_sgx::usercalls::raw::Result changes compiler suggestions - -pub struct GslResult { - pub val: f64, - pub err: f64 -} - -impl GslResult { - pub fn new() -> GslResult { - Result { -//~^ ERROR expected struct, variant or union type, found enum `Result` - val: 0f64, - err: 0f64 - } - } -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-16058.stderr b/src/test/ui/resolve/issue-16058.stderr deleted file mode 100644 index c47d22cef..000000000 --- a/src/test/ui/resolve/issue-16058.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0574]: expected struct, variant or union type, found enum `Result` - --> $DIR/issue-16058.rs:10:9 - | -LL | Result { - | ^^^^^^ not a struct, variant or union type - | -help: consider importing one of these items instead - | -LL | use std::fmt::Result; - | -LL | use std::io::Result; - | -LL | use std::thread::Result; - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0574`. diff --git a/src/test/ui/resolve/issue-17518.rs b/src/test/ui/resolve/issue-17518.rs deleted file mode 100644 index edaebc812..000000000 --- a/src/test/ui/resolve/issue-17518.rs +++ /dev/null @@ -1,7 +0,0 @@ -enum SomeEnum { - E -} - -fn main() { - E { name: "foobar" }; //~ ERROR cannot find struct, variant or union type `E` -} diff --git a/src/test/ui/resolve/issue-17518.stderr b/src/test/ui/resolve/issue-17518.stderr deleted file mode 100644 index 034d0d01b..000000000 --- a/src/test/ui/resolve/issue-17518.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0422]: cannot find struct, variant or union type `E` in this scope - --> $DIR/issue-17518.rs:6:5 - | -LL | E { name: "foobar" }; - | ^ not found in this scope - | -help: consider importing this variant - | -LL | use SomeEnum::E; - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0422`. diff --git a/src/test/ui/resolve/issue-18252.rs b/src/test/ui/resolve/issue-18252.rs deleted file mode 100644 index f6ebe2920..000000000 --- a/src/test/ui/resolve/issue-18252.rs +++ /dev/null @@ -1,8 +0,0 @@ -enum Foo { - Variant { x: usize } -} - -fn main() { - let f = Foo::Variant(42); - //~^ ERROR expected value, found struct variant `Foo::Variant` -} diff --git a/src/test/ui/resolve/issue-18252.stderr b/src/test/ui/resolve/issue-18252.stderr deleted file mode 100644 index d9006c0a6..000000000 --- a/src/test/ui/resolve/issue-18252.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0533]: expected value, found struct variant `Foo::Variant` - --> $DIR/issue-18252.rs:6:13 - | -LL | let f = Foo::Variant(42); - | ^^^^^^^^^^^^ not a value - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0533`. diff --git a/src/test/ui/resolve/issue-19452.rs b/src/test/ui/resolve/issue-19452.rs deleted file mode 100644 index 1d3aa49ea..000000000 --- a/src/test/ui/resolve/issue-19452.rs +++ /dev/null @@ -1,15 +0,0 @@ -// aux-build:issue-19452-aux.rs - -extern crate issue_19452_aux; - -enum Homura { - Madoka { age: u32 } -} - -fn main() { - let homura = Homura::Madoka; - //~^ ERROR expected value, found struct variant `Homura::Madoka` - - let homura = issue_19452_aux::Homura::Madoka; - //~^ ERROR expected value, found struct variant `issue_19452_aux::Homura::Madoka` -} diff --git a/src/test/ui/resolve/issue-19452.stderr b/src/test/ui/resolve/issue-19452.stderr deleted file mode 100644 index eff89241f..000000000 --- a/src/test/ui/resolve/issue-19452.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0533]: expected value, found struct variant `Homura::Madoka` - --> $DIR/issue-19452.rs:10:18 - | -LL | let homura = Homura::Madoka; - | ^^^^^^^^^^^^^^ not a value - -error[E0533]: expected value, found struct variant `issue_19452_aux::Homura::Madoka` - --> $DIR/issue-19452.rs:13:18 - | -LL | let homura = issue_19452_aux::Homura::Madoka; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a value - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0533`. diff --git a/src/test/ui/resolve/issue-21221-1.rs b/src/test/ui/resolve/issue-21221-1.rs deleted file mode 100644 index b180624d2..000000000 --- a/src/test/ui/resolve/issue-21221-1.rs +++ /dev/null @@ -1,75 +0,0 @@ -mod mul1 { - pub trait Mul {} -} - -mod mul2 { - pub trait Mul {} -} - -mod mul3 { - enum Mul { - Yes, - No - } -} - -mod mul4 { - type Mul = String; -} - -mod mul5 { - struct Mul{ - left_term: u32, - right_term: u32 - } -} - -#[derive(Debug)] -struct Foo; - -// When we comment the next line: -//use mul1::Mul; - -// BEFORE, we got the following error for the `impl` below: -// error: use of undeclared trait name `Mul` [E0405] -// AFTER, we get this message: -// error: trait `Mul` is not in scope. -// help: ... -// help: you can import several candidates into scope (`use ...;`): -// help: `mul1::Mul` -// help: `mul2::Mul` -// help: `std::ops::Mul` - -impl Mul for Foo { -//~^ ERROR cannot find trait `Mul` -} - -// BEFORE, we got: -// error: use of undeclared type name `Mul` [E0412] -// AFTER, we get: -// error: type name `Mul` is not in scope. Maybe you meant: -// help: ... -// help: you can import several candidates into scope (`use ...;`): -// help: `mul1::Mul` -// help: `mul2::Mul` -// help: `mul3::Mul` -// help: `mul4::Mul` -// help: and 2 other candidates -fn getMul() -> Mul { -//~^ ERROR cannot find type `Mul` -} - -// Let's also test what happens if the trait doesn't exist: -impl ThisTraitReallyDoesntExistInAnyModuleReally for Foo { -//~^ ERROR cannot find trait `ThisTraitReallyDoesntExistInAnyModuleReally` -} - -// Let's also test what happens if there's just one alternative: -impl Div for Foo { -//~^ ERROR cannot find trait `Div` -} - -fn main() { - let foo = Foo(); - println!("Hello, {:?}!", foo); -} diff --git a/src/test/ui/resolve/issue-21221-1.stderr b/src/test/ui/resolve/issue-21221-1.stderr deleted file mode 100644 index 538eeead9..000000000 --- a/src/test/ui/resolve/issue-21221-1.stderr +++ /dev/null @@ -1,51 +0,0 @@ -error[E0405]: cannot find trait `Mul` in this scope - --> $DIR/issue-21221-1.rs:43:6 - | -LL | impl Mul for Foo { - | ^^^ not found in this scope - | -help: consider importing one of these items - | -LL | use mul1::Mul; - | -LL | use mul2::Mul; - | -LL | use std::ops::Mul; - | - -error[E0412]: cannot find type `Mul` in this scope - --> $DIR/issue-21221-1.rs:58:16 - | -LL | fn getMul() -> Mul { - | ^^^ not found in this scope - | -help: consider importing one of these items - | -LL | use mul1::Mul; - | -LL | use mul2::Mul; - | -LL | use std::ops::Mul; - | - -error[E0405]: cannot find trait `ThisTraitReallyDoesntExistInAnyModuleReally` in this scope - --> $DIR/issue-21221-1.rs:63:6 - | -LL | impl ThisTraitReallyDoesntExistInAnyModuleReally for Foo { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope - -error[E0405]: cannot find trait `Div` in this scope - --> $DIR/issue-21221-1.rs:68:6 - | -LL | impl Div for Foo { - | ^^^ not found in this scope - | -help: consider importing this trait - | -LL | use std::ops::Div; - | - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0405, E0412. -For more information about an error, try `rustc --explain E0405`. diff --git a/src/test/ui/resolve/issue-21221-2.rs b/src/test/ui/resolve/issue-21221-2.rs deleted file mode 100644 index dc13e46cb..000000000 --- a/src/test/ui/resolve/issue-21221-2.rs +++ /dev/null @@ -1,21 +0,0 @@ -pub mod foo { - pub mod bar { - // note: trait T is not public, but being in the current - // crate, it's fine to show it, since the programmer can - // decide to make it public based on the suggestion ... - pub trait T {} - } - // imports should be ignored: - use self::bar::T; -} - -pub mod baz { - pub use foo; - pub use std::ops::{Mul as T}; -} - -struct Foo; -impl T for Foo { } -//~^ ERROR cannot find trait `T` - -fn main() {} diff --git a/src/test/ui/resolve/issue-21221-2.stderr b/src/test/ui/resolve/issue-21221-2.stderr deleted file mode 100644 index d4fd7cb12..000000000 --- a/src/test/ui/resolve/issue-21221-2.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0405]: cannot find trait `T` in this scope - --> $DIR/issue-21221-2.rs:18:6 - | -LL | impl T for Foo { } - | ^ not found in this scope - | -help: consider importing one of these items - | -LL | use baz::T; - | -LL | use foo::bar::T; - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0405`. diff --git a/src/test/ui/resolve/issue-21221-3.rs b/src/test/ui/resolve/issue-21221-3.rs deleted file mode 100644 index f0c0a9fd6..000000000 --- a/src/test/ui/resolve/issue-21221-3.rs +++ /dev/null @@ -1,19 +0,0 @@ -// testing whether the lookup mechanism picks up types -// defined in the outside crate - -// aux-build:issue-21221-3.rs - -extern crate issue_21221_3; - -struct Foo; - -// NOTE: This shows only traits accessible from the current -// crate, thus the two private entities: -// `issue_21221_3::outer::private_module::OuterTrait` and -// `issue_21221_3::outer::public_module::OuterTrait` -// are hidden from the view. -impl OuterTrait for Foo {} -//~^ ERROR cannot find trait `OuterTrait` -fn main() { - println!("Hello, world!"); -} diff --git a/src/test/ui/resolve/issue-21221-3.stderr b/src/test/ui/resolve/issue-21221-3.stderr deleted file mode 100644 index f12e5b09b..000000000 --- a/src/test/ui/resolve/issue-21221-3.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0405]: cannot find trait `OuterTrait` in this scope - --> $DIR/issue-21221-3.rs:15:6 - | -LL | impl OuterTrait for Foo {} - | ^^^^^^^^^^ not found in this scope - | -help: consider importing this trait - | -LL | use issue_21221_3::outer::OuterTrait; - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0405`. diff --git a/src/test/ui/resolve/issue-21221-4.rs b/src/test/ui/resolve/issue-21221-4.rs deleted file mode 100644 index 88d5bd06c..000000000 --- a/src/test/ui/resolve/issue-21221-4.rs +++ /dev/null @@ -1,15 +0,0 @@ -// testing whether the lookup mechanism picks up types -// defined in the outside crate - -// aux-build:issue-21221-4.rs - -extern crate issue_21221_4; - -struct Foo; - -impl T for Foo {} -//~^ ERROR cannot find trait `T` - -fn main() { - println!("Hello, world!"); -} diff --git a/src/test/ui/resolve/issue-21221-4.stderr b/src/test/ui/resolve/issue-21221-4.stderr deleted file mode 100644 index fc15444d0..000000000 --- a/src/test/ui/resolve/issue-21221-4.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0405]: cannot find trait `T` in this scope - --> $DIR/issue-21221-4.rs:10:6 - | -LL | impl T for Foo {} - | ^ not found in this scope - | -help: consider importing this trait - | -LL | use issue_21221_4::T; - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0405`. diff --git a/src/test/ui/resolve/issue-22692.rs b/src/test/ui/resolve/issue-22692.rs deleted file mode 100644 index 31a762614..000000000 --- a/src/test/ui/resolve/issue-22692.rs +++ /dev/null @@ -1,60 +0,0 @@ -fn main() { - let _ = String.new(); - //~^ ERROR expected value, found struct `String` - //~| HELP use the path separator - - let _ = String.default; - //~^ ERROR expected value, found struct `String` - //~| HELP use the path separator - - let _ = Vec::<()>.with_capacity(1); - //~^ ERROR expected value, found struct `Vec` - //~| HELP use the path separator -} - -macro_rules! Type { - () => { - ::std::cell::Cell - //~^ ERROR expected value, found struct `std::cell::Cell` - //~| ERROR expected value, found struct `std::cell::Cell` - //~| ERROR expected value, found struct `std::cell::Cell` - }; -} - -macro_rules! create { - (type method) => { - Vec.new() - //~^ ERROR expected value, found struct `Vec` - //~| HELP use the path separator - }; - (type field) => { - Vec.new - //~^ ERROR expected value, found struct `Vec` - //~| HELP use the path separator - }; - (macro method) => { - Type!().new(0) - //~^ HELP use the path separator - }; -} - -fn interaction_with_macros() { - // - // Verify that we do not only suggest to replace `.` with `::` if the receiver is a - // macro call but that we also correctly suggest to surround it with angle brackets. - // - - Type!().get(); - //~^ HELP use the path separator - - Type! {}.get; - //~^ HELP use the path separator - - // - // Ensure that the suggestion is shown for expressions inside of macro definitions. - // - - let _ = create!(type method); - let _ = create!(type field); - let _ = create!(macro method); -} diff --git a/src/test/ui/resolve/issue-22692.stderr b/src/test/ui/resolve/issue-22692.stderr deleted file mode 100644 index 6962aa161..000000000 --- a/src/test/ui/resolve/issue-22692.stderr +++ /dev/null @@ -1,88 +0,0 @@ -error[E0423]: expected value, found struct `String` - --> $DIR/issue-22692.rs:2:13 - | -LL | let _ = String.new(); - | ^^^^^^- help: use the path separator to refer to an item: `::` - -error[E0423]: expected value, found struct `String` - --> $DIR/issue-22692.rs:6:13 - | -LL | let _ = String.default; - | ^^^^^^- help: use the path separator to refer to an item: `::` - -error[E0423]: expected value, found struct `Vec` - --> $DIR/issue-22692.rs:10:13 - | -LL | let _ = Vec::<()>.with_capacity(1); - | ^^^^^^^^^- help: use the path separator to refer to an item: `::` - -error[E0423]: expected value, found struct `std::cell::Cell` - --> $DIR/issue-22692.rs:17:9 - | -LL | ::std::cell::Cell - | ^^^^^^^^^^^^^^^^^ -... -LL | Type!().get(); - | ------- in this macro invocation - | - = note: this error originates in the macro `Type` (in Nightly builds, run with -Z macro-backtrace for more info) -help: use the path separator to refer to an item - | -LL | <Type!()>::get(); - | ~~~~~~~~~~~ - -error[E0423]: expected value, found struct `std::cell::Cell` - --> $DIR/issue-22692.rs:17:9 - | -LL | ::std::cell::Cell - | ^^^^^^^^^^^^^^^^^ -... -LL | Type! {}.get; - | -------- in this macro invocation - | - = note: this error originates in the macro `Type` (in Nightly builds, run with -Z macro-backtrace for more info) -help: use the path separator to refer to an item - | -LL | <Type! {}>::get; - | ~~~~~~~~~~~~ - -error[E0423]: expected value, found struct `Vec` - --> $DIR/issue-22692.rs:26:9 - | -LL | Vec.new() - | ^^^- help: use the path separator to refer to an item: `::` -... -LL | let _ = create!(type method); - | -------------------- in this macro invocation - | - = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0423]: expected value, found struct `Vec` - --> $DIR/issue-22692.rs:31:9 - | -LL | Vec.new - | ^^^- help: use the path separator to refer to an item: `::` -... -LL | let _ = create!(type field); - | ------------------- in this macro invocation - | - = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0423]: expected value, found struct `std::cell::Cell` - --> $DIR/issue-22692.rs:17:9 - | -LL | ::std::cell::Cell - | ^^^^^^^^^^^^^^^^^ -... -LL | let _ = create!(macro method); - | --------------------- in this macro invocation - | - = note: this error originates in the macro `Type` which comes from the expansion of the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info) -help: use the path separator to refer to an item - | -LL | <Type!()>::new(0) - | ~~~~~~~~~~~ - -error: aborting due to 8 previous errors - -For more information about this error, try `rustc --explain E0423`. diff --git a/src/test/ui/resolve/issue-2330.rs b/src/test/ui/resolve/issue-2330.rs deleted file mode 100644 index 4560caba0..000000000 --- a/src/test/ui/resolve/issue-2330.rs +++ /dev/null @@ -1,13 +0,0 @@ -enum Chan { } - -trait Channel<T> { - fn send(&self, v: T); -} - -// `Chan` is not a trait, it's an enum -impl Chan for isize { //~ ERROR expected trait, found enum `Chan` - fn send(&self, v: isize) { panic!() } -} - -fn main() { -} diff --git a/src/test/ui/resolve/issue-2330.stderr b/src/test/ui/resolve/issue-2330.stderr deleted file mode 100644 index 877cf68b5..000000000 --- a/src/test/ui/resolve/issue-2330.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0404]: expected trait, found enum `Chan` - --> $DIR/issue-2330.rs:8:6 - | -LL | impl Chan for isize { - | ^^^^ not a trait - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0404`. diff --git a/src/test/ui/resolve/issue-23305.rs b/src/test/ui/resolve/issue-23305.rs deleted file mode 100644 index 6d7fe7c50..000000000 --- a/src/test/ui/resolve/issue-23305.rs +++ /dev/null @@ -1,8 +0,0 @@ -pub trait ToNbt<T> { - fn new(val: T) -> Self; -} - -impl dyn ToNbt<Self> {} -//~^ ERROR `Self` is not valid in the self type of an impl block - -fn main() {} diff --git a/src/test/ui/resolve/issue-23305.stderr b/src/test/ui/resolve/issue-23305.stderr deleted file mode 100644 index aad1b583a..000000000 --- a/src/test/ui/resolve/issue-23305.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: `Self` is not valid in the self type of an impl block - --> $DIR/issue-23305.rs:5:16 - | -LL | impl dyn ToNbt<Self> {} - | ^^^^ - | - = note: replace `Self` with a different type - -error: aborting due to previous error - diff --git a/src/test/ui/resolve/issue-2356.rs b/src/test/ui/resolve/issue-2356.rs deleted file mode 100644 index fe9bf4d44..000000000 --- a/src/test/ui/resolve/issue-2356.rs +++ /dev/null @@ -1,94 +0,0 @@ -trait Groom { - fn shave(other: usize); -} - -pub struct Cat { - whiskers: isize, -} - -pub enum MaybeDog { - Dog, - NoDog -} - -impl MaybeDog { - fn bark() { - // If this provides a suggestion, it's a bug as MaybeDog doesn't impl Groom - shave(); - //~^ ERROR cannot find function `shave` - } -} - -impl Clone for Cat { - fn clone(&self) -> Self { - clone(); - //~^ ERROR cannot find function `clone` - loop {} - } -} -impl Default for Cat { - fn default() -> Self { - default(); - //~^ ERROR cannot find function `default` in this scope [E0425] - loop {} - } -} - -impl Groom for Cat { - fn shave(other: usize) { - whiskers -= other; - //~^ ERROR cannot find value `whiskers` - shave(4); - //~^ ERROR cannot find function `shave` - purr(); - //~^ ERROR cannot find function `purr` - } -} - -impl Cat { - fn static_method() {} - - fn purr_louder() { - static_method(); - //~^ ERROR cannot find function `static_method` - purr(); - //~^ ERROR cannot find function `purr` - purr(); - //~^ ERROR cannot find function `purr` - purr(); - //~^ ERROR cannot find function `purr` - } -} - -impl Cat { - fn meow() { - if self.whiskers > 3 { - //~^ ERROR expected value, found module `self` - println!("MEOW"); - } - } - - fn purr(&self) { - grow_older(); - //~^ ERROR cannot find function `grow_older` - shave(); - //~^ ERROR cannot find function `shave` - } - - fn burn_whiskers(&mut self) { - whiskers = 0; - //~^ ERROR cannot find value `whiskers` - } - - pub fn grow_older(other:usize) { - whiskers = 4; - //~^ ERROR cannot find value `whiskers` - purr_louder(); - //~^ ERROR cannot find function `purr_louder` - } -} - -fn main() { - self += 1; - //~^ ERROR expected value, found module `self` -} diff --git a/src/test/ui/resolve/issue-2356.stderr b/src/test/ui/resolve/issue-2356.stderr deleted file mode 100644 index 36f3da7c9..000000000 --- a/src/test/ui/resolve/issue-2356.stderr +++ /dev/null @@ -1,134 +0,0 @@ -error[E0425]: cannot find function `default` in this scope - --> $DIR/issue-2356.rs:31:5 - | -LL | default(); - | ^^^^^^^ - | -help: you might have meant to call the associated function - | -LL | Self::default(); - | ~~~~~~~~~~~~~ -help: consider importing this function - | -LL | use std::default::default; - | - -error[E0425]: cannot find value `whiskers` in this scope - --> $DIR/issue-2356.rs:39:5 - | -LL | whiskers -= other; - | ^^^^^^^^ a field by this name exists in `Self` - -error[E0424]: expected value, found module `self` - --> $DIR/issue-2356.rs:65:8 - | -LL | fn meow() { - | ---- this function doesn't have a `self` parameter -LL | if self.whiskers > 3 { - | ^^^^ `self` value is a keyword only available in methods with a `self` parameter - | -help: add a `self` receiver parameter to make the associated `fn` a method - | -LL | fn meow(&self) { - | +++++ - -error[E0425]: cannot find value `whiskers` in this scope - --> $DIR/issue-2356.rs:79:5 - | -LL | whiskers = 0; - | ^^^^^^^^ help: you might have meant to use the available field: `self.whiskers` - -error[E0425]: cannot find value `whiskers` in this scope - --> $DIR/issue-2356.rs:84:5 - | -LL | whiskers = 4; - | ^^^^^^^^ a field by this name exists in `Self` - -error[E0424]: expected value, found module `self` - --> $DIR/issue-2356.rs:92:5 - | -LL | fn main() { - | ---- this function can't have a `self` parameter -LL | self += 1; - | ^^^^ `self` value is a keyword only available in methods with a `self` parameter - -error[E0425]: cannot find function `shave` in this scope - --> $DIR/issue-2356.rs:17:5 - | -LL | shave(); - | ^^^^^ not found in this scope - -error[E0425]: cannot find function `clone` in this scope - --> $DIR/issue-2356.rs:24:5 - | -LL | clone(); - | ^^^^^ help: you might have meant to call the method: `self.clone` - -error[E0425]: cannot find function `shave` in this scope - --> $DIR/issue-2356.rs:41:5 - | -LL | shave(4); - | ^^^^^ help: you might have meant to call the associated function: `Self::shave` - -error[E0425]: cannot find function `purr` in this scope - --> $DIR/issue-2356.rs:43:5 - | -LL | purr(); - | ^^^^ not found in this scope - -error[E0425]: cannot find function `static_method` in this scope - --> $DIR/issue-2356.rs:52:9 - | -LL | static_method(); - | ^^^^^^^^^^^^^ not found in this scope - | -help: consider using the associated function - | -LL | Self::static_method(); - | ++++++ - -error[E0425]: cannot find function `purr` in this scope - --> $DIR/issue-2356.rs:54:9 - | -LL | purr(); - | ^^^^ not found in this scope - -error[E0425]: cannot find function `purr` in this scope - --> $DIR/issue-2356.rs:56:9 - | -LL | purr(); - | ^^^^ not found in this scope - -error[E0425]: cannot find function `purr` in this scope - --> $DIR/issue-2356.rs:58:9 - | -LL | purr(); - | ^^^^ not found in this scope - -error[E0425]: cannot find function `grow_older` in this scope - --> $DIR/issue-2356.rs:72:5 - | -LL | grow_older(); - | ^^^^^^^^^^ not found in this scope - | -help: consider using the associated function - | -LL | Self::grow_older(); - | ++++++ - -error[E0425]: cannot find function `shave` in this scope - --> $DIR/issue-2356.rs:74:5 - | -LL | shave(); - | ^^^^^ not found in this scope - -error[E0425]: cannot find function `purr_louder` in this scope - --> $DIR/issue-2356.rs:86:5 - | -LL | purr_louder(); - | ^^^^^^^^^^^ not found in this scope - -error: aborting due to 17 previous errors - -Some errors have detailed explanations: E0424, E0425. -For more information about an error, try `rustc --explain E0424`. diff --git a/src/test/ui/resolve/issue-23716.rs b/src/test/ui/resolve/issue-23716.rs deleted file mode 100644 index e9139c0aa..000000000 --- a/src/test/ui/resolve/issue-23716.rs +++ /dev/null @@ -1,17 +0,0 @@ -static foo: i32 = 0; - -fn bar(foo: i32) {} -//~^ ERROR function parameters cannot shadow statics -//~| cannot be named the same as a static - -mod submod { - pub static answer: i32 = 42; -} - -use self::submod::answer; - -fn question(answer: i32) {} -//~^ ERROR function parameters cannot shadow statics -//~| cannot be named the same as a static -fn main() { -} diff --git a/src/test/ui/resolve/issue-23716.stderr b/src/test/ui/resolve/issue-23716.stderr deleted file mode 100644 index 8b89c350c..000000000 --- a/src/test/ui/resolve/issue-23716.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0530]: function parameters cannot shadow statics - --> $DIR/issue-23716.rs:3:8 - | -LL | static foo: i32 = 0; - | -------------------- the static `foo` is defined here -LL | -LL | fn bar(foo: i32) {} - | ^^^ cannot be named the same as a static - -error[E0530]: function parameters cannot shadow statics - --> $DIR/issue-23716.rs:13:13 - | -LL | use self::submod::answer; - | -------------------- the static `answer` is imported here -LL | -LL | fn question(answer: i32) {} - | ^^^^^^ cannot be named the same as a static - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0530`. diff --git a/src/test/ui/resolve/issue-24968.rs b/src/test/ui/resolve/issue-24968.rs deleted file mode 100644 index 19e16abce..000000000 --- a/src/test/ui/resolve/issue-24968.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Also includes more Self usages per #93796 - -fn foo(_: Self) { -//~^ ERROR cannot find type `Self` -} - -fn foo2() { - let x: Self; - //~^ ERROR cannot find type `Self` -} - -type Foo<T> -where - Self: Clone, -//~^ ERROR cannot find type `Self` -= Vec<T>; - -const FOO: Self = 0; -//~^ ERROR cannot find type `Self` - -const FOO2: u32 = Self::bar(); -//~^ ERROR failed to resolve: `Self` - -static FOO_S: Self = 0; -//~^ ERROR cannot find type `Self` - -static FOO_S2: u32 = Self::bar(); -//~^ ERROR failed to resolve: `Self` - -fn main() {} diff --git a/src/test/ui/resolve/issue-24968.stderr b/src/test/ui/resolve/issue-24968.stderr deleted file mode 100644 index 82f5a1d5b..000000000 --- a/src/test/ui/resolve/issue-24968.stderr +++ /dev/null @@ -1,57 +0,0 @@ -error[E0411]: cannot find type `Self` in this scope - --> $DIR/issue-24968.rs:3:11 - | -LL | fn foo(_: Self) { - | --- ^^^^ `Self` is only available in impls, traits, and type definitions - | | - | `Self` not allowed in a function - -error[E0411]: cannot find type `Self` in this scope - --> $DIR/issue-24968.rs:8:12 - | -LL | fn foo2() { - | ---- `Self` not allowed in a function -LL | let x: Self; - | ^^^^ `Self` is only available in impls, traits, and type definitions - -error[E0411]: cannot find type `Self` in this scope - --> $DIR/issue-24968.rs:14:5 - | -LL | type Foo<T> - | --- `Self` not allowed in a type alias -LL | where -LL | Self: Clone, - | ^^^^ `Self` is only available in impls, traits, and type definitions - -error[E0411]: cannot find type `Self` in this scope - --> $DIR/issue-24968.rs:18:12 - | -LL | const FOO: Self = 0; - | --- ^^^^ `Self` is only available in impls, traits, and type definitions - | | - | `Self` not allowed in a constant item - -error[E0411]: cannot find type `Self` in this scope - --> $DIR/issue-24968.rs:24:15 - | -LL | static FOO_S: Self = 0; - | ----- ^^^^ `Self` is only available in impls, traits, and type definitions - | | - | `Self` not allowed in a static item - -error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions - --> $DIR/issue-24968.rs:21:19 - | -LL | const FOO2: u32 = Self::bar(); - | ^^^^ `Self` is only available in impls, traits, and type definitions - -error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions - --> $DIR/issue-24968.rs:27:22 - | -LL | static FOO_S2: u32 = Self::bar(); - | ^^^^ `Self` is only available in impls, traits, and type definitions - -error: aborting due to 7 previous errors - -Some errors have detailed explanations: E0411, E0433. -For more information about an error, try `rustc --explain E0411`. diff --git a/src/test/ui/resolve/issue-26545.rs b/src/test/ui/resolve/issue-26545.rs deleted file mode 100644 index 5652ee747..000000000 --- a/src/test/ui/resolve/issue-26545.rs +++ /dev/null @@ -1,12 +0,0 @@ -mod foo { - pub struct B(pub ()); -} - -mod baz { - fn foo() { - B(()); - //~^ ERROR cannot find function, tuple struct or tuple variant `B` in this scope [E0425] - } -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-26545.stderr b/src/test/ui/resolve/issue-26545.stderr deleted file mode 100644 index d3c866925..000000000 --- a/src/test/ui/resolve/issue-26545.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0425]: cannot find function, tuple struct or tuple variant `B` in this scope - --> $DIR/issue-26545.rs:7:9 - | -LL | B(()); - | ^ not found in this scope - | -help: consider importing this tuple struct - | -LL | use foo::B; - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/issue-3021-c.rs b/src/test/ui/resolve/issue-3021-c.rs deleted file mode 100644 index 94ed1fdf7..000000000 --- a/src/test/ui/resolve/issue-3021-c.rs +++ /dev/null @@ -1,9 +0,0 @@ -fn siphash<T>() { - - trait U { - fn g(&self, x: T) -> T; //~ ERROR can't use generic parameters from outer function - //~^ ERROR can't use generic parameters from outer function - } -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-3021-c.stderr b/src/test/ui/resolve/issue-3021-c.stderr deleted file mode 100644 index 5176efc3a..000000000 --- a/src/test/ui/resolve/issue-3021-c.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0401]: can't use generic parameters from outer function - --> $DIR/issue-3021-c.rs:4:24 - | -LL | fn siphash<T>() { - | - type parameter from outer function -LL | -LL | trait U { - | - help: try using a local generic parameter instead: `<T>` -LL | fn g(&self, x: T) -> T; - | ^ use of generic parameter from outer function - -error[E0401]: can't use generic parameters from outer function - --> $DIR/issue-3021-c.rs:4:30 - | -LL | fn siphash<T>() { - | - type parameter from outer function -LL | -LL | trait U { - | - help: try using a local generic parameter instead: `<T>` -LL | fn g(&self, x: T) -> T; - | ^ use of generic parameter from outer function - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/resolve/issue-3021.rs b/src/test/ui/resolve/issue-3021.rs deleted file mode 100644 index a672261f8..000000000 --- a/src/test/ui/resolve/issue-3021.rs +++ /dev/null @@ -1,18 +0,0 @@ -trait SipHash { - fn reset(&self); -} - -fn siphash(k0 : u64) { - struct SipState { - v0: u64, - } - - impl SipHash for SipState { - fn reset(&self) { - self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment - } - } - panic!(); -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-3021.stderr b/src/test/ui/resolve/issue-3021.stderr deleted file mode 100644 index d5b015eec..000000000 --- a/src/test/ui/resolve/issue-3021.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0434]: can't capture dynamic environment in a fn item - --> $DIR/issue-3021.rs:12:22 - | -LL | self.v0 = k0 ^ 0x736f6d6570736575; - | ^^ - | - = help: use the `|| { ... }` closure form instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0434`. diff --git a/src/test/ui/resolve/issue-31845.rs b/src/test/ui/resolve/issue-31845.rs deleted file mode 100644 index f6dc11502..000000000 --- a/src/test/ui/resolve/issue-31845.rs +++ /dev/null @@ -1,12 +0,0 @@ -// Checks lexical scopes cannot see through normal module boundaries - -fn f() { - fn g() {} - mod foo { - fn h() { - g(); //~ ERROR cannot find function `g` in this scope - } - } -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-31845.stderr b/src/test/ui/resolve/issue-31845.stderr deleted file mode 100644 index 562819385..000000000 --- a/src/test/ui/resolve/issue-31845.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0425]: cannot find function `g` in this scope - --> $DIR/issue-31845.rs:7:12 - | -LL | g(); - | ^ not found in this scope - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/issue-33876.rs b/src/test/ui/resolve/issue-33876.rs deleted file mode 100644 index e233ec631..000000000 --- a/src/test/ui/resolve/issue-33876.rs +++ /dev/null @@ -1,12 +0,0 @@ -use std::any::Any; - -struct Foo; - -trait Bar {} - -impl Bar for Foo {} - -fn main() { - let any: &dyn Any = &Bar; //~ ERROR expected value, found trait `Bar` - if any.is::<u32>() { println!("u32"); } -} diff --git a/src/test/ui/resolve/issue-33876.stderr b/src/test/ui/resolve/issue-33876.stderr deleted file mode 100644 index 52308f2a7..000000000 --- a/src/test/ui/resolve/issue-33876.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0423]: expected value, found trait `Bar` - --> $DIR/issue-33876.rs:10:26 - | -LL | let any: &dyn Any = &Bar; - | ^^^ not a value - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0423`. diff --git a/src/test/ui/resolve/issue-35675.rs b/src/test/ui/resolve/issue-35675.rs deleted file mode 100644 index 683761667..000000000 --- a/src/test/ui/resolve/issue-35675.rs +++ /dev/null @@ -1,42 +0,0 @@ -// these two HELPs are actually in a new line between this line and the `enum Fruit` line -enum Fruit { - Apple(i64), - Orange(i64), -} - -fn should_return_fruit() -> Apple { - //~^ ERROR cannot find type `Apple` in this scope - Apple(5) - //~^ ERROR cannot find function, tuple struct or tuple variant `Apple` in this scope -} - -fn should_return_fruit_too() -> Fruit::Apple { - //~^ ERROR expected type, found variant `Fruit::Apple` - Apple(5) - //~^ ERROR cannot find function, tuple struct or tuple variant `Apple` in this scope -} - -fn foo() -> Ok { - //~^ ERROR expected type, found variant `Ok` - Ok(()) -} - -fn bar() -> Variant3 { - //~^ ERROR cannot find type `Variant3` in this scope -} - -fn qux() -> Some { - //~^ ERROR expected type, found variant `Some` - Some(1) -} - -fn main() {} - -mod x { - pub enum Enum { - Variant1, - Variant2(), - Variant3(usize), - Variant4 {}, - } -} diff --git a/src/test/ui/resolve/issue-35675.stderr b/src/test/ui/resolve/issue-35675.stderr deleted file mode 100644 index 4a06196d5..000000000 --- a/src/test/ui/resolve/issue-35675.stderr +++ /dev/null @@ -1,75 +0,0 @@ -error[E0412]: cannot find type `Apple` in this scope - --> $DIR/issue-35675.rs:7:29 - | -LL | fn should_return_fruit() -> Apple { - | ^^^^^ not found in this scope - | -help: there is an enum variant `Fruit::Apple`; try using the variant's enum - | -LL | fn should_return_fruit() -> Fruit { - | ~~~~~ - -error[E0425]: cannot find function, tuple struct or tuple variant `Apple` in this scope - --> $DIR/issue-35675.rs:9:5 - | -LL | Apple(5) - | ^^^^^ not found in this scope - | -help: consider importing this tuple variant - | -LL | use Fruit::Apple; - | - -error[E0573]: expected type, found variant `Fruit::Apple` - --> $DIR/issue-35675.rs:13:33 - | -LL | fn should_return_fruit_too() -> Fruit::Apple { - | ^^^^^^^^^^^^ - | | - | not a type - | help: try using the variant's enum: `Fruit` - -error[E0425]: cannot find function, tuple struct or tuple variant `Apple` in this scope - --> $DIR/issue-35675.rs:15:5 - | -LL | Apple(5) - | ^^^^^ not found in this scope - | -help: consider importing this tuple variant - | -LL | use Fruit::Apple; - | - -error[E0573]: expected type, found variant `Ok` - --> $DIR/issue-35675.rs:19:13 - | -LL | fn foo() -> Ok { - | ^^ - | | - | not a type - | help: try using the variant's enum: `std::result::Result` - -error[E0412]: cannot find type `Variant3` in this scope - --> $DIR/issue-35675.rs:24:13 - | -LL | fn bar() -> Variant3 { - | ^^^^^^^^ not found in this scope - | -help: there is an enum variant `x::Enum::Variant3`; try using the variant's enum - | -LL | fn bar() -> x::Enum { - | ~~~~~~~ - -error[E0573]: expected type, found variant `Some` - --> $DIR/issue-35675.rs:28:13 - | -LL | fn qux() -> Some { - | ^^^^ - | | - | not a type - | help: try using the variant's enum: `std::option::Option` - -error: aborting due to 7 previous errors - -Some errors have detailed explanations: E0412, E0425, E0573. -For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/ui/resolve/issue-3907-2.rs b/src/test/ui/resolve/issue-3907-2.rs deleted file mode 100644 index 46f145e63..000000000 --- a/src/test/ui/resolve/issue-3907-2.rs +++ /dev/null @@ -1,14 +0,0 @@ -// aux-build:issue-3907.rs - -extern crate issue_3907; - -type Foo = dyn issue_3907::Foo + 'static; - -struct S { - name: isize -} - -fn bar(_x: Foo) {} -//~^ ERROR E0038 - -fn main() {} diff --git a/src/test/ui/resolve/issue-3907-2.stderr b/src/test/ui/resolve/issue-3907-2.stderr deleted file mode 100644 index 782cfeec4..000000000 --- a/src/test/ui/resolve/issue-3907-2.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0038]: the trait `issue_3907::Foo` cannot be made into an object - --> $DIR/issue-3907-2.rs:11:12 - | -LL | fn bar(_x: Foo) {} - | ^^^ `issue_3907::Foo` cannot be made into an object - | -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> - --> $DIR/auxiliary/issue-3907.rs:2:8 - | -LL | fn bar(); - | ^^^ the trait cannot be made into an object because associated function `bar` has no `self` parameter - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/ui/resolve/issue-3907.rs b/src/test/ui/resolve/issue-3907.rs deleted file mode 100644 index 6211de427..000000000 --- a/src/test/ui/resolve/issue-3907.rs +++ /dev/null @@ -1,20 +0,0 @@ -// aux-build:issue-3907.rs - -extern crate issue_3907; - -type Foo = dyn issue_3907::Foo; - -struct S { - name: isize -} - -impl Foo for S { //~ ERROR expected trait, found type alias `Foo` - fn bar() { } -} - -fn main() { - let s = S { - name: 0 - }; - s.bar(); -} diff --git a/src/test/ui/resolve/issue-3907.stderr b/src/test/ui/resolve/issue-3907.stderr deleted file mode 100644 index 6fc61cae8..000000000 --- a/src/test/ui/resolve/issue-3907.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0404]: expected trait, found type alias `Foo` - --> $DIR/issue-3907.rs:11:6 - | -LL | impl Foo for S { - | ^^^ type aliases cannot be used as traits - | -help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias - | -LL | trait Foo = dyn issue_3907::Foo; - | -help: consider importing this trait instead - | -LL | use issue_3907::Foo; - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0404`. diff --git a/src/test/ui/resolve/issue-39226.rs b/src/test/ui/resolve/issue-39226.rs deleted file mode 100644 index 0f784f02b..000000000 --- a/src/test/ui/resolve/issue-39226.rs +++ /dev/null @@ -1,14 +0,0 @@ -struct Handle {} - -struct Something { - handle: Handle -} - -fn main() { - let handle: Handle = Handle {}; - - let s: Something = Something { - handle: Handle - //~^ ERROR expected value, found struct `Handle` - }; -} diff --git a/src/test/ui/resolve/issue-39226.stderr b/src/test/ui/resolve/issue-39226.stderr deleted file mode 100644 index 5045ec6c3..000000000 --- a/src/test/ui/resolve/issue-39226.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0423]: expected value, found struct `Handle` - --> $DIR/issue-39226.rs:11:17 - | -LL | struct Handle {} - | ---------------- `Handle` defined here -... -LL | handle: Handle - | ^^^^^^ - | -help: use struct literal syntax instead - | -LL | handle: Handle {} - | ~~~~~~~~~ -help: a local variable with a similar name exists - | -LL | handle: handle - | ~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0423`. diff --git a/src/test/ui/resolve/issue-42944.rs b/src/test/ui/resolve/issue-42944.rs deleted file mode 100644 index a4404857a..000000000 --- a/src/test/ui/resolve/issue-42944.rs +++ /dev/null @@ -1,21 +0,0 @@ -mod foo { - pub struct Bx(()); -} - -mod bar { - use foo::Bx; - - fn foo() { - Bx(()); - //~^ ERROR cannot initialize a tuple struct which contains private fields [E0423] - } -} - -mod baz { - fn foo() { - Bx(()); - //~^ ERROR cannot find function, tuple struct or tuple variant `Bx` in this scope [E0425] - } -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-42944.stderr b/src/test/ui/resolve/issue-42944.stderr deleted file mode 100644 index 0ee9fd391..000000000 --- a/src/test/ui/resolve/issue-42944.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error[E0425]: cannot find function, tuple struct or tuple variant `Bx` in this scope - --> $DIR/issue-42944.rs:16:9 - | -LL | Bx(()); - | ^^ not found in this scope - | -note: tuple struct `foo::Bx` exists but is inaccessible - --> $DIR/issue-42944.rs:2:5 - | -LL | pub struct Bx(()); - | ^^^^^^^^^^^^^^^^^^ not accessible - -error[E0423]: cannot initialize a tuple struct which contains private fields - --> $DIR/issue-42944.rs:9:9 - | -LL | Bx(()); - | ^^ - | -note: constructor is not visible here due to private fields - --> $DIR/issue-42944.rs:2:19 - | -LL | pub struct Bx(()); - | ^^ private field - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0423, E0425. -For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/ui/resolve/issue-49074.rs b/src/test/ui/resolve/issue-49074.rs deleted file mode 100644 index 752bb345b..000000000 --- a/src/test/ui/resolve/issue-49074.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Check that unknown attribute error is shown even if there are unresolved macros. - -#[marco_use] // typo -//~^ ERROR cannot find attribute `marco_use` in this scope -mod foo { - macro_rules! bar { - () => (); - } -} - -fn main() { - bar!(); //~ ERROR cannot find macro `bar` in this scope -} diff --git a/src/test/ui/resolve/issue-49074.stderr b/src/test/ui/resolve/issue-49074.stderr deleted file mode 100644 index bbfeb4ea9..000000000 --- a/src/test/ui/resolve/issue-49074.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error: cannot find macro `bar` in this scope - --> $DIR/issue-49074.rs:12:4 - | -LL | bar!(); - | ^^^ - | - = help: have you added the `#[macro_use]` on the module/import? - -error: cannot find attribute `marco_use` in this scope - --> $DIR/issue-49074.rs:3:3 - | -LL | #[marco_use] // typo - | ^^^^^^^^^ help: a built-in attribute with a similar name exists: `macro_use` - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/resolve/issue-5035-2.rs b/src/test/ui/resolve/issue-5035-2.rs deleted file mode 100644 index b831bb4be..000000000 --- a/src/test/ui/resolve/issue-5035-2.rs +++ /dev/null @@ -1,7 +0,0 @@ -trait I {} -type K = dyn I + 'static; - -fn foo(_x: K) {} -//~^ ERROR the size for values of type - -fn main() {} diff --git a/src/test/ui/resolve/issue-5035-2.stderr b/src/test/ui/resolve/issue-5035-2.stderr deleted file mode 100644 index 939392733..000000000 --- a/src/test/ui/resolve/issue-5035-2.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0277]: the size for values of type `(dyn I + 'static)` cannot be known at compilation time - --> $DIR/issue-5035-2.rs:4:8 - | -LL | fn foo(_x: K) {} - | ^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `(dyn I + 'static)` - = help: unsized fn params are gated as an unstable feature -help: function arguments must have a statically known size, borrowed types always have a known size - | -LL | fn foo(_x: &K) {} - | + - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/resolve/issue-5035.rs b/src/test/ui/resolve/issue-5035.rs deleted file mode 100644 index 49fa312f9..000000000 --- a/src/test/ui/resolve/issue-5035.rs +++ /dev/null @@ -1,9 +0,0 @@ -trait I {} -type K = dyn I; -impl K for isize {} //~ ERROR expected trait, found type alias `K` - -use ImportError; //~ ERROR unresolved import `ImportError` [E0432] - //~^ no `ImportError` in the root -impl ImportError for () {} // check that this is not an additional error (cf. issue #35142) - -fn main() {} diff --git a/src/test/ui/resolve/issue-5035.stderr b/src/test/ui/resolve/issue-5035.stderr deleted file mode 100644 index 32b972b21..000000000 --- a/src/test/ui/resolve/issue-5035.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error[E0432]: unresolved import `ImportError` - --> $DIR/issue-5035.rs:5:5 - | -LL | use ImportError; - | ^^^^^^^^^^^ no `ImportError` in the root - -error[E0404]: expected trait, found type alias `K` - --> $DIR/issue-5035.rs:3:6 - | -LL | trait I {} - | ------- similarly named trait `I` defined here -LL | type K = dyn I; -LL | impl K for isize {} - | ^ type aliases cannot be used as traits - | -help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias - | -LL | trait K = dyn I; - | -help: a trait with a similar name exists - | -LL | impl I for isize {} - | ~ - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0404, E0432. -For more information about an error, try `rustc --explain E0404`. diff --git a/src/test/ui/resolve/issue-50599.rs b/src/test/ui/resolve/issue-50599.rs deleted file mode 100644 index 72238a591..000000000 --- a/src/test/ui/resolve/issue-50599.rs +++ /dev/null @@ -1,6 +0,0 @@ -fn main() { - const N: u32 = 1_000; - const M: usize = (f64::from(N) * std::f64::LOG10_2) as usize; //~ ERROR cannot find value - let mut digits = [0u32; M]; - //~^ constant -} diff --git a/src/test/ui/resolve/issue-50599.stderr b/src/test/ui/resolve/issue-50599.stderr deleted file mode 100644 index b07482c83..000000000 --- a/src/test/ui/resolve/issue-50599.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0425]: cannot find value `LOG10_2` in module `std::f64` - --> $DIR/issue-50599.rs:3:48 - | -LL | const M: usize = (f64::from(N) * std::f64::LOG10_2) as usize; - | ^^^^^^^ not found in `std::f64` - | -help: consider importing one of these items - | -LL | use std::f32::consts::LOG10_2; - | -LL | use std::f64::consts::LOG10_2; - | -help: if you import `LOG10_2`, refer to it directly - | -LL - const M: usize = (f64::from(N) * std::f64::LOG10_2) as usize; -LL + const M: usize = (f64::from(N) * LOG10_2) as usize; - | - -note: erroneous constant used - --> $DIR/issue-50599.rs:4:29 - | -LL | let mut digits = [0u32; M]; - | ^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/issue-5099.rs b/src/test/ui/resolve/issue-5099.rs deleted file mode 100644 index b5abccb4b..000000000 --- a/src/test/ui/resolve/issue-5099.rs +++ /dev/null @@ -1,13 +0,0 @@ -trait B <A> { - fn a() -> A { - this.a //~ ERROR cannot find value `this` in this scope - } - fn b(x: i32) { - this.b(x); //~ ERROR cannot find value `this` in this scope - } - fn c() { - let _ = || this.a; //~ ERROR cannot find value `this` in this scope - } -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-5099.stderr b/src/test/ui/resolve/issue-5099.stderr deleted file mode 100644 index e9b2a9c4d..000000000 --- a/src/test/ui/resolve/issue-5099.stderr +++ /dev/null @@ -1,48 +0,0 @@ -error[E0425]: cannot find value `this` in this scope - --> $DIR/issue-5099.rs:3:9 - | -LL | this.a - | ^^^^ not found in this scope - | -help: you might have meant to use `self` here instead - | -LL | self.a - | ~~~~ -help: if you meant to use `self`, you are also missing a `self` receiver argument - | -LL | fn a(&self) -> A { - | +++++ - -error[E0425]: cannot find value `this` in this scope - --> $DIR/issue-5099.rs:6:9 - | -LL | this.b(x); - | ^^^^ not found in this scope - | -help: you might have meant to use `self` here instead - | -LL | self.b(x); - | ~~~~ -help: if you meant to use `self`, you are also missing a `self` receiver argument - | -LL | fn b(&self, x: i32) { - | ++++++ - -error[E0425]: cannot find value `this` in this scope - --> $DIR/issue-5099.rs:9:20 - | -LL | let _ = || this.a; - | ^^^^ not found in this scope - | -help: you might have meant to use `self` here instead - | -LL | let _ = || self.a; - | ~~~~ -help: if you meant to use `self`, you are also missing a `self` receiver argument - | -LL | fn c(&self) { - | +++++ - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/issue-54379.rs b/src/test/ui/resolve/issue-54379.rs deleted file mode 100644 index 807c54393..000000000 --- a/src/test/ui/resolve/issue-54379.rs +++ /dev/null @@ -1,14 +0,0 @@ -struct MyStruct { - pub s1: Option<String>, -} - -fn main() { - let thing = MyStruct { s1: None }; - - match thing { - MyStruct { .., Some(_) } => {}, - //~^ ERROR expected `,` - //~| ERROR expected `}`, found `,` - _ => {} - } -} diff --git a/src/test/ui/resolve/issue-54379.stderr b/src/test/ui/resolve/issue-54379.stderr deleted file mode 100644 index 750727273..000000000 --- a/src/test/ui/resolve/issue-54379.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error: expected `}`, found `,` - --> $DIR/issue-54379.rs:9:22 - | -LL | MyStruct { .., Some(_) } => {}, - | --^ - | | | - | | expected `}` - | `..` must be at the end and cannot have a trailing comma - -error: expected `,` - --> $DIR/issue-54379.rs:9:28 - | -LL | MyStruct { .., Some(_) } => {}, - | -------- ^ - | | - | while parsing the fields for this pattern - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/resolve/issue-55673.rs b/src/test/ui/resolve/issue-55673.rs deleted file mode 100644 index 0436bd397..000000000 --- a/src/test/ui/resolve/issue-55673.rs +++ /dev/null @@ -1,12 +0,0 @@ -trait Foo { - type Bar; -} - -fn foo<T: Foo>() -where - T::Baa: std::fmt::Debug, - //~^ ERROR associated type `Baa` not found for `T` -{ -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-55673.stderr b/src/test/ui/resolve/issue-55673.stderr deleted file mode 100644 index 39318f959..000000000 --- a/src/test/ui/resolve/issue-55673.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0220]: associated type `Baa` not found for `T` - --> $DIR/issue-55673.rs:7:8 - | -LL | T::Baa: std::fmt::Debug, - | ^^^ there is a similarly named associated type `Bar` in the trait `Foo` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0220`. diff --git a/src/test/ui/resolve/issue-57523.rs b/src/test/ui/resolve/issue-57523.rs deleted file mode 100644 index 976238cc3..000000000 --- a/src/test/ui/resolve/issue-57523.rs +++ /dev/null @@ -1,21 +0,0 @@ -// check-pass - -struct S(u8); - -impl S { - fn method1() -> Self { - Self(0) - } -} - -macro_rules! define_method { () => { - impl S { - fn method2() -> Self { - Self(0) // OK - } - } -}} - -define_method!(); - -fn main() {} diff --git a/src/test/ui/resolve/issue-5927.rs b/src/test/ui/resolve/issue-5927.rs deleted file mode 100644 index 14f95827b..000000000 --- a/src/test/ui/resolve/issue-5927.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - let z = match 3 { - x(1) => x(1) //~ ERROR cannot find tuple struct or tuple variant `x` in this scope - //~^ ERROR cannot find function `x` in this scope - }; - assert!(z == 3); -} diff --git a/src/test/ui/resolve/issue-5927.stderr b/src/test/ui/resolve/issue-5927.stderr deleted file mode 100644 index d6cd6853d..000000000 --- a/src/test/ui/resolve/issue-5927.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0531]: cannot find tuple struct or tuple variant `x` in this scope - --> $DIR/issue-5927.rs:3:9 - | -LL | x(1) => x(1) - | ^ not found in this scope - -error[E0425]: cannot find function `x` in this scope - --> $DIR/issue-5927.rs:3:17 - | -LL | x(1) => x(1) - | ^ not found in this scope - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0425, E0531. -For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/issue-60057.rs b/src/test/ui/resolve/issue-60057.rs deleted file mode 100644 index b52343ada..000000000 --- a/src/test/ui/resolve/issue-60057.rs +++ /dev/null @@ -1,19 +0,0 @@ -struct A { - banana: u8, -} - -impl A { - fn new(peach: u8) -> A { - A { - banana: banana //~ ERROR cannot find value `banana` in this scope - } - } - - fn foo(&self, peach: u8) -> A { - A { - banana: banana //~ ERROR cannot find value `banana` in this scope - } - } -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-60057.stderr b/src/test/ui/resolve/issue-60057.stderr deleted file mode 100644 index 4d915fcd9..000000000 --- a/src/test/ui/resolve/issue-60057.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0425]: cannot find value `banana` in this scope - --> $DIR/issue-60057.rs:8:21 - | -LL | banana: banana - | ^^^^^^ a field by this name exists in `Self` - -error[E0425]: cannot find value `banana` in this scope - --> $DIR/issue-60057.rs:14:21 - | -LL | banana: banana - | ^^^^^^ help: you might have meant to use the available field: `self.banana` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/issue-65025-extern-static-parent-generics.rs b/src/test/ui/resolve/issue-65025-extern-static-parent-generics.rs deleted file mode 100644 index ce45f630e..000000000 --- a/src/test/ui/resolve/issue-65025-extern-static-parent-generics.rs +++ /dev/null @@ -1,10 +0,0 @@ -unsafe fn foo<A>() { - extern "C" { - static baz: *const A; - //~^ ERROR can't use generic parameters from outer function - } - - let bar: *const u64 = core::mem::transmute(&baz); -} - -fn main() { } diff --git a/src/test/ui/resolve/issue-65025-extern-static-parent-generics.stderr b/src/test/ui/resolve/issue-65025-extern-static-parent-generics.stderr deleted file mode 100644 index 6bbf76dd1..000000000 --- a/src/test/ui/resolve/issue-65025-extern-static-parent-generics.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0401]: can't use generic parameters from outer function - --> $DIR/issue-65025-extern-static-parent-generics.rs:3:28 - | -LL | unsafe fn foo<A>() { - | - type parameter from outer function -LL | extern "C" { -LL | static baz: *const A; - | ^ use of generic parameter from outer function - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/resolve/issue-65035-static-with-parent-generics.rs b/src/test/ui/resolve/issue-65035-static-with-parent-generics.rs deleted file mode 100644 index f96c04841..000000000 --- a/src/test/ui/resolve/issue-65035-static-with-parent-generics.rs +++ /dev/null @@ -1,26 +0,0 @@ -fn f<T>() { - extern "C" { - static a: *const T; - //~^ ERROR can't use generic parameters from outer function - } -} - -fn g<T: Default>() { - static a: *const T = Default::default(); - //~^ ERROR can't use generic parameters from outer function -} - -fn h<const N: usize>() { - extern "C" { - static a: [u8; N]; - //~^ ERROR can't use generic parameters from outer function - } -} - -fn i<const N: usize>() { - static a: [u8; N] = [0; N]; - //~^ ERROR can't use generic parameters from outer function - //~| ERROR can't use generic parameters from outer function -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-65035-static-with-parent-generics.stderr b/src/test/ui/resolve/issue-65035-static-with-parent-generics.stderr deleted file mode 100644 index 7ed572f80..000000000 --- a/src/test/ui/resolve/issue-65035-static-with-parent-generics.stderr +++ /dev/null @@ -1,45 +0,0 @@ -error[E0401]: can't use generic parameters from outer function - --> $DIR/issue-65035-static-with-parent-generics.rs:3:26 - | -LL | fn f<T>() { - | - type parameter from outer function -LL | extern "C" { -LL | static a: *const T; - | ^ use of generic parameter from outer function - -error[E0401]: can't use generic parameters from outer function - --> $DIR/issue-65035-static-with-parent-generics.rs:9:22 - | -LL | fn g<T: Default>() { - | - type parameter from outer function -LL | static a: *const T = Default::default(); - | ^ use of generic parameter from outer function - -error[E0401]: can't use generic parameters from outer function - --> $DIR/issue-65035-static-with-parent-generics.rs:15:24 - | -LL | fn h<const N: usize>() { - | - const parameter from outer function -LL | extern "C" { -LL | static a: [u8; N]; - | ^ use of generic parameter from outer function - -error[E0401]: can't use generic parameters from outer function - --> $DIR/issue-65035-static-with-parent-generics.rs:21:20 - | -LL | fn i<const N: usize>() { - | - const parameter from outer function -LL | static a: [u8; N] = [0; N]; - | ^ use of generic parameter from outer function - -error[E0401]: can't use generic parameters from outer function - --> $DIR/issue-65035-static-with-parent-generics.rs:21:29 - | -LL | fn i<const N: usize>() { - | - const parameter from outer function -LL | static a: [u8; N] = [0; N]; - | ^ use of generic parameter from outer function - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/resolve/issue-6702.rs b/src/test/ui/resolve/issue-6702.rs deleted file mode 100644 index 954dc36f3..000000000 --- a/src/test/ui/resolve/issue-6702.rs +++ /dev/null @@ -1,9 +0,0 @@ -struct Monster { - damage: isize -} - - -fn main() { - let _m = Monster(); - //~^ ERROR expected function, tuple struct or tuple variant, found struct `Monster` -} diff --git a/src/test/ui/resolve/issue-6702.stderr b/src/test/ui/resolve/issue-6702.stderr deleted file mode 100644 index a118f9419..000000000 --- a/src/test/ui/resolve/issue-6702.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0423]: expected function, tuple struct or tuple variant, found struct `Monster` - --> $DIR/issue-6702.rs:7:14 - | -LL | / struct Monster { -LL | | damage: isize -LL | | } - | |_- `Monster` defined here -... -LL | let _m = Monster(); - | ^^^^^^^^^ help: use struct literal syntax instead: `Monster { damage: val }` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0423`. diff --git a/src/test/ui/resolve/issue-69401-trait-fn-no-body-ty-local.rs b/src/test/ui/resolve/issue-69401-trait-fn-no-body-ty-local.rs deleted file mode 100644 index c377ecea9..000000000 --- a/src/test/ui/resolve/issue-69401-trait-fn-no-body-ty-local.rs +++ /dev/null @@ -1,6 +0,0 @@ -fn main() {} - -trait Foo { - fn fn_with_type_named_same_as_local_in_param(b: b); - //~^ ERROR cannot find type `b` in this scope [E0412] -} diff --git a/src/test/ui/resolve/issue-69401-trait-fn-no-body-ty-local.stderr b/src/test/ui/resolve/issue-69401-trait-fn-no-body-ty-local.stderr deleted file mode 100644 index 109409d27..000000000 --- a/src/test/ui/resolve/issue-69401-trait-fn-no-body-ty-local.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0412]: cannot find type `b` in this scope - --> $DIR/issue-69401-trait-fn-no-body-ty-local.rs:4:53 - | -LL | fn fn_with_type_named_same_as_local_in_param(b: b); - | ^ not found in this scope - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.rs b/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.rs deleted file mode 100644 index 49462f52f..000000000 --- a/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.rs +++ /dev/null @@ -1,19 +0,0 @@ -// edition:2018 - -async fn free(); //~ ERROR without a body - -struct A; -impl A { - async fn inherent(); //~ ERROR without body -} - -trait B { - async fn associated(); - //~^ ERROR cannot be declared `async` -} -impl B for A { - async fn associated(); //~ ERROR without body - //~^ ERROR cannot be declared `async` -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr b/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr deleted file mode 100644 index 1354abb4f..000000000 --- a/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr +++ /dev/null @@ -1,53 +0,0 @@ -error: free function without a body - --> $DIR/issue-70736-async-fn-no-body-def-collector.rs:3:1 - | -LL | async fn free(); - | ^^^^^^^^^^^^^^^- - | | - | help: provide a definition for the function: `{ <body> }` - -error: associated function in `impl` without body - --> $DIR/issue-70736-async-fn-no-body-def-collector.rs:7:5 - | -LL | async fn inherent(); - | ^^^^^^^^^^^^^^^^^^^- - | | - | help: provide a definition for the function: `{ <body> }` - -error: associated function in `impl` without body - --> $DIR/issue-70736-async-fn-no-body-def-collector.rs:15:5 - | -LL | async fn associated(); - | ^^^^^^^^^^^^^^^^^^^^^- - | | - | help: provide a definition for the function: `{ <body> }` - -error[E0706]: functions in traits cannot be declared `async` - --> $DIR/issue-70736-async-fn-no-body-def-collector.rs:11:5 - | -LL | async fn associated(); - | -----^^^^^^^^^^^^^^^^^ - | | - | `async` because of this - | - = note: `async` trait functions are not currently supported - = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait - = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information - = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable - -error[E0706]: functions in traits cannot be declared `async` - --> $DIR/issue-70736-async-fn-no-body-def-collector.rs:15:5 - | -LL | async fn associated(); - | -----^^^^^^^^^^^^^^^^^ - | | - | `async` because of this - | - = note: `async` trait functions are not currently supported - = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait - = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information - = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0706`. diff --git a/src/test/ui/resolve/issue-73427.rs b/src/test/ui/resolve/issue-73427.rs deleted file mode 100644 index 5c2459a59..000000000 --- a/src/test/ui/resolve/issue-73427.rs +++ /dev/null @@ -1,50 +0,0 @@ -enum A { - StructWithFields { x: () }, - TupleWithFields(()), - Struct {}, - Tuple(), - Unit, -} - -enum B { - StructWithFields { x: () }, - TupleWithFields(()), -} - -enum C { - StructWithFields { x: () }, - TupleWithFields(()), - Unit, -} - -enum D { - TupleWithFields(()), - Unit, -} - -enum E { - TupleWithFields(()), -} - -fn main() { - // Only variants without fields are suggested (and others mentioned in a note) where an enum - // is used rather than a variant. - - A.foo(); - //~^ ERROR expected value, found enum `A` - B.foo(); - //~^ ERROR expected value, found enum `B` - C.foo(); - //~^ ERROR expected value, found enum `C` - D.foo(); - //~^ ERROR expected value, found enum `D` - E.foo(); - //~^ ERROR expected value, found enum `E` - - // Only tuple variants are suggested in calls or tuple struct pattern matching. - - let x = A(3); - //~^ ERROR expected function, tuple struct or tuple variant, found enum `A` - if let A(3) = x { } - //~^ ERROR expected tuple struct or tuple variant, found enum `A` -} diff --git a/src/test/ui/resolve/issue-73427.stderr b/src/test/ui/resolve/issue-73427.stderr deleted file mode 100644 index 4af5f29d8..000000000 --- a/src/test/ui/resolve/issue-73427.stderr +++ /dev/null @@ -1,168 +0,0 @@ -error[E0423]: expected value, found enum `A` - --> $DIR/issue-73427.rs:33:5 - | -LL | A.foo(); - | ^ - | -note: the enum is defined here - --> $DIR/issue-73427.rs:1:1 - | -LL | / enum A { -LL | | StructWithFields { x: () }, -LL | | TupleWithFields(()), -LL | | Struct {}, -LL | | Tuple(), -LL | | Unit, -LL | | } - | |_^ -help: you might have meant to use one of the following enum variants - | -LL | (A::Tuple()).foo(); - | ~~~~~~~~~~~~ -LL | A::Unit.foo(); - | ~~~~~~~ -help: alternatively, the following enum variant is available - | -LL | (A::TupleWithFields(/* fields */)).foo(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0423]: expected value, found enum `B` - --> $DIR/issue-73427.rs:35:5 - | -LL | B.foo(); - | ^ help: the following enum variant is available: `(B::TupleWithFields(/* fields */))` - | -note: the enum is defined here - --> $DIR/issue-73427.rs:9:1 - | -LL | / enum B { -LL | | StructWithFields { x: () }, -LL | | TupleWithFields(()), -LL | | } - | |_^ - -error[E0423]: expected value, found enum `C` - --> $DIR/issue-73427.rs:37:5 - | -LL | C.foo(); - | ^ - | -note: the enum is defined here - --> $DIR/issue-73427.rs:14:1 - | -LL | / enum C { -LL | | StructWithFields { x: () }, -LL | | TupleWithFields(()), -LL | | Unit, -LL | | } - | |_^ -help: you might have meant to use the following enum variant - | -LL | C::Unit.foo(); - | ~~~~~~~ -help: alternatively, the following enum variant is available - | -LL | (C::TupleWithFields(/* fields */)).foo(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0423]: expected value, found enum `D` - --> $DIR/issue-73427.rs:39:5 - | -LL | D.foo(); - | ^ - | -note: the enum is defined here - --> $DIR/issue-73427.rs:20:1 - | -LL | / enum D { -LL | | TupleWithFields(()), -LL | | Unit, -LL | | } - | |_^ -help: you might have meant to use the following enum variant - | -LL | D::Unit.foo(); - | ~~~~~~~ -help: alternatively, the following enum variant is available - | -LL | (D::TupleWithFields(/* fields */)).foo(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0423]: expected value, found enum `E` - --> $DIR/issue-73427.rs:41:5 - | -LL | E.foo(); - | ^ - | -note: the enum is defined here - --> $DIR/issue-73427.rs:25:1 - | -LL | / enum E { -LL | | TupleWithFields(()), -LL | | } - | |_^ -help: the following enum variant is available - | -LL | (E::TupleWithFields(/* fields */)).foo(); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -help: consider importing one of these items instead - | -LL | use std::f32::consts::E; - | -LL | use std::f64::consts::E; - | - -error[E0532]: expected tuple struct or tuple variant, found enum `A` - --> $DIR/issue-73427.rs:48:12 - | -LL | if let A(3) = x { } - | ^ - | - = help: you might have meant to match against the enum's non-tuple variant -note: the enum is defined here - --> $DIR/issue-73427.rs:1:1 - | -LL | / enum A { -LL | | StructWithFields { x: () }, -LL | | TupleWithFields(()), -LL | | Struct {}, -LL | | Tuple(), -LL | | Unit, -LL | | } - | |_^ -help: try to match against one of the enum's variants - | -LL | if let A::Tuple(3) = x { } - | ~~~~~~~~ -LL | if let A::TupleWithFields(3) = x { } - | ~~~~~~~~~~~~~~~~~~ - -error[E0423]: expected function, tuple struct or tuple variant, found enum `A` - --> $DIR/issue-73427.rs:46:13 - | -LL | let x = A(3); - | ^ - | - = help: you might have meant to construct the enum's non-tuple variant -note: the enum is defined here - --> $DIR/issue-73427.rs:1:1 - | -LL | / enum A { -LL | | StructWithFields { x: () }, -LL | | TupleWithFields(()), -LL | | Struct {}, -LL | | Tuple(), -LL | | Unit, -LL | | } - | |_^ -help: try to construct one of the enum's variants - | -LL | let x = A::Tuple(3); - | ~~~~~~~~ -LL | let x = A::TupleWithFields(3); - | ~~~~~~~~~~~~~~~~~~ - -error: aborting due to 7 previous errors - -Some errors have detailed explanations: E0423, E0532. -For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/ui/resolve/issue-80079.rs b/src/test/ui/resolve/issue-80079.rs deleted file mode 100644 index 4795ed062..000000000 --- a/src/test/ui/resolve/issue-80079.rs +++ /dev/null @@ -1,12 +0,0 @@ -// aux-build:issue-80079.rs - -// using a module from another crate should not cause errors to suggest private -// items in that module - -extern crate issue_80079; - -use issue_80079::public; - -fn main() { - let _ = Foo; //~ ERROR cannot find value `Foo` in this scope -} diff --git a/src/test/ui/resolve/issue-80079.stderr b/src/test/ui/resolve/issue-80079.stderr deleted file mode 100644 index 93e8c0341..000000000 --- a/src/test/ui/resolve/issue-80079.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0425]: cannot find value `Foo` in this scope - --> $DIR/issue-80079.rs:11:13 - | -LL | let _ = Foo; - | ^^^ not found in this scope - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/issue-81508.rs b/src/test/ui/resolve/issue-81508.rs deleted file mode 100644 index 23605cd2f..000000000 --- a/src/test/ui/resolve/issue-81508.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Confusing diagnostic when using variable as a type: -// -// Previous warnings indicate Foo is not used, when in fact it is -// used improperly as a variable or constant. New warning points -// out user may be trying to use variable as a type. Test demonstrates -// cases for both local variable and const. - -fn main() { - let Baz: &str = ""; - - println!("{}", Baz::Bar); //~ ERROR: failed to resolve: use of undeclared type `Baz` -} - -#[allow(non_upper_case_globals)] -pub const Foo: &str = ""; - -mod submod { - use super::Foo; - fn function() { - println!("{}", Foo::Bar); //~ ERROR: failed to resolve: use of undeclared type `Foo` - } -} diff --git a/src/test/ui/resolve/issue-81508.stderr b/src/test/ui/resolve/issue-81508.stderr deleted file mode 100644 index 7258174ba..000000000 --- a/src/test/ui/resolve/issue-81508.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0433]: failed to resolve: use of undeclared type `Baz` - --> $DIR/issue-81508.rs:11:20 - | -LL | let Baz: &str = ""; - | --- help: `Baz` is defined here, but is not a type -LL | -LL | println!("{}", Baz::Bar); - | ^^^ use of undeclared type `Baz` - -error[E0433]: failed to resolve: use of undeclared type `Foo` - --> $DIR/issue-81508.rs:20:24 - | -LL | use super::Foo; - | ---------- help: `Foo` is defined here, but is not a type -LL | fn function() { -LL | println!("{}", Foo::Bar); - | ^^^ use of undeclared type `Foo` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/resolve/issue-82156.rs b/src/test/ui/resolve/issue-82156.rs deleted file mode 100644 index 6215259e4..000000000 --- a/src/test/ui/resolve/issue-82156.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - super(); //~ ERROR failed to resolve: there are too many leading `super` keywords -} diff --git a/src/test/ui/resolve/issue-82156.stderr b/src/test/ui/resolve/issue-82156.stderr deleted file mode 100644 index d53599dcc..000000000 --- a/src/test/ui/resolve/issue-82156.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0433]: failed to resolve: there are too many leading `super` keywords - --> $DIR/issue-82156.rs:2:5 - | -LL | super(); - | ^^^^^ there are too many leading `super` keywords - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/resolve/issue-82865.rs b/src/test/ui/resolve/issue-82865.rs deleted file mode 100644 index 07d88c413..000000000 --- a/src/test/ui/resolve/issue-82865.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Regression test for #82865. - -#![feature(decl_macro)] - -use x::y::z; //~ ERROR: failed to resolve: maybe a missing crate `x`? - -macro mac () { - Box::z //~ ERROR: no function or associated item -} - -fn main() { - mac!(); -} diff --git a/src/test/ui/resolve/issue-82865.stderr b/src/test/ui/resolve/issue-82865.stderr deleted file mode 100644 index 730fd6d60..000000000 --- a/src/test/ui/resolve/issue-82865.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error[E0433]: failed to resolve: maybe a missing crate `x`? - --> $DIR/issue-82865.rs:5:5 - | -LL | use x::y::z; - | ^ maybe a missing crate `x`? - | - = help: consider adding `extern crate x` to use the `x` crate - -error[E0599]: no function or associated item named `z` found for struct `Box<_, _>` in the current scope - --> $DIR/issue-82865.rs:8:10 - | -LL | Box::z - | ^ function or associated item not found in `Box<_, _>` -... -LL | mac!(); - | ------ in this macro invocation - | - = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0433, E0599. -For more information about an error, try `rustc --explain E0433`. diff --git a/src/test/ui/resolve/issue-85348.rs b/src/test/ui/resolve/issue-85348.rs deleted file mode 100644 index 3a33c1934..000000000 --- a/src/test/ui/resolve/issue-85348.rs +++ /dev/null @@ -1,12 +0,0 @@ -// Checks whether shadowing a const parameter leads to an ICE (#85348). - -impl<const N: usize> ArrayWindowsExample { -//~^ ERROR: cannot find type `ArrayWindowsExample` in this scope [E0412] - fn next() { - let mut N; - //~^ ERROR: let bindings cannot shadow const parameters [E0530] - //~| ERROR: type annotations needed [E0282] - } -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-85348.stderr b/src/test/ui/resolve/issue-85348.stderr deleted file mode 100644 index f839dd927..000000000 --- a/src/test/ui/resolve/issue-85348.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error[E0530]: let bindings cannot shadow const parameters - --> $DIR/issue-85348.rs:6:17 - | -LL | impl<const N: usize> ArrayWindowsExample { - | - the const parameter `N` is defined here -... -LL | let mut N; - | ^ cannot be named the same as a const parameter - -error[E0412]: cannot find type `ArrayWindowsExample` in this scope - --> $DIR/issue-85348.rs:3:22 - | -LL | impl<const N: usize> ArrayWindowsExample { - | ^^^^^^^^^^^^^^^^^^^ not found in this scope - -error[E0282]: type annotations needed - --> $DIR/issue-85348.rs:6:13 - | -LL | let mut N; - | ^^^^^ - | -help: consider giving `N` an explicit type - | -LL | let mut N: _; - | +++ - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0282, E0412, E0530. -For more information about an error, try `rustc --explain E0282`. diff --git a/src/test/ui/resolve/issue-85671.rs b/src/test/ui/resolve/issue-85671.rs deleted file mode 100644 index 337ec307e..000000000 --- a/src/test/ui/resolve/issue-85671.rs +++ /dev/null @@ -1,37 +0,0 @@ -// check-pass - -// Some trait with a function that returns a slice: -pub trait AsSlice { - type Element; - fn as_slice(&self) -> &[Self::Element]; -} - -// Some type -pub struct A<Cont>(Cont); - -// Here we say that if A wraps a slice, then it implements AsSlice -impl<'a, Element> AsSlice for A<&'a [Element]> { - type Element = Element; - fn as_slice(&self) -> &[Self::Element] { - self.0 - } -} - -impl<Cont> A<Cont> { - // We want this function to work - pub fn failing<Coef>(&self) - where - Self: AsSlice<Element = Coef>, - { - self.as_ref_a().as_ref_a(); - } - - pub fn as_ref_a<Coef>(&self) -> A<&[<Self as AsSlice>::Element]> - where - Self: AsSlice<Element = Coef>, - { - A(self.as_slice()) - } -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-88472.rs b/src/test/ui/resolve/issue-88472.rs deleted file mode 100644 index 6bf7caedd..000000000 --- a/src/test/ui/resolve/issue-88472.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Regression test for #88472, where a suggestion was issued to -// import an inaccessible struct. - -#![warn(unused_imports)] -//~^ NOTE: the lint level is defined here - -mod a { - struct Foo; - //~^ NOTE: struct `a::Foo` exists but is inaccessible - //~| NOTE: not accessible -} - -mod b { - use crate::a::*; - //~^ WARNING: unused import - type Bar = Foo; - //~^ ERROR: cannot find type `Foo` in this scope [E0412] - //~| NOTE: not found in this scope -} - -mod c { - enum Eee {} - //~^ NOTE: these enums exist but are inaccessible - //~| NOTE: `c::Eee`: not accessible - - mod d { - enum Eee {} - //~^ NOTE: `c::d::Eee`: not accessible - } -} - -mod e { - type Baz = Eee; - //~^ ERROR: cannot find type `Eee` in this scope [E0412] - //~| NOTE: not found in this scope -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-88472.stderr b/src/test/ui/resolve/issue-88472.stderr deleted file mode 100644 index 8431fc977..000000000 --- a/src/test/ui/resolve/issue-88472.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error[E0412]: cannot find type `Foo` in this scope - --> $DIR/issue-88472.rs:16:16 - | -LL | type Bar = Foo; - | ^^^ not found in this scope - | -note: struct `a::Foo` exists but is inaccessible - --> $DIR/issue-88472.rs:8:5 - | -LL | struct Foo; - | ^^^^^^^^^^^ not accessible - -error[E0412]: cannot find type `Eee` in this scope - --> $DIR/issue-88472.rs:33:16 - | -LL | type Baz = Eee; - | ^^^ not found in this scope - | -note: these enums exist but are inaccessible - --> $DIR/issue-88472.rs:22:5 - | -LL | enum Eee {} - | ^^^^^^^^ `c::Eee`: not accessible -... -LL | enum Eee {} - | ^^^^^^^^ `c::d::Eee`: not accessible - -warning: unused import: `crate::a::*` - --> $DIR/issue-88472.rs:14:9 - | -LL | use crate::a::*; - | ^^^^^^^^^^^ - | -note: the lint level is defined here - --> $DIR/issue-88472.rs:4:9 - | -LL | #![warn(unused_imports)] - | ^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors; 1 warning emitted - -For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/resolve/issue-90113.rs b/src/test/ui/resolve/issue-90113.rs deleted file mode 100644 index f6658b45e..000000000 --- a/src/test/ui/resolve/issue-90113.rs +++ /dev/null @@ -1,21 +0,0 @@ -mod list { - pub use self::List::Cons; - - pub enum List<T> { - Cons(T, Box<List<T>>), - } -} - -mod alias { - use crate::list::List; - - pub type Foo = List<String>; -} - -fn foo(l: crate::alias::Foo) { - match l { - Cons(..) => {} //~ ERROR: cannot find tuple struct or tuple variant `Cons` in this scope - } -} - -fn main() {} diff --git a/src/test/ui/resolve/issue-90113.stderr b/src/test/ui/resolve/issue-90113.stderr deleted file mode 100644 index 1b7872057..000000000 --- a/src/test/ui/resolve/issue-90113.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0531]: cannot find tuple struct or tuple variant `Cons` in this scope - --> $DIR/issue-90113.rs:17:9 - | -LL | Cons(..) => {} - | ^^^^ not found in this scope - | -help: consider importing this tuple variant - | -LL | use list::List::Cons; - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0531`. diff --git a/src/test/ui/resolve/levenshtein.rs b/src/test/ui/resolve/levenshtein.rs deleted file mode 100644 index a6f471625..000000000 --- a/src/test/ui/resolve/levenshtein.rs +++ /dev/null @@ -1,31 +0,0 @@ -const MAX_ITEM: usize = 10; - -fn foo_bar() {} - -fn foo(c: esize) {} // Misspelled primitive type name. -//~^ ERROR cannot find - -enum Bar { } - -type A = Baz; // Misspelled type name. -//~^ ERROR cannot find -type B = Opiton<u8>; // Misspelled type name from the prelude. -//~^ ERROR cannot find - -mod m { - type A = Baz; // No suggestion here, Bar is not visible - //~^ ERROR cannot find - - pub struct First; - pub struct Second; -} - -fn main() { - let v = [0u32; MAXITEM]; // Misspelled constant name. - //~^ ERROR cannot find - foobar(); // Misspelled function name. - //~^ ERROR cannot find - let b: m::first = m::second; // Misspelled item in module. - //~^ ERROR cannot find - //~| ERROR cannot find -} diff --git a/src/test/ui/resolve/levenshtein.stderr b/src/test/ui/resolve/levenshtein.stderr deleted file mode 100644 index 9a2d61ea4..000000000 --- a/src/test/ui/resolve/levenshtein.stderr +++ /dev/null @@ -1,72 +0,0 @@ -error[E0412]: cannot find type `esize` in this scope - --> $DIR/levenshtein.rs:5:11 - | -LL | fn foo(c: esize) {} // Misspelled primitive type name. - | ^^^^^ help: a builtin type with a similar name exists: `isize` - -error[E0412]: cannot find type `Baz` in this scope - --> $DIR/levenshtein.rs:10:10 - | -LL | enum Bar { } - | -------- similarly named enum `Bar` defined here -LL | -LL | type A = Baz; // Misspelled type name. - | ^^^ help: an enum with a similar name exists: `Bar` - -error[E0412]: cannot find type `Opiton` in this scope - --> $DIR/levenshtein.rs:12:10 - | -LL | type B = Opiton<u8>; // Misspelled type name from the prelude. - | ^^^^^^ help: an enum with a similar name exists: `Option` - | - ::: $SRC_DIR/core/src/option.rs:LL:COL - | -LL | pub enum Option<T> { - | ------------------ similarly named enum `Option` defined here - -error[E0412]: cannot find type `Baz` in this scope - --> $DIR/levenshtein.rs:16:14 - | -LL | type A = Baz; // No suggestion here, Bar is not visible - | ^^^ not found in this scope - -error[E0425]: cannot find value `MAXITEM` in this scope - --> $DIR/levenshtein.rs:24:20 - | -LL | const MAX_ITEM: usize = 10; - | --------------------------- similarly named constant `MAX_ITEM` defined here -... -LL | let v = [0u32; MAXITEM]; // Misspelled constant name. - | ^^^^^^^ help: a constant with a similar name exists: `MAX_ITEM` - -error[E0412]: cannot find type `first` in module `m` - --> $DIR/levenshtein.rs:28:15 - | -LL | pub struct First; - | ----------------- similarly named struct `First` defined here -... -LL | let b: m::first = m::second; // Misspelled item in module. - | ^^^^^ help: a struct with a similar name exists (notice the capitalization): `First` - -error[E0425]: cannot find value `second` in module `m` - --> $DIR/levenshtein.rs:28:26 - | -LL | pub struct Second; - | ------------------ similarly named unit struct `Second` defined here -... -LL | let b: m::first = m::second; // Misspelled item in module. - | ^^^^^^ help: a unit struct with a similar name exists (notice the capitalization): `Second` - -error[E0425]: cannot find function `foobar` in this scope - --> $DIR/levenshtein.rs:26:5 - | -LL | fn foo_bar() {} - | ------------ similarly named function `foo_bar` defined here -... -LL | foobar(); // Misspelled function name. - | ^^^^^^ help: a function with a similar name exists: `foo_bar` - -error: aborting due to 8 previous errors - -Some errors have detailed explanations: E0412, E0425. -For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/ui/resolve/macro-determinacy-non-module.rs b/src/test/ui/resolve/macro-determinacy-non-module.rs deleted file mode 100644 index 3215e0cd3..000000000 --- a/src/test/ui/resolve/macro-determinacy-non-module.rs +++ /dev/null @@ -1,7 +0,0 @@ -// check-pass - -use std as line; - -const C: u32 = line!(); - -fn main() {} diff --git a/src/test/ui/resolve/missing-in-namespace.rs b/src/test/ui/resolve/missing-in-namespace.rs deleted file mode 100644 index e1dedb072..000000000 --- a/src/test/ui/resolve/missing-in-namespace.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - let _map = std::hahmap::HashMap::new(); - //~^ ERROR failed to resolve: could not find `hahmap` in `std -} diff --git a/src/test/ui/resolve/missing-in-namespace.stderr b/src/test/ui/resolve/missing-in-namespace.stderr deleted file mode 100644 index fc925ba3b..000000000 --- a/src/test/ui/resolve/missing-in-namespace.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0433]: failed to resolve: could not find `hahmap` in `std` - --> $DIR/missing-in-namespace.rs:2:21 - | -LL | let _map = std::hahmap::HashMap::new(); - | ^^^^^^ could not find `hahmap` in `std` - | -help: consider importing this struct - | -LL | use std::collections::HashMap; - | -help: if you import `HashMap`, refer to it directly - | -LL - let _map = std::hahmap::HashMap::new(); -LL + let _map = HashMap::new(); - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/resolve/name-clash-nullary.rs b/src/test/ui/resolve/name-clash-nullary.rs deleted file mode 100644 index b5f5e1214..000000000 --- a/src/test/ui/resolve/name-clash-nullary.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - let None: isize = 42; //~ ERROR mismatched types -} diff --git a/src/test/ui/resolve/name-clash-nullary.stderr b/src/test/ui/resolve/name-clash-nullary.stderr deleted file mode 100644 index 76c4b5914..000000000 --- a/src/test/ui/resolve/name-clash-nullary.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/name-clash-nullary.rs:2:7 - | -LL | let None: isize = 42; - | ^^^^ ----- expected due to this - | | - | expected `isize`, found enum `Option` - | - = note: expected type `isize` - found enum `Option<_>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/resolve/name-collision-in-trait-fn-sig.rs b/src/test/ui/resolve/name-collision-in-trait-fn-sig.rs deleted file mode 100644 index fba4ffa1c..000000000 --- a/src/test/ui/resolve/name-collision-in-trait-fn-sig.rs +++ /dev/null @@ -1,11 +0,0 @@ -// check-pass -// This is currently stable behavior, which was almost accidentally made an -// error in #102161 since there is no test exercising it. I am not sure if -// this _should_ be the desired behavior, but at least we should know if it -// changes. - -fn main() {} - -trait Foo { - fn fn_with_type_named_same_as_local_in_param(b: i32, b: i32); -} diff --git a/src/test/ui/resolve/no-implicit-prelude-nested.rs b/src/test/ui/resolve/no-implicit-prelude-nested.rs deleted file mode 100644 index c314967da..000000000 --- a/src/test/ui/resolve/no-implicit-prelude-nested.rs +++ /dev/null @@ -1,54 +0,0 @@ -// Test that things from the prelude aren't in scope. Use many of them -// so that renaming some things won't magically make this test fail -// for the wrong reason (e.g., if `Add` changes to `Addition`, and -// `no_implicit_prelude` stops working, then the `impl Add` will still -// fail with the same error message). - -#[no_implicit_prelude] -mod foo { - mod baz { - struct Test; - impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope - impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone` - impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope - impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope - impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope - - fn foo() { - drop(2) //~ ERROR cannot find function `drop` in this scope - } - } - - struct Test; - impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope - impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone` - impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope - impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope - impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope - - fn foo() { - drop(2) //~ ERROR cannot find function `drop` in this scope - } -} - -fn qux() { - #[no_implicit_prelude] - mod qux_inner { - struct Test; - impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope - impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone` - impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope - impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope - impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope - - fn foo() { - drop(2) //~ ERROR cannot find function `drop` in this scope - } - } -} - - -fn main() { - // these should work fine - drop(2) -} diff --git a/src/test/ui/resolve/no-implicit-prelude-nested.stderr b/src/test/ui/resolve/no-implicit-prelude-nested.stderr deleted file mode 100644 index 198b630c5..000000000 --- a/src/test/ui/resolve/no-implicit-prelude-nested.stderr +++ /dev/null @@ -1,187 +0,0 @@ -error[E0405]: cannot find trait `Add` in this scope - --> $DIR/no-implicit-prelude-nested.rs:11:14 - | -LL | impl Add for Test {} - | ^^^ not found in this scope - | -help: consider importing this trait - | -LL | use std::ops::Add; - | - -error[E0404]: expected trait, found derive macro `Clone` - --> $DIR/no-implicit-prelude-nested.rs:12:14 - | -LL | impl Clone for Test {} - | ^^^^^ not a trait - | -help: consider importing this trait instead - | -LL | use std::clone::Clone; - | - -error[E0405]: cannot find trait `Iterator` in this scope - --> $DIR/no-implicit-prelude-nested.rs:13:14 - | -LL | impl Iterator for Test {} - | ^^^^^^^^ not found in this scope - | -help: consider importing this trait - | -LL | use std::iter::Iterator; - | - -error[E0405]: cannot find trait `ToString` in this scope - --> $DIR/no-implicit-prelude-nested.rs:14:14 - | -LL | impl ToString for Test {} - | ^^^^^^^^ not found in this scope - | -help: consider importing this trait - | -LL | use std::string::ToString; - | - -error[E0405]: cannot find trait `Writer` in this scope - --> $DIR/no-implicit-prelude-nested.rs:15:14 - | -LL | impl Writer for Test {} - | ^^^^^^ not found in this scope - -error[E0425]: cannot find function `drop` in this scope - --> $DIR/no-implicit-prelude-nested.rs:18:13 - | -LL | drop(2) - | ^^^^ not found in this scope - | -help: consider importing this function - | -LL | use std::mem::drop; - | - -error[E0405]: cannot find trait `Add` in this scope - --> $DIR/no-implicit-prelude-nested.rs:23:10 - | -LL | impl Add for Test {} - | ^^^ not found in this scope - | -help: consider importing this trait - | -LL | use std::ops::Add; - | - -error[E0404]: expected trait, found derive macro `Clone` - --> $DIR/no-implicit-prelude-nested.rs:24:10 - | -LL | impl Clone for Test {} - | ^^^^^ not a trait - | -help: consider importing this trait instead - | -LL | use std::clone::Clone; - | - -error[E0405]: cannot find trait `Iterator` in this scope - --> $DIR/no-implicit-prelude-nested.rs:25:10 - | -LL | impl Iterator for Test {} - | ^^^^^^^^ not found in this scope - | -help: consider importing this trait - | -LL | use std::iter::Iterator; - | - -error[E0405]: cannot find trait `ToString` in this scope - --> $DIR/no-implicit-prelude-nested.rs:26:10 - | -LL | impl ToString for Test {} - | ^^^^^^^^ not found in this scope - | -help: consider importing this trait - | -LL | use std::string::ToString; - | - -error[E0405]: cannot find trait `Writer` in this scope - --> $DIR/no-implicit-prelude-nested.rs:27:10 - | -LL | impl Writer for Test {} - | ^^^^^^ not found in this scope - -error[E0425]: cannot find function `drop` in this scope - --> $DIR/no-implicit-prelude-nested.rs:30:9 - | -LL | drop(2) - | ^^^^ not found in this scope - | -help: consider importing this function - | -LL | use std::mem::drop; - | - -error[E0405]: cannot find trait `Add` in this scope - --> $DIR/no-implicit-prelude-nested.rs:38:14 - | -LL | impl Add for Test {} - | ^^^ not found in this scope - | -help: consider importing this trait - | -LL | use std::ops::Add; - | - -error[E0404]: expected trait, found derive macro `Clone` - --> $DIR/no-implicit-prelude-nested.rs:39:14 - | -LL | impl Clone for Test {} - | ^^^^^ not a trait - | -help: consider importing this trait instead - | -LL | use std::clone::Clone; - | - -error[E0405]: cannot find trait `Iterator` in this scope - --> $DIR/no-implicit-prelude-nested.rs:40:14 - | -LL | impl Iterator for Test {} - | ^^^^^^^^ not found in this scope - | -help: consider importing this trait - | -LL | use std::iter::Iterator; - | - -error[E0405]: cannot find trait `ToString` in this scope - --> $DIR/no-implicit-prelude-nested.rs:41:14 - | -LL | impl ToString for Test {} - | ^^^^^^^^ not found in this scope - | -help: consider importing this trait - | -LL | use std::string::ToString; - | - -error[E0405]: cannot find trait `Writer` in this scope - --> $DIR/no-implicit-prelude-nested.rs:42:14 - | -LL | impl Writer for Test {} - | ^^^^^^ not found in this scope - -error[E0425]: cannot find function `drop` in this scope - --> $DIR/no-implicit-prelude-nested.rs:45:13 - | -LL | drop(2) - | ^^^^ not found in this scope - | -help: consider importing this function - | -LL | use std::mem::drop; - | - -error: aborting due to 18 previous errors - -Some errors have detailed explanations: E0404, E0405, E0425. -For more information about an error, try `rustc --explain E0404`. diff --git a/src/test/ui/resolve/no-implicit-prelude.rs b/src/test/ui/resolve/no-implicit-prelude.rs deleted file mode 100644 index 4b0ca4d52..000000000 --- a/src/test/ui/resolve/no-implicit-prelude.rs +++ /dev/null @@ -1,18 +0,0 @@ -#![no_implicit_prelude] - -// Test that things from the prelude aren't in scope. Use many of them -// so that renaming some things won't magically make this test fail -// for the wrong reason (e.g., if `Add` changes to `Addition`, and -// `no_implicit_prelude` stops working, then the `impl Add` will still -// fail with the same error message). - -struct Test; -impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope -impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone` -impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope -impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope -impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope - -fn main() { - drop(2) //~ ERROR cannot find function `drop` in this scope -} diff --git a/src/test/ui/resolve/no-implicit-prelude.stderr b/src/test/ui/resolve/no-implicit-prelude.stderr deleted file mode 100644 index 36a9b65b7..000000000 --- a/src/test/ui/resolve/no-implicit-prelude.stderr +++ /dev/null @@ -1,65 +0,0 @@ -error[E0405]: cannot find trait `Add` in this scope - --> $DIR/no-implicit-prelude.rs:10:6 - | -LL | impl Add for Test {} - | ^^^ not found in this scope - | -help: consider importing this trait - | -LL | use std::ops::Add; - | - -error[E0404]: expected trait, found derive macro `Clone` - --> $DIR/no-implicit-prelude.rs:11:6 - | -LL | impl Clone for Test {} - | ^^^^^ not a trait - | -help: consider importing this trait instead - | -LL | use std::clone::Clone; - | - -error[E0405]: cannot find trait `Iterator` in this scope - --> $DIR/no-implicit-prelude.rs:12:6 - | -LL | impl Iterator for Test {} - | ^^^^^^^^ not found in this scope - | -help: consider importing this trait - | -LL | use std::iter::Iterator; - | - -error[E0405]: cannot find trait `ToString` in this scope - --> $DIR/no-implicit-prelude.rs:13:6 - | -LL | impl ToString for Test {} - | ^^^^^^^^ not found in this scope - | -help: consider importing this trait - | -LL | use std::string::ToString; - | - -error[E0405]: cannot find trait `Writer` in this scope - --> $DIR/no-implicit-prelude.rs:14:6 - | -LL | impl Writer for Test {} - | ^^^^^^ not found in this scope - -error[E0425]: cannot find function `drop` in this scope - --> $DIR/no-implicit-prelude.rs:17:5 - | -LL | drop(2) - | ^^^^ not found in this scope - | -help: consider importing this function - | -LL | use std::mem::drop; - | - -error: aborting due to 6 previous errors - -Some errors have detailed explanations: E0404, E0405, E0425. -For more information about an error, try `rustc --explain E0404`. diff --git a/src/test/ui/resolve/no-std-1.rs b/src/test/ui/resolve/no-std-1.rs deleted file mode 100644 index 5b59e9b4e..000000000 --- a/src/test/ui/resolve/no-std-1.rs +++ /dev/null @@ -1,10 +0,0 @@ -// run-pass - -#![no_std] - -extern crate std; - -fn main() { - let a = Some("foo"); - a.unwrap(); -} diff --git a/src/test/ui/resolve/no-std-2.rs b/src/test/ui/resolve/no-std-2.rs deleted file mode 100644 index 487d41649..000000000 --- a/src/test/ui/resolve/no-std-2.rs +++ /dev/null @@ -1,10 +0,0 @@ -// run-pass - -#![no_std] - -extern crate std; - -fn main() { - let a = core::option::Option::Some("foo"); - a.unwrap(); -} diff --git a/src/test/ui/resolve/no-std-3.rs b/src/test/ui/resolve/no-std-3.rs deleted file mode 100644 index f6c4ed579..000000000 --- a/src/test/ui/resolve/no-std-3.rs +++ /dev/null @@ -1,17 +0,0 @@ -// run-pass - -#![no_std] - -extern crate std; - -mod foo { - pub fn test() -> Option<i32> { - Some(2) - } -} - -fn main() { - let a = core::option::Option::Some("foo"); - a.unwrap(); - foo::test().unwrap(); -} diff --git a/src/test/ui/resolve/pathless-extern-ok.rs b/src/test/ui/resolve/pathless-extern-ok.rs deleted file mode 100644 index 0ffa5eb89..000000000 --- a/src/test/ui/resolve/pathless-extern-ok.rs +++ /dev/null @@ -1,9 +0,0 @@ -// edition:2018 -// compile-flags:--extern alloc -// build-pass - -// Test that `--extern alloc` will load from the sysroot without error. - -fn main() { - let _: Vec<i32> = alloc::vec::Vec::new(); -} diff --git a/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.rs b/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.rs deleted file mode 100644 index bd496875e..000000000 --- a/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.rs +++ /dev/null @@ -1,21 +0,0 @@ -trait Foo<T> { - fn foo(&self, name: T) -> usize; -} - -struct Bar { - baz: Baz, -} - -struct Baz { - num: usize, -} - -impl<Baz> Foo<Baz> for Bar { - fn foo(&self, _name: Baz) -> usize { - match self.baz { - Baz { num } => num, //~ ERROR expected struct, variant or union type, found type parameter `Baz` - } - } -} - -fn main() {} diff --git a/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.stderr b/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.stderr deleted file mode 100644 index 5790e425c..000000000 --- a/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0574]: expected struct, variant or union type, found type parameter `Baz` - --> $DIR/point-at-type-parameter-shadowing-another-type.rs:16:13 - | -LL | struct Baz { - | --- you might have meant to refer to this struct -... -LL | impl<Baz> Foo<Baz> for Bar { - | --- found this type parameter -... -LL | Baz { num } => num, - | ^^^ not a struct, variant or union type - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0574`. diff --git a/src/test/ui/resolve/privacy-enum-ctor.rs b/src/test/ui/resolve/privacy-enum-ctor.rs deleted file mode 100644 index f0d2cf8c0..000000000 --- a/src/test/ui/resolve/privacy-enum-ctor.rs +++ /dev/null @@ -1,71 +0,0 @@ -mod m { - pub enum E { - Fn(u8), - Struct { - s: u8, - }, - Unit, - } - - pub mod n { - pub(in m) enum Z { - Fn(u8), - Struct { - s: u8, - }, - Unit, - } - } - - use m::n::Z; // OK, only the type is imported - - fn f() { - n::Z; - //~^ ERROR expected value, found enum `n::Z` - Z; - //~^ ERROR expected value, found enum `Z` - let _: Z = Z::Fn; - //~^ ERROR mismatched types - let _: Z = Z::Struct; - //~^ ERROR expected value, found struct variant `Z::Struct` - let _ = Z::Unit(); - //~^ ERROR expected function, found enum variant `Z::Unit` - let _ = Z::Unit {}; - // This is ok, it is equivalent to not having braces - } -} - -use m::E; // OK, only the type is imported - -fn main() { - let _: E = m::E; - //~^ ERROR expected value, found enum `m::E` - let _: E = m::E::Fn; - //~^ ERROR mismatched types - let _: E = m::E::Struct; - //~^ ERROR expected value, found struct variant `m::E::Struct` - let _: E = m::E::Unit(); - //~^ ERROR expected function, found enum variant `m::E::Unit` - let _: E = E; - //~^ ERROR expected value, found enum `E` - let _: E = E::Fn; - //~^ ERROR mismatched types - let _: E = E::Struct; - //~^ ERROR expected value, found struct variant `E::Struct` - let _: E = E::Unit(); - //~^ ERROR expected function, found enum variant `E::Unit` - let _: Z = m::n::Z; - //~^ ERROR cannot find type `Z` in this scope - //~| ERROR expected value, found enum `m::n::Z` - //~| ERROR enum `Z` is private - let _: Z = m::n::Z::Fn; - //~^ ERROR cannot find type `Z` in this scope - //~| ERROR enum `Z` is private - let _: Z = m::n::Z::Struct; - //~^ ERROR cannot find type `Z` in this scope - //~| ERROR expected value, found struct variant `m::n::Z::Struct` - //~| ERROR enum `Z` is private - let _: Z = m::n::Z::Unit {}; - //~^ ERROR cannot find type `Z` in this scope - //~| ERROR enum `Z` is private -} diff --git a/src/test/ui/resolve/privacy-enum-ctor.stderr b/src/test/ui/resolve/privacy-enum-ctor.stderr deleted file mode 100644 index d734fa76b..000000000 --- a/src/test/ui/resolve/privacy-enum-ctor.stderr +++ /dev/null @@ -1,395 +0,0 @@ -error[E0423]: expected value, found enum `n::Z` - --> $DIR/privacy-enum-ctor.rs:23:9 - | -LL | n::Z; - | ^^^^ - | -note: the enum is defined here - --> $DIR/privacy-enum-ctor.rs:11:9 - | -LL | / pub(in m) enum Z { -LL | | Fn(u8), -LL | | Struct { -LL | | s: u8, -LL | | }, -LL | | Unit, -LL | | } - | |_________^ -help: you might have meant to use the following enum variant - | -LL | m::Z::Unit; - | ~~~~~~~~~~ -help: alternatively, the following enum variant is available - | -LL | (m::Z::Fn(/* fields */)); - | ~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0423]: expected value, found enum `Z` - --> $DIR/privacy-enum-ctor.rs:25:9 - | -LL | Z; - | ^ - | -note: the enum is defined here - --> $DIR/privacy-enum-ctor.rs:11:9 - | -LL | / pub(in m) enum Z { -LL | | Fn(u8), -LL | | Struct { -LL | | s: u8, -LL | | }, -LL | | Unit, -LL | | } - | |_________^ -help: you might have meant to use the following enum variant - | -LL | m::Z::Unit; - | ~~~~~~~~~~ -help: alternatively, the following enum variant is available - | -LL | (m::Z::Fn(/* fields */)); - | ~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0423]: expected value, found enum `m::E` - --> $DIR/privacy-enum-ctor.rs:41:16 - | -LL | fn f() { - | ------ similarly named function `f` defined here -... -LL | let _: E = m::E; - | ^^^^ - | -note: the enum is defined here - --> $DIR/privacy-enum-ctor.rs:2:5 - | -LL | / pub enum E { -LL | | Fn(u8), -LL | | Struct { -LL | | s: u8, -LL | | }, -LL | | Unit, -LL | | } - | |_____^ -help: you might have meant to use the following enum variant - | -LL | let _: E = E::Unit; - | ~~~~~~~ -help: alternatively, the following enum variant is available - | -LL | let _: E = (E::Fn(/* fields */)); - | ~~~~~~~~~~~~~~~~~~~~~ -help: a function with a similar name exists - | -LL | let _: E = m::f; - | ~ -help: consider importing one of these items instead - | -LL | use std::f32::consts::E; - | -LL | use std::f64::consts::E; - | -help: if you import `E`, refer to it directly - | -LL - let _: E = m::E; -LL + let _: E = E; - | - -error[E0423]: expected value, found enum `E` - --> $DIR/privacy-enum-ctor.rs:49:16 - | -LL | let _: E = E; - | ^ - | -note: the enum is defined here - --> $DIR/privacy-enum-ctor.rs:2:5 - | -LL | / pub enum E { -LL | | Fn(u8), -LL | | Struct { -LL | | s: u8, -LL | | }, -LL | | Unit, -LL | | } - | |_____^ -help: you might have meant to use the following enum variant - | -LL | let _: E = E::Unit; - | ~~~~~~~ -help: alternatively, the following enum variant is available - | -LL | let _: E = (E::Fn(/* fields */)); - | ~~~~~~~~~~~~~~~~~~~~~ -help: consider importing one of these items instead - | -LL | use std::f32::consts::E; - | -LL | use std::f64::consts::E; - | - -error[E0412]: cannot find type `Z` in this scope - --> $DIR/privacy-enum-ctor.rs:57:12 - | -LL | pub enum E { - | ---------- similarly named enum `E` defined here -... -LL | let _: Z = m::n::Z; - | ^ help: an enum with a similar name exists: `E` - | -note: enum `m::Z` exists but is inaccessible - --> $DIR/privacy-enum-ctor.rs:11:9 - | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ not accessible - -error[E0423]: expected value, found enum `m::n::Z` - --> $DIR/privacy-enum-ctor.rs:57:16 - | -LL | let _: Z = m::n::Z; - | ^^^^^^^ - | -note: the enum is defined here - --> $DIR/privacy-enum-ctor.rs:11:9 - | -LL | / pub(in m) enum Z { -LL | | Fn(u8), -LL | | Struct { -LL | | s: u8, -LL | | }, -LL | | Unit, -LL | | } - | |_________^ -help: you might have meant to use the following enum variant - | -LL | let _: Z = m::Z::Unit; - | ~~~~~~~~~~ -help: alternatively, the following enum variant is available - | -LL | let _: Z = (m::Z::Fn(/* fields */)); - | ~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0412]: cannot find type `Z` in this scope - --> $DIR/privacy-enum-ctor.rs:61:12 - | -LL | pub enum E { - | ---------- similarly named enum `E` defined here -... -LL | let _: Z = m::n::Z::Fn; - | ^ help: an enum with a similar name exists: `E` - | -note: enum `m::Z` exists but is inaccessible - --> $DIR/privacy-enum-ctor.rs:11:9 - | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ not accessible - -error[E0412]: cannot find type `Z` in this scope - --> $DIR/privacy-enum-ctor.rs:64:12 - | -LL | pub enum E { - | ---------- similarly named enum `E` defined here -... -LL | let _: Z = m::n::Z::Struct; - | ^ help: an enum with a similar name exists: `E` - | -note: enum `m::Z` exists but is inaccessible - --> $DIR/privacy-enum-ctor.rs:11:9 - | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ not accessible - -error[E0412]: cannot find type `Z` in this scope - --> $DIR/privacy-enum-ctor.rs:68:12 - | -LL | pub enum E { - | ---------- similarly named enum `E` defined here -... -LL | let _: Z = m::n::Z::Unit {}; - | ^ help: an enum with a similar name exists: `E` - | -note: enum `m::Z` exists but is inaccessible - --> $DIR/privacy-enum-ctor.rs:11:9 - | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ not accessible - -error[E0603]: enum `Z` is private - --> $DIR/privacy-enum-ctor.rs:57:22 - | -LL | let _: Z = m::n::Z; - | ^ private enum - | -note: the enum `Z` is defined here - --> $DIR/privacy-enum-ctor.rs:11:9 - | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ - -error[E0603]: enum `Z` is private - --> $DIR/privacy-enum-ctor.rs:61:22 - | -LL | let _: Z = m::n::Z::Fn; - | ^ private enum - | -note: the enum `Z` is defined here - --> $DIR/privacy-enum-ctor.rs:11:9 - | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ - -error[E0603]: enum `Z` is private - --> $DIR/privacy-enum-ctor.rs:64:22 - | -LL | let _: Z = m::n::Z::Struct; - | ^ private enum - | -note: the enum `Z` is defined here - --> $DIR/privacy-enum-ctor.rs:11:9 - | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ - -error[E0603]: enum `Z` is private - --> $DIR/privacy-enum-ctor.rs:68:22 - | -LL | let _: Z = m::n::Z::Unit {}; - | ^ private enum - | -note: the enum `Z` is defined here - --> $DIR/privacy-enum-ctor.rs:11:9 - | -LL | pub(in m) enum Z { - | ^^^^^^^^^^^^^^^^ - -error[E0308]: mismatched types - --> $DIR/privacy-enum-ctor.rs:27:20 - | -LL | Fn(u8), - | -- fn(u8) -> Z {Z::Fn} defined here -... -LL | let _: Z = Z::Fn; - | - ^^^^^ expected enum `Z`, found fn item - | | - | expected due to this - | - = note: expected enum `Z` - found fn item `fn(u8) -> Z {Z::Fn}` -help: use parentheses to construct this tuple variant - | -LL | let _: Z = Z::Fn(/* u8 */); - | ++++++++++ - -error[E0533]: expected value, found struct variant `Z::Struct` - --> $DIR/privacy-enum-ctor.rs:29:20 - | -LL | let _: Z = Z::Struct; - | ^^^^^^^^^ not a value - -error[E0618]: expected function, found enum variant `Z::Unit` - --> $DIR/privacy-enum-ctor.rs:31:17 - | -LL | Unit, - | ---- enum variant `Z::Unit` defined here -... -LL | let _ = Z::Unit(); - | ^^^^^^^-- - | | - | call expression requires function - | -help: `Z::Unit` is a unit enum variant, and does not take parentheses to be constructed - | -LL - let _ = Z::Unit(); -LL + let _ = Z::Unit; - | - -error[E0308]: mismatched types - --> $DIR/privacy-enum-ctor.rs:43:16 - | -LL | Fn(u8), - | -- fn(u8) -> E {E::Fn} defined here -... -LL | let _: E = m::E::Fn; - | - ^^^^^^^^ expected enum `E`, found fn item - | | - | expected due to this - | - = note: expected enum `E` - found fn item `fn(u8) -> E {E::Fn}` -help: use parentheses to construct this tuple variant - | -LL | let _: E = m::E::Fn(/* u8 */); - | ++++++++++ - -error[E0533]: expected value, found struct variant `m::E::Struct` - --> $DIR/privacy-enum-ctor.rs:45:16 - | -LL | let _: E = m::E::Struct; - | ^^^^^^^^^^^^ not a value - -error[E0618]: expected function, found enum variant `m::E::Unit` - --> $DIR/privacy-enum-ctor.rs:47:16 - | -LL | Unit, - | ---- enum variant `m::E::Unit` defined here -... -LL | let _: E = m::E::Unit(); - | ^^^^^^^^^^-- - | | - | call expression requires function - | -help: `m::E::Unit` is a unit enum variant, and does not take parentheses to be constructed - | -LL - let _: E = m::E::Unit(); -LL + let _: E = m::E::Unit; - | - -error[E0308]: mismatched types - --> $DIR/privacy-enum-ctor.rs:51:16 - | -LL | Fn(u8), - | -- fn(u8) -> E {E::Fn} defined here -... -LL | let _: E = E::Fn; - | - ^^^^^ expected enum `E`, found fn item - | | - | expected due to this - | - = note: expected enum `E` - found fn item `fn(u8) -> E {E::Fn}` -help: use parentheses to construct this tuple variant - | -LL | let _: E = E::Fn(/* u8 */); - | ++++++++++ - -error[E0533]: expected value, found struct variant `E::Struct` - --> $DIR/privacy-enum-ctor.rs:53:16 - | -LL | let _: E = E::Struct; - | ^^^^^^^^^ not a value - -error[E0618]: expected function, found enum variant `E::Unit` - --> $DIR/privacy-enum-ctor.rs:55:16 - | -LL | Unit, - | ---- enum variant `E::Unit` defined here -... -LL | let _: E = E::Unit(); - | ^^^^^^^-- - | | - | call expression requires function - | -help: `E::Unit` is a unit enum variant, and does not take parentheses to be constructed - | -LL - let _: E = E::Unit(); -LL + let _: E = E::Unit; - | - -error[E0533]: expected value, found struct variant `m::n::Z::Struct` - --> $DIR/privacy-enum-ctor.rs:64:16 - | -LL | let _: Z = m::n::Z::Struct; - | ^^^^^^^^^^^^^^^ not a value - -error: aborting due to 23 previous errors - -Some errors have detailed explanations: E0308, E0412, E0423, E0533, E0603, E0618. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/resolve/privacy-struct-ctor.rs b/src/test/ui/resolve/privacy-struct-ctor.rs deleted file mode 100644 index 0eecc7f8c..000000000 --- a/src/test/ui/resolve/privacy-struct-ctor.rs +++ /dev/null @@ -1,47 +0,0 @@ -// aux-build:privacy-struct-ctor.rs - -extern crate privacy_struct_ctor as xcrate; - -mod m { - pub struct S(u8); - pub struct S2 { - s: u8 - } - - pub mod n { - pub(in m) struct Z(pub(in m::n) u8); - } - - use m::n::Z; // OK, only the type is imported - - fn f() { - n::Z; - //~^ ERROR tuple struct constructor `Z` is private - Z; - //~^ ERROR expected value, found struct `Z` - } -} - -use m::S; // OK, only the type is imported -use m::S2; // OK, only the type is imported - -fn main() { - m::S; - //~^ ERROR tuple struct constructor `S` is private - let _: S = m::S(2); - //~^ ERROR tuple struct constructor `S` is private - S; - //~^ ERROR expected value, found struct `S` - m::n::Z; - //~^ ERROR tuple struct constructor `Z` is private - - S2; - //~^ ERROR expected value, found struct `S2` - - xcrate::m::S; - //~^ ERROR tuple struct constructor `S` is private - xcrate::S; - //~^ ERROR expected value, found struct `xcrate::S` - xcrate::m::n::Z; - //~^ ERROR tuple struct constructor `Z` is private -} diff --git a/src/test/ui/resolve/privacy-struct-ctor.stderr b/src/test/ui/resolve/privacy-struct-ctor.stderr deleted file mode 100644 index 17a666a40..000000000 --- a/src/test/ui/resolve/privacy-struct-ctor.stderr +++ /dev/null @@ -1,139 +0,0 @@ -error[E0423]: expected value, found struct `Z` - --> $DIR/privacy-struct-ctor.rs:20:9 - | -LL | pub struct S(u8); - | ----------------- similarly named tuple struct `S` defined here -... -LL | Z; - | ^ - | | - | constructor is not visible here due to private fields - | help: a tuple struct with a similar name exists: `S` - -error[E0423]: expected value, found struct `S` - --> $DIR/privacy-struct-ctor.rs:33:5 - | -LL | S; - | ^ constructor is not visible here due to private fields - -error[E0423]: expected value, found struct `S2` - --> $DIR/privacy-struct-ctor.rs:38:5 - | -LL | / pub struct S2 { -LL | | s: u8 -LL | | } - | |_____- `S2` defined here -... -LL | S2; - | ^^ help: use struct literal syntax instead: `S2 { s: val }` - -error[E0423]: expected value, found struct `xcrate::S` - --> $DIR/privacy-struct-ctor.rs:43:5 - | -LL | xcrate::S; - | ^^^^^^^^^ constructor is not visible here due to private fields - | -note: tuple struct `m::S` exists but is inaccessible - --> $DIR/privacy-struct-ctor.rs:6:5 - | -LL | pub struct S(u8); - | ^^^^^^^^^^^^^^^^^ not accessible - -error[E0603]: tuple struct constructor `Z` is private - --> $DIR/privacy-struct-ctor.rs:18:12 - | -LL | pub(in m) struct Z(pub(in m::n) u8); - | --------------- a constructor is private if any of the fields is private -... -LL | n::Z; - | ^ private tuple struct constructor - | -note: the tuple struct constructor `Z` is defined here - --> $DIR/privacy-struct-ctor.rs:12:9 - | -LL | pub(in m) struct Z(pub(in m::n) u8); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0603]: tuple struct constructor `S` is private - --> $DIR/privacy-struct-ctor.rs:29:8 - | -LL | pub struct S(u8); - | -- a constructor is private if any of the fields is private -... -LL | m::S; - | ^ private tuple struct constructor - | -note: the tuple struct constructor `S` is defined here - --> $DIR/privacy-struct-ctor.rs:6:5 - | -LL | pub struct S(u8); - | ^^^^^^^^^^^^^^^^^ - -error[E0603]: tuple struct constructor `S` is private - --> $DIR/privacy-struct-ctor.rs:31:19 - | -LL | pub struct S(u8); - | -- a constructor is private if any of the fields is private -... -LL | let _: S = m::S(2); - | ^ private tuple struct constructor - | -note: the tuple struct constructor `S` is defined here - --> $DIR/privacy-struct-ctor.rs:6:5 - | -LL | pub struct S(u8); - | ^^^^^^^^^^^^^^^^^ - -error[E0603]: tuple struct constructor `Z` is private - --> $DIR/privacy-struct-ctor.rs:35:11 - | -LL | pub(in m) struct Z(pub(in m::n) u8); - | --------------- a constructor is private if any of the fields is private -... -LL | m::n::Z; - | ^ private tuple struct constructor - | -note: the tuple struct constructor `Z` is defined here - --> $DIR/privacy-struct-ctor.rs:12:9 - | -LL | pub(in m) struct Z(pub(in m::n) u8); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0603]: tuple struct constructor `S` is private - --> $DIR/privacy-struct-ctor.rs:41:16 - | -LL | xcrate::m::S; - | ^ private tuple struct constructor - | - ::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18 - | -LL | pub struct S(u8); - | -- a constructor is private if any of the fields is private - | -note: the tuple struct constructor `S` is defined here - --> $DIR/auxiliary/privacy-struct-ctor.rs:2:5 - | -LL | pub struct S(u8); - | ^^^^^^^^^^^^ - -error[E0603]: tuple struct constructor `Z` is private - --> $DIR/privacy-struct-ctor.rs:45:19 - | -LL | xcrate::m::n::Z; - | ^ private tuple struct constructor - | - ::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28 - | -LL | pub(in m) struct Z(pub(in m::n) u8); - | --------------- a constructor is private if any of the fields is private - | -note: the tuple struct constructor `Z` is defined here - --> $DIR/auxiliary/privacy-struct-ctor.rs:5:9 - | -LL | pub(in m) struct Z(pub(in m::n) u8); - | ^^^^^^^^^^^^^^^^^^ - -error: aborting due to 10 previous errors - -Some errors have detailed explanations: E0423, E0603. -For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/ui/resolve/raw-ident-in-path.rs b/src/test/ui/resolve/raw-ident-in-path.rs deleted file mode 100644 index 7f1163beb..000000000 --- a/src/test/ui/resolve/raw-ident-in-path.rs +++ /dev/null @@ -1,5 +0,0 @@ -// Regression test for issue #63882. - -type A = crate::r#break; //~ ERROR cannot find type `r#break` in the crate root - -fn main() {} diff --git a/src/test/ui/resolve/raw-ident-in-path.stderr b/src/test/ui/resolve/raw-ident-in-path.stderr deleted file mode 100644 index 771dacbbb..000000000 --- a/src/test/ui/resolve/raw-ident-in-path.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0412]: cannot find type `r#break` in the crate root - --> $DIR/raw-ident-in-path.rs:3:17 - | -LL | type A = crate::r#break; - | ^^^^^^^ not found in the crate root - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/resolve/resolve-assoc-suggestions.rs b/src/test/ui/resolve/resolve-assoc-suggestions.rs deleted file mode 100644 index ee9bce60c..000000000 --- a/src/test/ui/resolve/resolve-assoc-suggestions.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Make sure associated items are recommended only in appropriate contexts. - -struct S { - field: u8, -} - -trait Tr { - fn method(&self); - type Type; -} - -impl Tr for S { - type Type = u8; - - fn method(&self) { - let _: field; - //~^ ERROR cannot find type `field` - let field(..); - //~^ ERROR cannot find tuple struct or tuple variant `field` - field; - //~^ ERROR cannot find value `field` - - let _: Type; - //~^ ERROR cannot find type `Type` - let Type(..); - //~^ ERROR cannot find tuple struct or tuple variant `Type` - Type; - //~^ ERROR cannot find value `Type` - - let _: method; - //~^ ERROR cannot find type `method` - let method(..); - //~^ ERROR cannot find tuple struct or tuple variant `method` - method; - //~^ ERROR cannot find value `method` - } -} - -fn main() {} diff --git a/src/test/ui/resolve/resolve-assoc-suggestions.stderr b/src/test/ui/resolve/resolve-assoc-suggestions.stderr deleted file mode 100644 index 8def9aa20..000000000 --- a/src/test/ui/resolve/resolve-assoc-suggestions.stderr +++ /dev/null @@ -1,58 +0,0 @@ -error[E0412]: cannot find type `field` in this scope - --> $DIR/resolve-assoc-suggestions.rs:16:16 - | -LL | let _: field; - | ^^^^^ not found in this scope - -error[E0531]: cannot find tuple struct or tuple variant `field` in this scope - --> $DIR/resolve-assoc-suggestions.rs:18:13 - | -LL | let field(..); - | ^^^^^ not found in this scope - -error[E0425]: cannot find value `field` in this scope - --> $DIR/resolve-assoc-suggestions.rs:20:9 - | -LL | field; - | ^^^^^ help: you might have meant to use the available field: `self.field` - -error[E0412]: cannot find type `Type` in this scope - --> $DIR/resolve-assoc-suggestions.rs:23:16 - | -LL | let _: Type; - | ^^^^ help: you might have meant to use the associated type: `Self::Type` - -error[E0531]: cannot find tuple struct or tuple variant `Type` in this scope - --> $DIR/resolve-assoc-suggestions.rs:25:13 - | -LL | let Type(..); - | ^^^^ not found in this scope - -error[E0425]: cannot find value `Type` in this scope - --> $DIR/resolve-assoc-suggestions.rs:27:9 - | -LL | Type; - | ^^^^ not found in this scope - -error[E0412]: cannot find type `method` in this scope - --> $DIR/resolve-assoc-suggestions.rs:30:16 - | -LL | let _: method; - | ^^^^^^ not found in this scope - -error[E0531]: cannot find tuple struct or tuple variant `method` in this scope - --> $DIR/resolve-assoc-suggestions.rs:32:13 - | -LL | let method(..); - | ^^^^^^ not found in this scope - -error[E0425]: cannot find value `method` in this scope - --> $DIR/resolve-assoc-suggestions.rs:34:9 - | -LL | method; - | ^^^^^^ help: you might have meant to refer to the method: `self.method` - -error: aborting due to 9 previous errors - -Some errors have detailed explanations: E0412, E0425, E0531. -For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/ui/resolve/resolve-bad-import-prefix.rs b/src/test/ui/resolve/resolve-bad-import-prefix.rs deleted file mode 100644 index 325c69b43..000000000 --- a/src/test/ui/resolve/resolve-bad-import-prefix.rs +++ /dev/null @@ -1,14 +0,0 @@ -mod m {} -enum E {} -struct S; -trait Tr {} - -use {}; // OK -use ::{}; // OK -use m::{}; // OK -use E::{}; // OK -use S::{}; // FIXME, this and `use S::{self};` should be an error -use Tr::{}; // FIXME, this and `use Tr::{self};` should be an error -use Nonexistent::{}; //~ ERROR unresolved import `Nonexistent` - -fn main () {} diff --git a/src/test/ui/resolve/resolve-bad-import-prefix.stderr b/src/test/ui/resolve/resolve-bad-import-prefix.stderr deleted file mode 100644 index 852b9c6af..000000000 --- a/src/test/ui/resolve/resolve-bad-import-prefix.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0432]: unresolved import `Nonexistent` - --> $DIR/resolve-bad-import-prefix.rs:12:5 - | -LL | use Nonexistent::{}; - | ^^^^^^^^^^^^^^^ no `Nonexistent` in the root - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/resolve/resolve-bad-visibility.rs b/src/test/ui/resolve/resolve-bad-visibility.rs deleted file mode 100644 index 7d48bb97b..000000000 --- a/src/test/ui/resolve/resolve-bad-visibility.rs +++ /dev/null @@ -1,15 +0,0 @@ -enum E {} -trait Tr {} - -pub(in E) struct S; //~ ERROR expected module, found enum `E` -pub(in Tr) struct Z; //~ ERROR expected module, found trait `Tr` -pub(in std::vec) struct F; //~ ERROR visibilities can only be restricted to ancestor modules -pub(in nonexistent) struct G; //~ ERROR failed to resolve -pub(in too_soon) struct H; //~ ERROR failed to resolve - -// Visibilities are resolved eagerly without waiting for modules becoming fully populated. -// Visibilities can only use ancestor modules legally which are always available in time, -// so the worst thing that can happen due to eager resolution is a suboptimal error message. -mod too_soon {} - -fn main () {} diff --git a/src/test/ui/resolve/resolve-bad-visibility.stderr b/src/test/ui/resolve/resolve-bad-visibility.stderr deleted file mode 100644 index 2ac41b875..000000000 --- a/src/test/ui/resolve/resolve-bad-visibility.stderr +++ /dev/null @@ -1,38 +0,0 @@ -error[E0577]: expected module, found enum `E` - --> $DIR/resolve-bad-visibility.rs:4:8 - | -LL | pub(in E) struct S; - | ^ not a module - -error[E0577]: expected module, found trait `Tr` - --> $DIR/resolve-bad-visibility.rs:5:8 - | -LL | pub(in Tr) struct Z; - | ^^ not a module - -error[E0742]: visibilities can only be restricted to ancestor modules - --> $DIR/resolve-bad-visibility.rs:6:8 - | -LL | pub(in std::vec) struct F; - | ^^^^^^^^ - -error[E0433]: failed to resolve: maybe a missing crate `nonexistent`? - --> $DIR/resolve-bad-visibility.rs:7:8 - | -LL | pub(in nonexistent) struct G; - | ^^^^^^^^^^^ maybe a missing crate `nonexistent`? - | - = help: consider adding `extern crate nonexistent` to use the `nonexistent` crate - -error[E0433]: failed to resolve: maybe a missing crate `too_soon`? - --> $DIR/resolve-bad-visibility.rs:8:8 - | -LL | pub(in too_soon) struct H; - | ^^^^^^^^ maybe a missing crate `too_soon`? - | - = help: consider adding `extern crate too_soon` to use the `too_soon` crate - -error: aborting due to 5 previous errors - -Some errors have detailed explanations: E0433, E0577, E0742. -For more information about an error, try `rustc --explain E0433`. diff --git a/src/test/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.rs b/src/test/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.rs deleted file mode 100644 index 3cb6ab52e..000000000 --- a/src/test/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.rs +++ /dev/null @@ -1,4 +0,0 @@ -extern crate std; -//~^ ERROR the name `std` is defined multiple times - -fn main(){} diff --git a/src/test/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr b/src/test/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr deleted file mode 100644 index ea6cb9eb0..000000000 --- a/src/test/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0259]: the name `std` is defined multiple times - | - = note: `std` must be defined only once in the type namespace of this module -help: you can use `as` to change the binding name of the import - | -LL | extern crate std as other_std; - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0259`. diff --git a/src/test/ui/resolve/resolve-conflict-import-vs-extern-crate.rs b/src/test/ui/resolve/resolve-conflict-import-vs-extern-crate.rs deleted file mode 100644 index 10772e7a4..000000000 --- a/src/test/ui/resolve/resolve-conflict-import-vs-extern-crate.rs +++ /dev/null @@ -1,4 +0,0 @@ -use std::slice as std; //~ ERROR the name `std` is defined multiple times - -fn main() { -} diff --git a/src/test/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr b/src/test/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr deleted file mode 100644 index abf068a1f..000000000 --- a/src/test/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0254]: the name `std` is defined multiple times - --> $DIR/resolve-conflict-import-vs-extern-crate.rs:1:5 - | -LL | use std::slice as std; - | ^^^^^^^^^^^^^^^^^ `std` reimported here - | - = note: `std` must be defined only once in the type namespace of this module -help: you can use `as` to change the binding name of the import - | -LL | use std::slice as other_std; - | ~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0254`. diff --git a/src/test/ui/resolve/resolve-conflict-import-vs-import.fixed b/src/test/ui/resolve/resolve-conflict-import-vs-import.fixed deleted file mode 100644 index e429513b5..000000000 --- a/src/test/ui/resolve/resolve-conflict-import-vs-import.fixed +++ /dev/null @@ -1,9 +0,0 @@ -// run-rustfix - -#[allow(unused_imports)] -use std::mem::transmute; - -//~^ ERROR the name `transmute` is defined multiple times - -fn main() { -} diff --git a/src/test/ui/resolve/resolve-conflict-import-vs-import.rs b/src/test/ui/resolve/resolve-conflict-import-vs-import.rs deleted file mode 100644 index 43853117a..000000000 --- a/src/test/ui/resolve/resolve-conflict-import-vs-import.rs +++ /dev/null @@ -1,9 +0,0 @@ -// run-rustfix - -#[allow(unused_imports)] -use std::mem::transmute; -use std::mem::transmute; -//~^ ERROR the name `transmute` is defined multiple times - -fn main() { -} diff --git a/src/test/ui/resolve/resolve-conflict-import-vs-import.stderr b/src/test/ui/resolve/resolve-conflict-import-vs-import.stderr deleted file mode 100644 index 632be50f4..000000000 --- a/src/test/ui/resolve/resolve-conflict-import-vs-import.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0252]: the name `transmute` is defined multiple times - --> $DIR/resolve-conflict-import-vs-import.rs:5:5 - | -LL | use std::mem::transmute; - | ------------------- previous import of the value `transmute` here -LL | use std::mem::transmute; - | ^^^^^^^^^^^^^^^^^^^ `transmute` reimported here - | - = note: `transmute` must be defined only once in the value namespace of this module - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0252`. diff --git a/src/test/ui/resolve/resolve-conflict-item-vs-extern-crate.rs b/src/test/ui/resolve/resolve-conflict-item-vs-extern-crate.rs deleted file mode 100644 index 122606249..000000000 --- a/src/test/ui/resolve/resolve-conflict-item-vs-extern-crate.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn std() {} -mod std {} //~ ERROR the name `std` is defined multiple times - -fn main() { -} diff --git a/src/test/ui/resolve/resolve-conflict-item-vs-extern-crate.stderr b/src/test/ui/resolve/resolve-conflict-item-vs-extern-crate.stderr deleted file mode 100644 index 7b9fb6c63..000000000 --- a/src/test/ui/resolve/resolve-conflict-item-vs-extern-crate.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0260]: the name `std` is defined multiple times - --> $DIR/resolve-conflict-item-vs-extern-crate.rs:2:1 - | -LL | mod std {} - | ^^^^^^^ `std` redefined here - | - = note: `std` must be defined only once in the type namespace of this module - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0260`. diff --git a/src/test/ui/resolve/resolve-conflict-item-vs-import.rs b/src/test/ui/resolve/resolve-conflict-item-vs-import.rs deleted file mode 100644 index 4308c7a27..000000000 --- a/src/test/ui/resolve/resolve-conflict-item-vs-import.rs +++ /dev/null @@ -1,8 +0,0 @@ -use std::mem::transmute; - -fn transmute() {} -//~^ ERROR the name `transmute` is defined multiple times -//~| `transmute` redefined here -//~| `transmute` must be defined only once in the value namespace of this module -fn main() { -} diff --git a/src/test/ui/resolve/resolve-conflict-item-vs-import.stderr b/src/test/ui/resolve/resolve-conflict-item-vs-import.stderr deleted file mode 100644 index 5e5c9f6b3..000000000 --- a/src/test/ui/resolve/resolve-conflict-item-vs-import.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0255]: the name `transmute` is defined multiple times - --> $DIR/resolve-conflict-item-vs-import.rs:3:1 - | -LL | use std::mem::transmute; - | ------------------- previous import of the value `transmute` here -LL | -LL | fn transmute() {} - | ^^^^^^^^^^^^^^ `transmute` redefined here - | - = note: `transmute` must be defined only once in the value namespace of this module -help: you can use `as` to change the binding name of the import - | -LL | use std::mem::transmute as other_transmute; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0255`. diff --git a/src/test/ui/resolve/resolve-conflict-type-vs-import.rs b/src/test/ui/resolve/resolve-conflict-type-vs-import.rs deleted file mode 100644 index 3abce8396..000000000 --- a/src/test/ui/resolve/resolve-conflict-type-vs-import.rs +++ /dev/null @@ -1,7 +0,0 @@ -use std::slice::Iter; - -struct Iter; -//~^ ERROR the name `Iter` is defined multiple times - -fn main() { -} diff --git a/src/test/ui/resolve/resolve-conflict-type-vs-import.stderr b/src/test/ui/resolve/resolve-conflict-type-vs-import.stderr deleted file mode 100644 index 198ef1031..000000000 --- a/src/test/ui/resolve/resolve-conflict-type-vs-import.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0255]: the name `Iter` is defined multiple times - --> $DIR/resolve-conflict-type-vs-import.rs:3:1 - | -LL | use std::slice::Iter; - | ---------------- previous import of the type `Iter` here -LL | -LL | struct Iter; - | ^^^^^^^^^^^^ `Iter` redefined here - | - = note: `Iter` must be defined only once in the type namespace of this module -help: you can use `as` to change the binding name of the import - | -LL | use std::slice::Iter as OtherIter; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0255`. diff --git a/src/test/ui/resolve/resolve-hint-macro.fixed b/src/test/ui/resolve/resolve-hint-macro.fixed deleted file mode 100644 index 54e016084..000000000 --- a/src/test/ui/resolve/resolve-hint-macro.fixed +++ /dev/null @@ -1,11 +0,0 @@ -// run-rustfix -fn main() { - assert_eq!(1, 1); - //~^ ERROR expected function, found macro `assert_eq` - assert_eq! { 1, 1 }; - //~^ ERROR expected struct, variant or union type, found macro `assert_eq` - //~| ERROR expected identifier, found `1` - //~| ERROR expected identifier, found `1` - assert![true]; - //~^ ERROR expected value, found macro `assert` -} diff --git a/src/test/ui/resolve/resolve-hint-macro.rs b/src/test/ui/resolve/resolve-hint-macro.rs deleted file mode 100644 index f16e8c075..000000000 --- a/src/test/ui/resolve/resolve-hint-macro.rs +++ /dev/null @@ -1,11 +0,0 @@ -// run-rustfix -fn main() { - assert_eq(1, 1); - //~^ ERROR expected function, found macro `assert_eq` - assert_eq { 1, 1 }; - //~^ ERROR expected struct, variant or union type, found macro `assert_eq` - //~| ERROR expected identifier, found `1` - //~| ERROR expected identifier, found `1` - assert[true]; - //~^ ERROR expected value, found macro `assert` -} diff --git a/src/test/ui/resolve/resolve-hint-macro.stderr b/src/test/ui/resolve/resolve-hint-macro.stderr deleted file mode 100644 index 1e7ab48ef..000000000 --- a/src/test/ui/resolve/resolve-hint-macro.stderr +++ /dev/null @@ -1,53 +0,0 @@ -error: expected identifier, found `1` - --> $DIR/resolve-hint-macro.rs:5:17 - | -LL | assert_eq { 1, 1 }; - | --------- ^ expected identifier - | | - | while parsing this struct - -error: expected identifier, found `1` - --> $DIR/resolve-hint-macro.rs:5:20 - | -LL | assert_eq { 1, 1 }; - | --------- ^ expected identifier - | | - | while parsing this struct - -error[E0574]: expected struct, variant or union type, found macro `assert_eq` - --> $DIR/resolve-hint-macro.rs:5:5 - | -LL | assert_eq { 1, 1 }; - | ^^^^^^^^^ not a struct, variant or union type - | -help: use `!` to invoke the macro - | -LL | assert_eq! { 1, 1 }; - | + - -error[E0423]: expected value, found macro `assert` - --> $DIR/resolve-hint-macro.rs:9:5 - | -LL | assert[true]; - | ^^^^^^ not a value - | -help: use `!` to invoke the macro - | -LL | assert![true]; - | + - -error[E0423]: expected function, found macro `assert_eq` - --> $DIR/resolve-hint-macro.rs:3:5 - | -LL | assert_eq(1, 1); - | ^^^^^^^^^ not a function - | -help: use `!` to invoke the macro - | -LL | assert_eq!(1, 1); - | + - -error: aborting due to 5 previous errors - -Some errors have detailed explanations: E0423, E0574. -For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/ui/resolve/resolve-inconsistent-binding-mode.rs b/src/test/ui/resolve/resolve-inconsistent-binding-mode.rs deleted file mode 100644 index 43e9378b7..000000000 --- a/src/test/ui/resolve/resolve-inconsistent-binding-mode.rs +++ /dev/null @@ -1,41 +0,0 @@ -enum Opts { - A(isize), - B(isize), - C(isize), -} - -fn matcher1(x: Opts) { - match x { - Opts::A(ref i) | Opts::B(i) => {} - //~^ ERROR variable `i` is bound inconsistently - //~^^ ERROR mismatched types - Opts::C(_) => {} - } -} - -fn matcher2(x: Opts) { - match x { - Opts::A(ref i) | Opts::B(i) => {} - //~^ ERROR variable `i` is bound inconsistently - //~^^ ERROR mismatched types - Opts::C(_) => {} - } -} - -fn matcher4(x: Opts) { - match x { - Opts::A(ref mut i) | Opts::B(ref i) => {} - //~^ ERROR variable `i` is bound inconsistently - //~^^ ERROR mismatched types - Opts::C(_) => {} - } -} - -fn matcher5(x: Opts) { - match x { - Opts::A(ref i) | Opts::B(ref i) => {} - Opts::C(_) => {} - } -} - -fn main() {} diff --git a/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr b/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr deleted file mode 100644 index c805c9eb1..000000000 --- a/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr +++ /dev/null @@ -1,72 +0,0 @@ -error[E0409]: variable `i` is bound inconsistently across alternatives separated by `|` - --> $DIR/resolve-inconsistent-binding-mode.rs:9:34 - | -LL | Opts::A(ref i) | Opts::B(i) => {} - | - ^ bound in different ways - | | - | first binding - -error[E0409]: variable `i` is bound inconsistently across alternatives separated by `|` - --> $DIR/resolve-inconsistent-binding-mode.rs:18:34 - | -LL | Opts::A(ref i) | Opts::B(i) => {} - | - ^ bound in different ways - | | - | first binding - -error[E0409]: variable `i` is bound inconsistently across alternatives separated by `|` - --> $DIR/resolve-inconsistent-binding-mode.rs:27:42 - | -LL | Opts::A(ref mut i) | Opts::B(ref i) => {} - | - first binding ^ bound in different ways - -error[E0308]: mismatched types - --> $DIR/resolve-inconsistent-binding-mode.rs:9:34 - | -LL | match x { - | - this expression has type `Opts` -LL | Opts::A(ref i) | Opts::B(i) => {} - | ----- ^ expected `&isize`, found `isize` - | | - | first introduced with type `&isize` here - | - = note: in the same arm, a binding must have the same type in all alternatives -help: consider adding `ref` - | -LL | Opts::A(ref i) | Opts::B(ref i) => {} - | +++ - -error[E0308]: mismatched types - --> $DIR/resolve-inconsistent-binding-mode.rs:18:34 - | -LL | match x { - | - this expression has type `Opts` -LL | Opts::A(ref i) | Opts::B(i) => {} - | ----- ^ expected `&isize`, found `isize` - | | - | first introduced with type `&isize` here - | - = note: in the same arm, a binding must have the same type in all alternatives -help: consider adding `ref` - | -LL | Opts::A(ref i) | Opts::B(ref i) => {} - | +++ - -error[E0308]: mismatched types - --> $DIR/resolve-inconsistent-binding-mode.rs:27:38 - | -LL | match x { - | - this expression has type `Opts` -LL | Opts::A(ref mut i) | Opts::B(ref i) => {} - | --------- ^^^^^ types differ in mutability - | | - | first introduced with type `&mut isize` here - | - = note: expected mutable reference `&mut isize` - found reference `&isize` - = note: in the same arm, a binding must have the same type in all alternatives - -error: aborting due to 6 previous errors - -Some errors have detailed explanations: E0308, E0409. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/resolve/resolve-inconsistent-names.rs b/src/test/ui/resolve/resolve-inconsistent-names.rs deleted file mode 100644 index 9a40b2034..000000000 --- a/src/test/ui/resolve/resolve-inconsistent-names.rs +++ /dev/null @@ -1,36 +0,0 @@ -#![allow(non_camel_case_types)] - -enum E { A, B, c } - -pub mod m { - const CONST1: usize = 10; - pub const Const2: usize = 20; -} - -fn main() { - let y = 1; - match y { - a | b => {} //~ ERROR variable `a` is not bound in all patterns - //~| ERROR variable `b` is not bound in all patterns - } - - let x = (E::A, E::B); - match x { - (A, B) | (ref B, c) | (c, A) => () - //~^ ERROR variable `A` is not bound in all patterns - //~| ERROR variable `B` is not bound in all patterns - //~| ERROR variable `B` is bound inconsistently - //~| ERROR mismatched types - //~| ERROR variable `c` is not bound in all patterns - //~| HELP if you meant to match on unit variant `E::A`, use the full path in the pattern - //~| HELP consider removing `ref` - } - - let z = (10, 20); - match z { - (CONST1, _) | (_, Const2) => () - //~^ ERROR variable `CONST1` is not bound in all patterns - //~| ERROR variable `Const2` is not bound in all patterns - //~| HELP if you meant to match on constant `m::Const2`, use the full path in the pattern - } -} diff --git a/src/test/ui/resolve/resolve-inconsistent-names.stderr b/src/test/ui/resolve/resolve-inconsistent-names.stderr deleted file mode 100644 index 773c9f6cd..000000000 --- a/src/test/ui/resolve/resolve-inconsistent-names.stderr +++ /dev/null @@ -1,104 +0,0 @@ -error[E0408]: variable `a` is not bound in all patterns - --> $DIR/resolve-inconsistent-names.rs:13:12 - | -LL | a | b => {} - | - ^ pattern doesn't bind `a` - | | - | variable not in all patterns - -error[E0408]: variable `b` is not bound in all patterns - --> $DIR/resolve-inconsistent-names.rs:13:8 - | -LL | a | b => {} - | ^ - variable not in all patterns - | | - | pattern doesn't bind `b` - -error[E0408]: variable `A` is not bound in all patterns - --> $DIR/resolve-inconsistent-names.rs:19:18 - | -LL | (A, B) | (ref B, c) | (c, A) => () - | - ^^^^^^^^^^ - variable not in all patterns - | | | - | | pattern doesn't bind `A` - | variable not in all patterns - | -help: if you meant to match on unit variant `E::A`, use the full path in the pattern - | -LL | (E::A, B) | (ref B, c) | (c, A) => () - | ~~~~ - -error[E0408]: variable `B` is not bound in all patterns - --> $DIR/resolve-inconsistent-names.rs:19:31 - | -LL | (A, B) | (ref B, c) | (c, A) => () - | - - ^^^^^^ pattern doesn't bind `B` - | | | - | | variable not in all patterns - | variable not in all patterns - -error[E0408]: variable `c` is not bound in all patterns - --> $DIR/resolve-inconsistent-names.rs:19:9 - | -LL | (A, B) | (ref B, c) | (c, A) => () - | ^^^^^^ - - variable not in all patterns - | | | - | | variable not in all patterns - | pattern doesn't bind `c` - -error[E0409]: variable `B` is bound inconsistently across alternatives separated by `|` - --> $DIR/resolve-inconsistent-names.rs:19:23 - | -LL | (A, B) | (ref B, c) | (c, A) => () - | - ^ bound in different ways - | | - | first binding - -error[E0408]: variable `CONST1` is not bound in all patterns - --> $DIR/resolve-inconsistent-names.rs:31:23 - | -LL | (CONST1, _) | (_, Const2) => () - | ------ ^^^^^^^^^^^ pattern doesn't bind `CONST1` - | | - | variable not in all patterns - | -note: you might have meant to match on constant `m::CONST1`, which exists but is inaccessible - --> $DIR/resolve-inconsistent-names.rs:6:5 - | -LL | const CONST1: usize = 10; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ not accessible - -error[E0408]: variable `Const2` is not bound in all patterns - --> $DIR/resolve-inconsistent-names.rs:31:9 - | -LL | (CONST1, _) | (_, Const2) => () - | ^^^^^^^^^^^ ------ variable not in all patterns - | | - | pattern doesn't bind `Const2` - | -help: if you meant to match on constant `m::Const2`, use the full path in the pattern - | -LL | (CONST1, _) | (_, m::Const2) => () - | ~~~~~~~~~ - -error[E0308]: mismatched types - --> $DIR/resolve-inconsistent-names.rs:19:19 - | -LL | match x { - | - this expression has type `(E, E)` -LL | (A, B) | (ref B, c) | (c, A) => () - | - ^^^^^ expected enum `E`, found `&E` - | | - | first introduced with type `E` here - | - = note: in the same arm, a binding must have the same type in all alternatives -help: consider removing `ref` - | -LL - (A, B) | (ref B, c) | (c, A) => () -LL + (A, B) | (B, c) | (c, A) => () - | - -error: aborting due to 9 previous errors - -Some errors have detailed explanations: E0308, E0408, E0409. -For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/resolve/resolve-issue-2428.rs b/src/test/ui/resolve/resolve-issue-2428.rs deleted file mode 100644 index 5f3473e9f..000000000 --- a/src/test/ui/resolve/resolve-issue-2428.rs +++ /dev/null @@ -1,8 +0,0 @@ -// run-pass - -#![allow(non_camel_case_types)] -#![allow(non_upper_case_globals)] - -const foo: isize = 4 >> 1; -enum bs { thing = foo } -pub fn main() { assert_eq!(bs::thing as isize, foo); } diff --git a/src/test/ui/resolve/resolve-label.rs b/src/test/ui/resolve/resolve-label.rs deleted file mode 100644 index ac5410cd3..000000000 --- a/src/test/ui/resolve/resolve-label.rs +++ /dev/null @@ -1,13 +0,0 @@ -fn f() { - 'l: loop { - fn g() { - loop { - break 'l; //~ ERROR use of unreachable label - } - } - } - - loop { 'w: while break 'w { } } -} - -fn main() {} diff --git a/src/test/ui/resolve/resolve-label.stderr b/src/test/ui/resolve/resolve-label.stderr deleted file mode 100644 index 5729348ef..000000000 --- a/src/test/ui/resolve/resolve-label.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0767]: use of unreachable label `'l` - --> $DIR/resolve-label.rs:5:23 - | -LL | 'l: loop { - | -- unreachable label defined here -... -LL | break 'l; - | ^^ unreachable label `'l` - | - = note: labels are unreachable through functions, closures, async blocks and modules - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0767`. diff --git a/src/test/ui/resolve/resolve-primitive-fallback.rs b/src/test/ui/resolve/resolve-primitive-fallback.rs deleted file mode 100644 index 992bcd797..000000000 --- a/src/test/ui/resolve/resolve-primitive-fallback.rs +++ /dev/null @@ -1,10 +0,0 @@ -fn main() { - // Make sure primitive type fallback doesn't work in value namespace - std::mem::size_of(u16); - //~^ ERROR expected value, found builtin type `u16` - //~| ERROR this function takes 0 arguments but 1 argument was supplied - - // Make sure primitive type fallback doesn't work with global paths - let _: ::u8; - //~^ ERROR cannot find type `u8` in the crate root -} diff --git a/src/test/ui/resolve/resolve-primitive-fallback.stderr b/src/test/ui/resolve/resolve-primitive-fallback.stderr deleted file mode 100644 index 6d5d5bad9..000000000 --- a/src/test/ui/resolve/resolve-primitive-fallback.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error[E0423]: expected value, found builtin type `u16` - --> $DIR/resolve-primitive-fallback.rs:3:23 - | -LL | std::mem::size_of(u16); - | ^^^ not a value - -error[E0412]: cannot find type `u8` in the crate root - --> $DIR/resolve-primitive-fallback.rs:8:14 - | -LL | let _: ::u8; - | ^^ not found in the crate root - | -help: consider importing this builtin type - | -LL | use std::primitive::u8; - | -help: if you import `u8`, refer to it directly - | -LL - let _: ::u8; -LL + let _: u8; - | - -error[E0061]: this function takes 0 arguments but 1 argument was supplied - --> $DIR/resolve-primitive-fallback.rs:3:5 - | -LL | std::mem::size_of(u16); - | ^^^^^^^^^^^^^^^^^ --- argument unexpected - | -note: function defined here - --> $SRC_DIR/core/src/mem/mod.rs:LL:COL - | -LL | pub const fn size_of<T>() -> usize { - | ^^^^^^^ -help: remove the extra argument - | -LL | std::mem::size_of(); - | ~~ - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0061, E0412, E0423. -For more information about an error, try `rustc --explain E0061`. diff --git a/src/test/ui/resolve/resolve-pseudo-shadowing.rs b/src/test/ui/resolve/resolve-pseudo-shadowing.rs deleted file mode 100644 index 85c684ca0..000000000 --- a/src/test/ui/resolve/resolve-pseudo-shadowing.rs +++ /dev/null @@ -1,11 +0,0 @@ -// run-pass -// check that type parameters can't "shadow" qualified paths. - -fn check<Clone>(_c: Clone) { - fn check2() { - let _ = <() as std::clone::Clone>::clone(&()); - } - check2(); -} - -fn main() { check(()); } diff --git a/src/test/ui/resolve/resolve-self-in-impl-2.rs b/src/test/ui/resolve/resolve-self-in-impl-2.rs deleted file mode 100644 index f586760c8..000000000 --- a/src/test/ui/resolve/resolve-self-in-impl-2.rs +++ /dev/null @@ -1,7 +0,0 @@ -struct S<T = u8>(T); -trait Tr<T = u8> {} - -impl Self for S {} //~ ERROR expected trait, found self type `Self` -impl Self::N for S {} //~ ERROR cannot find trait `N` in `Self` - -fn main() {} diff --git a/src/test/ui/resolve/resolve-self-in-impl-2.stderr b/src/test/ui/resolve/resolve-self-in-impl-2.stderr deleted file mode 100644 index 3791fe90a..000000000 --- a/src/test/ui/resolve/resolve-self-in-impl-2.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0411]: expected trait, found self type `Self` - --> $DIR/resolve-self-in-impl-2.rs:4:6 - | -LL | impl Self for S {} - | ^^^^ `Self` is only available in impls, traits, and type definitions - -error[E0405]: cannot find trait `N` in `Self` - --> $DIR/resolve-self-in-impl-2.rs:5:12 - | -LL | impl Self::N for S {} - | ^ not found in `Self` - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0405, E0411. -For more information about an error, try `rustc --explain E0405`. diff --git a/src/test/ui/resolve/resolve-self-in-impl.rs b/src/test/ui/resolve/resolve-self-in-impl.rs deleted file mode 100644 index d0872d1b7..000000000 --- a/src/test/ui/resolve/resolve-self-in-impl.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![feature(associated_type_defaults)] - -struct S<T = u8>(T); -trait Tr<T = u8> { - type A = (); -} - -impl Tr<Self> for S {} // OK -impl<T: Tr<Self>> Tr<T> for S {} // OK -impl Tr for S where Self: Copy {} // OK -impl Tr for S where S<Self>: Copy {} // OK -impl Tr for S where Self::A: Copy {} // OK - -impl Tr for Self {} //~ ERROR `Self` is not valid in the self type of an impl block -impl Tr for S<Self> {} //~ ERROR `Self` is not valid in the self type of an impl block -impl Self {} //~ ERROR `Self` is not valid in the self type of an impl block -impl S<Self> {} //~ ERROR `Self` is not valid in the self type of an impl block -impl (Self, Self) {} //~ ERROR `Self` is not valid in the self type of an impl block -impl Tr<Self::A> for S {} //~ ERROR cycle detected - -fn main() {} diff --git a/src/test/ui/resolve/resolve-self-in-impl.stderr b/src/test/ui/resolve/resolve-self-in-impl.stderr deleted file mode 100644 index b3042d413..000000000 --- a/src/test/ui/resolve/resolve-self-in-impl.stderr +++ /dev/null @@ -1,62 +0,0 @@ -error: `Self` is not valid in the self type of an impl block - --> $DIR/resolve-self-in-impl.rs:16:6 - | -LL | impl Self {} - | ^^^^ - | - = note: replace `Self` with a different type - -error: `Self` is not valid in the self type of an impl block - --> $DIR/resolve-self-in-impl.rs:17:8 - | -LL | impl S<Self> {} - | ^^^^ - | - = note: replace `Self` with a different type - -error: `Self` is not valid in the self type of an impl block - --> $DIR/resolve-self-in-impl.rs:18:7 - | -LL | impl (Self, Self) {} - | ^^^^ ^^^^ - | - = note: replace `Self` with a different type - -error: `Self` is not valid in the self type of an impl block - --> $DIR/resolve-self-in-impl.rs:14:13 - | -LL | impl Tr for Self {} - | ^^^^ - | - = note: replace `Self` with a different type - -error: `Self` is not valid in the self type of an impl block - --> $DIR/resolve-self-in-impl.rs:15:15 - | -LL | impl Tr for S<Self> {} - | ^^^^ - | - = note: replace `Self` with a different type - -error[E0391]: cycle detected when computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:19:1: 19:23>` - --> $DIR/resolve-self-in-impl.rs:19:1 - | -LL | impl Tr<Self::A> for S {} - | ^^^^^^^^^^^^^^^^^^^^^^ - | - = note: ...which immediately requires computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:19:1: 19:23>` again -note: cycle used when collecting item types in top-level module - --> $DIR/resolve-self-in-impl.rs:1:1 - | -LL | / #![feature(associated_type_defaults)] -LL | | -LL | | struct S<T = u8>(T); -LL | | trait Tr<T = u8> { -... | -LL | | -LL | | fn main() {} - | |____________^ - -error: aborting due to 6 previous errors - -For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/ui/resolve/resolve-speculative-adjustment.rs b/src/test/ui/resolve/resolve-speculative-adjustment.rs deleted file mode 100644 index 81f757829..000000000 --- a/src/test/ui/resolve/resolve-speculative-adjustment.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Make sure speculative path resolution works properly when resolution -// adjustment happens and no extra errors is reported. - -struct S { - field: u8, -} - -trait Tr { - fn method(&self); -} - -impl Tr for S { - fn method(&self) { - fn g() { - // Speculative resolution of `Self` and `self` silently fails, - // "did you mean" messages are not printed. - field; - //~^ ERROR cannot find value `field` - method(); - //~^ ERROR cannot find function `method` - } - - field; - //~^ ERROR cannot find value `field` - method(); - //~^ ERROR cannot find function `method` - } -} - -fn main() {} diff --git a/src/test/ui/resolve/resolve-speculative-adjustment.stderr b/src/test/ui/resolve/resolve-speculative-adjustment.stderr deleted file mode 100644 index be11a7ebe..000000000 --- a/src/test/ui/resolve/resolve-speculative-adjustment.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0425]: cannot find value `field` in this scope - --> $DIR/resolve-speculative-adjustment.rs:17:13 - | -LL | field; - | ^^^^^ not found in this scope - -error[E0425]: cannot find value `field` in this scope - --> $DIR/resolve-speculative-adjustment.rs:23:9 - | -LL | field; - | ^^^^^ help: you might have meant to use the available field: `self.field` - -error[E0425]: cannot find function `method` in this scope - --> $DIR/resolve-speculative-adjustment.rs:25:9 - | -LL | method(); - | ^^^^^^ help: you might have meant to call the method: `self.method` - -error[E0425]: cannot find function `method` in this scope - --> $DIR/resolve-speculative-adjustment.rs:19:13 - | -LL | method(); - | ^^^^^^ not found in this scope - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/resolve-type-param-in-item-in-trait.rs b/src/test/ui/resolve/resolve-type-param-in-item-in-trait.rs deleted file mode 100644 index c77a66524..000000000 --- a/src/test/ui/resolve/resolve-type-param-in-item-in-trait.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Issue #14603: Check for references to type parameters from the -// outer scope (in this case, the trait) used on items in an inner -// scope (in this case, the enum). - -trait TraitA<A> { - fn outer(&self) { - enum Foo<B> { - Variance(A) - //~^ ERROR can't use generic parameters from outer function - } - } -} - -trait TraitB<A> { - fn outer(&self) { - struct Foo<B>(A); - //~^ ERROR can't use generic parameters from outer function - } -} - -trait TraitC<A> { - fn outer(&self) { - struct Foo<B> { a: A } - //~^ ERROR can't use generic parameters from outer function - } -} - -trait TraitD<A> { - fn outer(&self) { - fn foo<B>(a: A) { } - //~^ ERROR can't use generic parameters from outer function - } -} - -fn main() { } diff --git a/src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr b/src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr deleted file mode 100644 index 0a6d1cc3b..000000000 --- a/src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr +++ /dev/null @@ -1,47 +0,0 @@ -error[E0401]: can't use generic parameters from outer function - --> $DIR/resolve-type-param-in-item-in-trait.rs:8:22 - | -LL | trait TraitA<A> { - | - type parameter from outer function -LL | fn outer(&self) { -LL | enum Foo<B> { - | - help: try using a local generic parameter instead: `A,` -LL | Variance(A) - | ^ use of generic parameter from outer function - -error[E0401]: can't use generic parameters from outer function - --> $DIR/resolve-type-param-in-item-in-trait.rs:16:23 - | -LL | trait TraitB<A> { - | - type parameter from outer function -LL | fn outer(&self) { -LL | struct Foo<B>(A); - | - ^ use of generic parameter from outer function - | | - | help: try using a local generic parameter instead: `A,` - -error[E0401]: can't use generic parameters from outer function - --> $DIR/resolve-type-param-in-item-in-trait.rs:23:28 - | -LL | trait TraitC<A> { - | - type parameter from outer function -LL | fn outer(&self) { -LL | struct Foo<B> { a: A } - | - ^ use of generic parameter from outer function - | | - | help: try using a local generic parameter instead: `A,` - -error[E0401]: can't use generic parameters from outer function - --> $DIR/resolve-type-param-in-item-in-trait.rs:30:22 - | -LL | trait TraitD<A> { - | - type parameter from outer function -LL | fn outer(&self) { -LL | fn foo<B>(a: A) { } - | - ^ use of generic parameter from outer function - | | - | help: try using a local generic parameter instead: `A,` - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/resolve/resolve-unknown-trait.rs b/src/test/ui/resolve/resolve-unknown-trait.rs deleted file mode 100644 index 290893bbb..000000000 --- a/src/test/ui/resolve/resolve-unknown-trait.rs +++ /dev/null @@ -1,10 +0,0 @@ -trait NewTrait : SomeNonExistentTrait {} -//~^ ERROR cannot find trait `SomeNonExistentTrait` in this scope - -impl SomeNonExistentTrait for isize {} -//~^ ERROR cannot find trait `SomeNonExistentTrait` in this scope - -fn f<T:SomeNonExistentTrait>() {} -//~^ ERROR cannot find trait `SomeNonExistentTrait` in this scope - -fn main() {} diff --git a/src/test/ui/resolve/resolve-unknown-trait.stderr b/src/test/ui/resolve/resolve-unknown-trait.stderr deleted file mode 100644 index e19cfe617..000000000 --- a/src/test/ui/resolve/resolve-unknown-trait.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0405]: cannot find trait `SomeNonExistentTrait` in this scope - --> $DIR/resolve-unknown-trait.rs:1:18 - | -LL | trait NewTrait : SomeNonExistentTrait {} - | ^^^^^^^^^^^^^^^^^^^^ not found in this scope - -error[E0405]: cannot find trait `SomeNonExistentTrait` in this scope - --> $DIR/resolve-unknown-trait.rs:4:6 - | -LL | impl SomeNonExistentTrait for isize {} - | ^^^^^^^^^^^^^^^^^^^^ not found in this scope - -error[E0405]: cannot find trait `SomeNonExistentTrait` in this scope - --> $DIR/resolve-unknown-trait.rs:7:8 - | -LL | fn f<T:SomeNonExistentTrait>() {} - | ^^^^^^^^^^^^^^^^^^^^ not found in this scope - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0405`. diff --git a/src/test/ui/resolve/resolve-variant-assoc-item.rs b/src/test/ui/resolve/resolve-variant-assoc-item.rs deleted file mode 100644 index db4fedfb0..000000000 --- a/src/test/ui/resolve/resolve-variant-assoc-item.rs +++ /dev/null @@ -1,7 +0,0 @@ -enum E { V } -use E::V; - -fn main() { - E::V::associated_item; //~ ERROR failed to resolve: `V` is a variant, not a module - V::associated_item; //~ ERROR failed to resolve: `V` is a variant, not a module -} diff --git a/src/test/ui/resolve/resolve-variant-assoc-item.stderr b/src/test/ui/resolve/resolve-variant-assoc-item.stderr deleted file mode 100644 index 4be101996..000000000 --- a/src/test/ui/resolve/resolve-variant-assoc-item.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0433]: failed to resolve: `V` is a variant, not a module - --> $DIR/resolve-variant-assoc-item.rs:5:8 - | -LL | E::V::associated_item; - | ^ `V` is a variant, not a module - -error[E0433]: failed to resolve: `V` is a variant, not a module - --> $DIR/resolve-variant-assoc-item.rs:6:5 - | -LL | V::associated_item; - | ^ `V` is a variant, not a module - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/resolve/shadow-const-param.rs b/src/test/ui/resolve/shadow-const-param.rs deleted file mode 100644 index c435c16dc..000000000 --- a/src/test/ui/resolve/shadow-const-param.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Checks that const parameters cannot be shadowed with fresh bindings -// even in syntactically unambiguous contexts. See -// https://github.com/rust-lang/rust/issues/33118#issuecomment-233962221 - -fn foo<const N: i32>(i: i32) -> bool { - match i { - N @ _ => true, - //~^ ERROR: match bindings cannot shadow const parameters [E0530] - } -} - -fn bar<const N: i32>(i: i32) -> bool { - let N @ _ = 0; - //~^ ERROR: let bindings cannot shadow const parameters [E0530] - match i { - N @ _ => true, - } -} - -fn main() {} diff --git a/src/test/ui/resolve/shadow-const-param.stderr b/src/test/ui/resolve/shadow-const-param.stderr deleted file mode 100644 index fbd0d8110..000000000 --- a/src/test/ui/resolve/shadow-const-param.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error[E0530]: match bindings cannot shadow const parameters - --> $DIR/shadow-const-param.rs:7:9 - | -LL | fn foo<const N: i32>(i: i32) -> bool { - | - the const parameter `N` is defined here -LL | match i { -LL | N @ _ => true, - | ^ cannot be named the same as a const parameter - -error[E0530]: let bindings cannot shadow const parameters - --> $DIR/shadow-const-param.rs:13:9 - | -LL | fn bar<const N: i32>(i: i32) -> bool { - | - the const parameter `N` is defined here -LL | let N @ _ = 0; - | ^ cannot be named the same as a const parameter - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0530`. diff --git a/src/test/ui/resolve/suggest-path-for-tuple-struct.rs b/src/test/ui/resolve/suggest-path-for-tuple-struct.rs deleted file mode 100644 index c8bc3e79f..000000000 --- a/src/test/ui/resolve/suggest-path-for-tuple-struct.rs +++ /dev/null @@ -1,26 +0,0 @@ -mod module { - pub struct SomeTupleStruct(u8); - pub struct SomeRegularStruct { - foo: u8 - } - - impl SomeTupleStruct { - pub fn new() -> Self { - Self(0) - } - } - impl SomeRegularStruct { - pub fn new() -> Self { - Self { foo: 0 } - } - } -} - -use module::{SomeTupleStruct, SomeRegularStruct}; - -fn main() { - let _ = SomeTupleStruct.new(); - //~^ ERROR expected value, found struct `SomeTupleStruct` - let _ = SomeRegularStruct.new(); - //~^ ERROR expected value, found struct `SomeRegularStruct` -} diff --git a/src/test/ui/resolve/suggest-path-for-tuple-struct.stderr b/src/test/ui/resolve/suggest-path-for-tuple-struct.stderr deleted file mode 100644 index 4764cf2db..000000000 --- a/src/test/ui/resolve/suggest-path-for-tuple-struct.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0423]: expected value, found struct `SomeTupleStruct` - --> $DIR/suggest-path-for-tuple-struct.rs:22:13 - | -LL | let _ = SomeTupleStruct.new(); - | ^^^^^^^^^^^^^^^- help: use the path separator to refer to an item: `::` - -error[E0423]: expected value, found struct `SomeRegularStruct` - --> $DIR/suggest-path-for-tuple-struct.rs:24:13 - | -LL | let _ = SomeRegularStruct.new(); - | ^^^^^^^^^^^^^^^^^- help: use the path separator to refer to an item: `::` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0423`. diff --git a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.rs b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.rs deleted file mode 100644 index d5d6b13d6..000000000 --- a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.rs +++ /dev/null @@ -1,111 +0,0 @@ -// Beginners write `mod.item` when they should write `mod::item`. -// This tests that we suggest the latter when we encounter the former. - -pub mod a { - pub const I: i32 = 1; - - pub fn f() -> i32 { 2 } - - pub mod b { - pub const J: i32 = 3; - - pub fn g() -> i32 { 4 } - } -} - -fn h1() -> i32 { - a.I - //~^ ERROR expected value, found module `a` - //~| HELP use the path separator -} - -fn h2() -> i32 { - a.g() - //~^ ERROR expected value, found module `a` - //~| HELP use the path separator -} - -fn h3() -> i32 { - a.b.J - //~^ ERROR expected value, found module `a` - //~| HELP use the path separator -} - -fn h4() -> i32 { - a::b.J - //~^ ERROR expected value, found module `a::b` - //~| HELP a constant with a similar name exists - //~| HELP use the path separator -} - -fn h5() { - a.b.f(); - //~^ ERROR expected value, found module `a` - //~| HELP use the path separator - let v = Vec::new(); - v.push(a::b); - //~^ ERROR expected value, found module `a::b` - //~| HELP a constant with a similar name exists -} - -fn h6() -> i32 { - a::b.f() - //~^ ERROR expected value, found module `a::b` - //~| HELP a constant with a similar name exists - //~| HELP use the path separator -} - -fn h7() { - a::b - //~^ ERROR expected value, found module `a::b` - //~| HELP a constant with a similar name exists -} - -fn h8() -> i32 { - a::b() - //~^ ERROR expected function, found module `a::b` - //~| HELP a constant with a similar name exists -} - -macro_rules! module { - () => { - a - //~^ ERROR expected value, found module `a` - //~| ERROR expected value, found module `a` - }; -} - -macro_rules! create { - (method) => { - a.f() - //~^ ERROR expected value, found module `a` - //~| HELP use the path separator - }; - (field) => { - a.f - //~^ ERROR expected value, found module `a` - //~| HELP use the path separator - }; -} - -fn h9() { - // - // Note that if the receiver is a macro call, we do not want to suggest to replace - // `.` with `::` as that would be a syntax error. - // Since the receiver is a module and not a type, we cannot suggest to surround - // it with angle brackets. - // - - module!().g::<()>(); // no `help` here! - - module!().g; // no `help` here! - - // - // Ensure that the suggestion is shown for expressions inside of macro definitions. - // - - let _ = create!(method); - let _ = create!(field); -} - -fn main() {} diff --git a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr deleted file mode 100644 index a4ce0deeb..000000000 --- a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr +++ /dev/null @@ -1,140 +0,0 @@ -error[E0423]: expected value, found module `a` - --> $DIR/suggest-path-instead-of-mod-dot-item.rs:17:5 - | -LL | a.I - | ^- help: use the path separator to refer to an item: `::` - -error[E0423]: expected value, found module `a` - --> $DIR/suggest-path-instead-of-mod-dot-item.rs:23:5 - | -LL | a.g() - | ^- help: use the path separator to refer to an item: `::` - -error[E0423]: expected value, found module `a` - --> $DIR/suggest-path-instead-of-mod-dot-item.rs:29:5 - | -LL | a.b.J - | ^- help: use the path separator to refer to an item: `::` - -error[E0423]: expected value, found module `a::b` - --> $DIR/suggest-path-instead-of-mod-dot-item.rs:35:5 - | -LL | pub const I: i32 = 1; - | --------------------- similarly named constant `I` defined here -... -LL | a::b.J - | ^^^^ - | -help: use the path separator to refer to an item - | -LL | a::b::J - | ~~ -help: a constant with a similar name exists - | -LL | a::I.J - | ~ - -error[E0423]: expected value, found module `a` - --> $DIR/suggest-path-instead-of-mod-dot-item.rs:42:5 - | -LL | a.b.f(); - | ^- help: use the path separator to refer to an item: `::` - -error[E0423]: expected value, found module `a::b` - --> $DIR/suggest-path-instead-of-mod-dot-item.rs:46:12 - | -LL | pub const I: i32 = 1; - | --------------------- similarly named constant `I` defined here -... -LL | v.push(a::b); - | ^^^- - | | - | help: a constant with a similar name exists: `I` - -error[E0423]: expected value, found module `a::b` - --> $DIR/suggest-path-instead-of-mod-dot-item.rs:52:5 - | -LL | pub const I: i32 = 1; - | --------------------- similarly named constant `I` defined here -... -LL | a::b.f() - | ^^^^ - | -help: use the path separator to refer to an item - | -LL | a::b::f() - | ~~ -help: a constant with a similar name exists - | -LL | a::I.f() - | ~ - -error[E0423]: expected value, found module `a::b` - --> $DIR/suggest-path-instead-of-mod-dot-item.rs:59:5 - | -LL | pub const I: i32 = 1; - | --------------------- similarly named constant `I` defined here -... -LL | a::b - | ^^^- - | | - | help: a constant with a similar name exists: `I` - -error[E0423]: expected function, found module `a::b` - --> $DIR/suggest-path-instead-of-mod-dot-item.rs:65:5 - | -LL | pub const I: i32 = 1; - | --------------------- similarly named constant `I` defined here -... -LL | a::b() - | ^^^- - | | - | help: a constant with a similar name exists: `I` - -error[E0423]: expected value, found module `a` - --> $DIR/suggest-path-instead-of-mod-dot-item.rs:72:9 - | -LL | a - | ^ not a value -... -LL | module!().g::<()>(); // no `help` here! - | --------- in this macro invocation - | - = note: this error originates in the macro `module` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0423]: expected value, found module `a` - --> $DIR/suggest-path-instead-of-mod-dot-item.rs:72:9 - | -LL | a - | ^ not a value -... -LL | module!().g; // no `help` here! - | --------- in this macro invocation - | - = note: this error originates in the macro `module` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0423]: expected value, found module `a` - --> $DIR/suggest-path-instead-of-mod-dot-item.rs:80:9 - | -LL | a.f() - | ^- help: use the path separator to refer to an item: `::` -... -LL | let _ = create!(method); - | --------------- in this macro invocation - | - = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0423]: expected value, found module `a` - --> $DIR/suggest-path-instead-of-mod-dot-item.rs:85:9 - | -LL | a.f - | ^- help: use the path separator to refer to an item: `::` -... -LL | let _ = create!(field); - | -------------- in this macro invocation - | - = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 13 previous errors - -For more information about this error, try `rustc --explain E0423`. diff --git a/src/test/ui/resolve/token-error-correct-2.rs b/src/test/ui/resolve/token-error-correct-2.rs deleted file mode 100644 index f7c7d908c..000000000 --- a/src/test/ui/resolve/token-error-correct-2.rs +++ /dev/null @@ -1,7 +0,0 @@ -// Test that we do some basic error correction in the tokeniser (and don't ICE). - -fn main() { - if foo { - //~^ ERROR: cannot find value `foo` - ) //~ ERROR: mismatched closing delimiter: `)` -} diff --git a/src/test/ui/resolve/token-error-correct-2.stderr b/src/test/ui/resolve/token-error-correct-2.stderr deleted file mode 100644 index cca9f2dc8..000000000 --- a/src/test/ui/resolve/token-error-correct-2.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: mismatched closing delimiter: `)` - --> $DIR/token-error-correct-2.rs:4:12 - | -LL | if foo { - | ^ unclosed delimiter -LL | -LL | ) - | ^ mismatched closing delimiter - -error[E0425]: cannot find value `foo` in this scope - --> $DIR/token-error-correct-2.rs:4:8 - | -LL | if foo { - | ^^^ not found in this scope - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/token-error-correct-3.rs b/src/test/ui/resolve/token-error-correct-3.rs deleted file mode 100644 index 52934085f..000000000 --- a/src/test/ui/resolve/token-error-correct-3.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Test that we do some basic error correction in the tokeniser (and don't spew -// too many bogus errors). - -pub mod raw { - use std::{io, fs}; - use std::path::Path; - - pub fn ensure_dir_exists<P: AsRef<Path>, F: FnOnce(&Path)>(path: P, - callback: F) - -> io::Result<bool> { - if !is_directory(path.as_ref()) { - //~^ ERROR cannot find function `is_directory` - callback(path.as_ref(); - //~^ ERROR expected one of - fs::create_dir_all(path.as_ref()).map(|()| true) - } else { - //~^ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `)` - Ok(false); - } - - panic!(); - } -} - -fn main() {} diff --git a/src/test/ui/resolve/token-error-correct-3.stderr b/src/test/ui/resolve/token-error-correct-3.stderr deleted file mode 100644 index 77c87c784..000000000 --- a/src/test/ui/resolve/token-error-correct-3.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;` - --> $DIR/token-error-correct-3.rs:13:21 - | -LL | callback(path.as_ref(); - | ^ ^ help: `)` may belong here - | | - | unclosed delimiter - -error: expected one of `.`, `;`, `?`, `}`, or an operator, found `)` - --> $DIR/token-error-correct-3.rs:16:9 - | -LL | fs::create_dir_all(path.as_ref()).map(|()| true) - | - expected one of `.`, `;`, `?`, `}`, or an operator -LL | } else { - | ^ unexpected token - -error[E0425]: cannot find function `is_directory` in this scope - --> $DIR/token-error-correct-3.rs:11:13 - | -LL | if !is_directory(path.as_ref()) { - | ^^^^^^^^^^^^ not found in this scope - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/token-error-correct-4.fixed b/src/test/ui/resolve/token-error-correct-4.fixed deleted file mode 100644 index 064b9e74e..000000000 --- a/src/test/ui/resolve/token-error-correct-4.fixed +++ /dev/null @@ -1,10 +0,0 @@ -// run-rustfix -// Test that we do some basic error correction in the tokeniser and apply suggestions. - -fn setsuna(_: ()) {} - -fn kazusa() {} - -fn main() { - setsuna(kazusa()); //~ ERROR: expected one of -} //~ ERROR: expected expression diff --git a/src/test/ui/resolve/token-error-correct-4.rs b/src/test/ui/resolve/token-error-correct-4.rs deleted file mode 100644 index 5e31d71e7..000000000 --- a/src/test/ui/resolve/token-error-correct-4.rs +++ /dev/null @@ -1,10 +0,0 @@ -// run-rustfix -// Test that we do some basic error correction in the tokeniser and apply suggestions. - -fn setsuna(_: ()) {} - -fn kazusa() {} - -fn main() { - setsuna(kazusa(); //~ ERROR: expected one of -} //~ ERROR: expected expression diff --git a/src/test/ui/resolve/token-error-correct-4.stderr b/src/test/ui/resolve/token-error-correct-4.stderr deleted file mode 100644 index 81e5a1336..000000000 --- a/src/test/ui/resolve/token-error-correct-4.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;` - --> $DIR/token-error-correct-4.rs:9:12 - | -LL | setsuna(kazusa(); - | ^ ^ help: `)` may belong here - | | - | unclosed delimiter - -error: expected expression, found `)` - --> $DIR/token-error-correct-4.rs:10:1 - | -LL | } - | ^ expected expression - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/resolve/token-error-correct.rs b/src/test/ui/resolve/token-error-correct.rs deleted file mode 100644 index 4f74df0bf..000000000 --- a/src/test/ui/resolve/token-error-correct.rs +++ /dev/null @@ -1,9 +0,0 @@ -// Test that we do some basic error correction in the tokeniser. - -fn main() { - foo(bar(; - //~^ ERROR cannot find function `bar` in this scope -} -//~^ ERROR: mismatched closing delimiter: `}` - -fn foo(_: usize) {} diff --git a/src/test/ui/resolve/token-error-correct.stderr b/src/test/ui/resolve/token-error-correct.stderr deleted file mode 100644 index ca0c4c18a..000000000 --- a/src/test/ui/resolve/token-error-correct.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: mismatched closing delimiter: `}` - --> $DIR/token-error-correct.rs:4:12 - | -LL | fn main() { - | - closing delimiter possibly meant for this -LL | foo(bar(; - | ^ unclosed delimiter -LL | -LL | } - | ^ mismatched closing delimiter - -error[E0425]: cannot find function `bar` in this scope - --> $DIR/token-error-correct.rs:4:9 - | -LL | foo(bar(; - | ^^^ not found in this scope - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/tuple-struct-alias.rs b/src/test/ui/resolve/tuple-struct-alias.rs deleted file mode 100644 index 298e7e479..000000000 --- a/src/test/ui/resolve/tuple-struct-alias.rs +++ /dev/null @@ -1,9 +0,0 @@ -struct S(u8, u16); -type A = S; - -fn main() { - let s = A(0, 1); //~ ERROR expected function - match s { - A(..) => {} //~ ERROR expected tuple struct or tuple variant - } -} diff --git a/src/test/ui/resolve/tuple-struct-alias.stderr b/src/test/ui/resolve/tuple-struct-alias.stderr deleted file mode 100644 index a739ea43e..000000000 --- a/src/test/ui/resolve/tuple-struct-alias.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error[E0532]: expected tuple struct or tuple variant, found type alias `A` - --> $DIR/tuple-struct-alias.rs:7:9 - | -LL | struct S(u8, u16); - | ------------------ similarly named tuple struct `S` defined here -... -LL | A(..) => {} - | ^ help: a tuple struct with a similar name exists: `S` - | - = note: can't use a type alias as a constructor - -error[E0423]: expected function, tuple struct or tuple variant, found type alias `A` - --> $DIR/tuple-struct-alias.rs:5:13 - | -LL | struct S(u8, u16); - | ------------------ similarly named tuple struct `S` defined here -... -LL | let s = A(0, 1); - | ^ help: a tuple struct with a similar name exists: `S` - | - = note: can't use a type alias as a constructor - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0423, E0532. -For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs b/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs deleted file mode 100644 index ecd3f5881..000000000 --- a/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs +++ /dev/null @@ -1,46 +0,0 @@ -struct A { - config: String, -} - -impl A { - fn new(cofig: String) -> Self { - Self { config } //~ Error cannot find value `config` in this scope - } - - fn do_something(cofig: String) { - println!("{config}"); //~ Error cannot find value `config` in this scope - } - - fn self_is_available(self, cofig: String) { - println!("{config}"); //~ Error cannot find value `config` in this scope - } -} - -trait B { - const BAR: u32 = 3; - type Baz; - fn bar(&self); - fn baz(&self) {} - fn bah() {} -} - -impl B for Box<isize> { - type Baz = String; - fn bar(&self) { - // let baz = 3; - baz(); - //~^ ERROR cannot find function `baz` - bah; - //~^ ERROR cannot find value `bah` - BAR; - //~^ ERROR cannot find value `BAR` in this scope - let foo: Baz = "".to_string(); - //~^ ERROR cannot find type `Baz` in this scope - } -} - -fn ba() {} -const BARR: u32 = 3; -type Bar = String; - -fn main() {} diff --git a/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr b/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr deleted file mode 100644 index f32e0404e..000000000 --- a/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr +++ /dev/null @@ -1,109 +0,0 @@ -error[E0425]: cannot find value `config` in this scope - --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:7:16 - | -LL | Self { config } - | ^^^^^^ - | | - | a field by this name exists in `Self` - | help: a local variable with a similar name exists: `cofig` - -error[E0425]: cannot find value `config` in this scope - --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:11:20 - | -LL | println!("{config}"); - | ^^^^^^ - | | - | a field by this name exists in `Self` - | help: a local variable with a similar name exists: `cofig` - -error[E0425]: cannot find value `config` in this scope - --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:15:20 - | -LL | println!("{config}"); - | ^^^^^^ - | -help: you might have meant to use the available field - | -LL | println!("{self.config}"); - | ~~~~~~~~~~~ -help: a local variable with a similar name exists - | -LL | println!("{cofig}"); - | ~~~~~ - -error[E0425]: cannot find value `bah` in this scope - --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:33:9 - | -LL | bah; - | ^^^ -... -LL | fn ba() {} - | ------- similarly named function `ba` defined here - | -help: you might have meant to refer to the associated function - | -LL | Self::bah; - | ~~~~~~~~~ -help: a function with a similar name exists - | -LL | ba; - | ~~ - -error[E0425]: cannot find value `BAR` in this scope - --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:35:9 - | -LL | BAR; - | ^^^ -... -LL | const BARR: u32 = 3; - | -------------------- similarly named constant `BARR` defined here - | -help: you might have meant to use the associated `const` - | -LL | Self::BAR; - | ~~~~~~~~~ -help: a constant with a similar name exists - | -LL | BARR; - | ~~~~ - -error[E0412]: cannot find type `Baz` in this scope - --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:37:18 - | -LL | let foo: Baz = "".to_string(); - | ^^^ -... -LL | type Bar = String; - | ------------------ similarly named type alias `Bar` defined here - | -help: you might have meant to use the associated type - | -LL | let foo: Self::Baz = "".to_string(); - | ~~~~~~~~~ -help: a type alias with a similar name exists - | -LL | let foo: Bar = "".to_string(); - | ~~~ - -error[E0425]: cannot find function `baz` in this scope - --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:31:9 - | -LL | baz(); - | ^^^ -... -LL | fn ba() {} - | ------- similarly named function `ba` defined here - | -help: you might have meant to call the method - | -LL | self.baz(); - | ~~~~~~~~ -help: a function with a similar name exists - | -LL | ba(); - | ~~ - -error: aborting due to 7 previous errors - -Some errors have detailed explanations: E0412, E0425. -For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/ui/resolve/typo-suggestion-mistyped-in-path.rs b/src/test/ui/resolve/typo-suggestion-mistyped-in-path.rs deleted file mode 100644 index 3ce17a14f..000000000 --- a/src/test/ui/resolve/typo-suggestion-mistyped-in-path.rs +++ /dev/null @@ -1,42 +0,0 @@ -struct Struct; -//~^ NOTE function or associated item `fob` not found for this struct - -impl Struct { - fn foo() { } -} - -mod module { - fn foo() { } - - struct Struct; - - impl Struct { - fn foo() { } - } -} - -trait Trait { - fn foo(); -} - -fn main() { - Struct::fob(); - //~^ ERROR no function or associated item named `fob` found for struct `Struct` in the current scope - //~| NOTE function or associated item not found in `Struct` - - Struc::foo(); - //~^ ERROR failed to resolve: use of undeclared type `Struc` - //~| NOTE use of undeclared type `Struc` - - modul::foo(); - //~^ ERROR failed to resolve: use of undeclared crate or module `modul` - //~| NOTE use of undeclared crate or module `modul` - - module::Struc::foo(); - //~^ ERROR failed to resolve: could not find `Struc` in `module` - //~| NOTE could not find `Struc` in `module` - - Trai::foo(); - //~^ ERROR failed to resolve: use of undeclared type `Trai` - //~| NOTE use of undeclared type `Trai` -} diff --git a/src/test/ui/resolve/typo-suggestion-mistyped-in-path.stderr b/src/test/ui/resolve/typo-suggestion-mistyped-in-path.stderr deleted file mode 100644 index 89b69e140..000000000 --- a/src/test/ui/resolve/typo-suggestion-mistyped-in-path.stderr +++ /dev/null @@ -1,54 +0,0 @@ -error[E0433]: failed to resolve: could not find `Struc` in `module` - --> $DIR/typo-suggestion-mistyped-in-path.rs:35:13 - | -LL | module::Struc::foo(); - | ^^^^^ - | | - | could not find `Struc` in `module` - | help: a struct with a similar name exists: `Struct` - -error[E0599]: no function or associated item named `fob` found for struct `Struct` in the current scope - --> $DIR/typo-suggestion-mistyped-in-path.rs:23:13 - | -LL | struct Struct; - | ------------- function or associated item `fob` not found for this struct -... -LL | Struct::fob(); - | ^^^ - | | - | function or associated item not found in `Struct` - | help: there is an associated function with a similar name: `foo` - -error[E0433]: failed to resolve: use of undeclared type `Struc` - --> $DIR/typo-suggestion-mistyped-in-path.rs:27:5 - | -LL | Struc::foo(); - | ^^^^^ - | | - | use of undeclared type `Struc` - | help: a struct with a similar name exists: `Struct` - -error[E0433]: failed to resolve: use of undeclared crate or module `modul` - --> $DIR/typo-suggestion-mistyped-in-path.rs:31:5 - | -LL | modul::foo(); - | ^^^^^ use of undeclared crate or module `modul` - | -help: there is a crate or module with a similar name - | -LL | module::foo(); - | ~~~~~~ - -error[E0433]: failed to resolve: use of undeclared type `Trai` - --> $DIR/typo-suggestion-mistyped-in-path.rs:39:5 - | -LL | Trai::foo(); - | ^^^^ - | | - | use of undeclared type `Trai` - | help: a trait with a similar name exists: `Trait` - -error: aborting due to 5 previous errors - -Some errors have detailed explanations: E0433, E0599. -For more information about an error, try `rustc --explain E0433`. diff --git a/src/test/ui/resolve/typo-suggestion-named-underscore.rs b/src/test/ui/resolve/typo-suggestion-named-underscore.rs deleted file mode 100644 index a2b05db03..000000000 --- a/src/test/ui/resolve/typo-suggestion-named-underscore.rs +++ /dev/null @@ -1,14 +0,0 @@ -const _: () = (); - -fn main() { - a // Shouldn't suggest underscore - //~^ ERROR: cannot find value `a` in this scope -} - -trait Unknown {} - -#[allow(unused_imports)] -use Unknown as _; - -fn foo<T: A>(x: T) {} // Shouldn't suggest underscore -//~^ ERROR: cannot find trait `A` in this scope diff --git a/src/test/ui/resolve/typo-suggestion-named-underscore.stderr b/src/test/ui/resolve/typo-suggestion-named-underscore.stderr deleted file mode 100644 index 65d1b084a..000000000 --- a/src/test/ui/resolve/typo-suggestion-named-underscore.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0425]: cannot find value `a` in this scope - --> $DIR/typo-suggestion-named-underscore.rs:4:5 - | -LL | a // Shouldn't suggest underscore - | ^ not found in this scope - -error[E0405]: cannot find trait `A` in this scope - --> $DIR/typo-suggestion-named-underscore.rs:13:11 - | -LL | fn foo<T: A>(x: T) {} // Shouldn't suggest underscore - | ^ not found in this scope - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0405, E0425. -For more information about an error, try `rustc --explain E0405`. diff --git a/src/test/ui/resolve/unboxed-closure-sugar-nonexistent-trait.rs b/src/test/ui/resolve/unboxed-closure-sugar-nonexistent-trait.rs deleted file mode 100644 index 87f9ce097..000000000 --- a/src/test/ui/resolve/unboxed-closure-sugar-nonexistent-trait.rs +++ /dev/null @@ -1,9 +0,0 @@ -fn f<F:Nonexist(isize) -> isize>(x: F) {} -//~^ ERROR cannot find trait `Nonexist` - -type Typedef = isize; - -fn g<F:Typedef(isize) -> isize>(x: F) {} -//~^ ERROR expected trait, found type alias `Typedef` - -fn main() {} diff --git a/src/test/ui/resolve/unboxed-closure-sugar-nonexistent-trait.stderr b/src/test/ui/resolve/unboxed-closure-sugar-nonexistent-trait.stderr deleted file mode 100644 index 8addc0303..000000000 --- a/src/test/ui/resolve/unboxed-closure-sugar-nonexistent-trait.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0405]: cannot find trait `Nonexist` in this scope - --> $DIR/unboxed-closure-sugar-nonexistent-trait.rs:1:8 - | -LL | fn f<F:Nonexist(isize) -> isize>(x: F) {} - | ^^^^^^^^ not found in this scope - -error[E0404]: expected trait, found type alias `Typedef` - --> $DIR/unboxed-closure-sugar-nonexistent-trait.rs:6:8 - | -LL | fn g<F:Typedef(isize) -> isize>(x: F) {} - | ^^^^^^^^^^^^^^^^^^^^^^^ type aliases cannot be used as traits - | -help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias - | -LL | trait Typedef = isize; - | - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0404, E0405. -For more information about an error, try `rustc --explain E0404`. diff --git a/src/test/ui/resolve/unresolved_static_type_field.rs b/src/test/ui/resolve/unresolved_static_type_field.rs deleted file mode 100644 index 494ad083f..000000000 --- a/src/test/ui/resolve/unresolved_static_type_field.rs +++ /dev/null @@ -1,14 +0,0 @@ -fn f(_: bool) {} - -struct Foo { - cx: bool, -} - -impl Foo { - fn bar() { - f(cx); - //~^ ERROR cannot find value `cx` in this scope - } -} - -fn main() {} diff --git a/src/test/ui/resolve/unresolved_static_type_field.stderr b/src/test/ui/resolve/unresolved_static_type_field.stderr deleted file mode 100644 index 06926b53d..000000000 --- a/src/test/ui/resolve/unresolved_static_type_field.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0425]: cannot find value `cx` in this scope - --> $DIR/unresolved_static_type_field.rs:9:11 - | -LL | f(cx); - | ^^ a field by this name exists in `Self` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/resolve/use-self-in-inner-fn.rs b/src/test/ui/resolve/use-self-in-inner-fn.rs deleted file mode 100644 index eccb315fe..000000000 --- a/src/test/ui/resolve/use-self-in-inner-fn.rs +++ /dev/null @@ -1,14 +0,0 @@ -struct A; - -impl A { -//~^ NOTE `Self` type implicitly declared here, by this `impl` - fn banana(&mut self) { - fn peach(this: &Self) { - //~^ ERROR can't use generic parameters from outer function - //~| NOTE use of generic parameter from outer function - //~| NOTE use a type here instead - } - } -} - -fn main() {} diff --git a/src/test/ui/resolve/use-self-in-inner-fn.stderr b/src/test/ui/resolve/use-self-in-inner-fn.stderr deleted file mode 100644 index 966093499..000000000 --- a/src/test/ui/resolve/use-self-in-inner-fn.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0401]: can't use generic parameters from outer function - --> $DIR/use-self-in-inner-fn.rs:6:25 - | -LL | impl A { - | ---- `Self` type implicitly declared here, by this `impl` -... -LL | fn peach(this: &Self) { - | ^^^^ - | | - | use of generic parameter from outer function - | use a type here instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/resolve/use_suggestion.rs b/src/test/ui/resolve/use_suggestion.rs deleted file mode 100644 index 8c9bc6d76..000000000 --- a/src/test/ui/resolve/use_suggestion.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - let x1 = HashMap::new(); //~ ERROR failed to resolve - let x2 = GooMap::new(); //~ ERROR failed to resolve - - let y1: HashMap; //~ ERROR cannot find type - let y2: GooMap; //~ ERROR cannot find type -} diff --git a/src/test/ui/resolve/use_suggestion.stderr b/src/test/ui/resolve/use_suggestion.stderr deleted file mode 100644 index 54ad85383..000000000 --- a/src/test/ui/resolve/use_suggestion.stderr +++ /dev/null @@ -1,38 +0,0 @@ -error[E0433]: failed to resolve: use of undeclared type `HashMap` - --> $DIR/use_suggestion.rs:2:14 - | -LL | let x1 = HashMap::new(); - | ^^^^^^^ use of undeclared type `HashMap` - | -help: consider importing this struct - | -LL | use std::collections::HashMap; - | - -error[E0412]: cannot find type `HashMap` in this scope - --> $DIR/use_suggestion.rs:5:13 - | -LL | let y1: HashMap; - | ^^^^^^^ not found in this scope - | -help: consider importing this struct - | -LL | use std::collections::HashMap; - | - -error[E0412]: cannot find type `GooMap` in this scope - --> $DIR/use_suggestion.rs:6:13 - | -LL | let y2: GooMap; - | ^^^^^^ not found in this scope - -error[E0433]: failed to resolve: use of undeclared type `GooMap` - --> $DIR/use_suggestion.rs:3:14 - | -LL | let x2 = GooMap::new(); - | ^^^^^^ use of undeclared type `GooMap` - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0412, E0433. -For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/ui/resolve/use_suggestion_placement.fixed b/src/test/ui/resolve/use_suggestion_placement.fixed deleted file mode 100644 index d1686f7fd..000000000 --- a/src/test/ui/resolve/use_suggestion_placement.fixed +++ /dev/null @@ -1,35 +0,0 @@ -// run-rustfix -#![allow(dead_code)] - -use m::A; - -use std::collections::HashMap; - -macro_rules! y { - () => {} -} - -mod m { - pub const A: i32 = 0; -} - -mod foo { - use std::path::Path; - -#[derive(Debug)] - pub struct Foo; - - // test whether the use suggestion isn't - // placed into the expansion of `#[derive(Debug)] - type Bar = Path; //~ ERROR cannot find -} - -fn main() { - y!(); - let _ = A; //~ ERROR cannot find - foo(); -} - -fn foo() { - type Dict<K, V> = HashMap<K, V>; //~ ERROR cannot find -} diff --git a/src/test/ui/resolve/use_suggestion_placement.rs b/src/test/ui/resolve/use_suggestion_placement.rs deleted file mode 100644 index 5be91f270..000000000 --- a/src/test/ui/resolve/use_suggestion_placement.rs +++ /dev/null @@ -1,29 +0,0 @@ -// run-rustfix -#![allow(dead_code)] - -macro_rules! y { - () => {} -} - -mod m { - pub const A: i32 = 0; -} - -mod foo { - #[derive(Debug)] - pub struct Foo; - - // test whether the use suggestion isn't - // placed into the expansion of `#[derive(Debug)] - type Bar = Path; //~ ERROR cannot find -} - -fn main() { - y!(); - let _ = A; //~ ERROR cannot find - foo(); -} - -fn foo() { - type Dict<K, V> = HashMap<K, V>; //~ ERROR cannot find -} diff --git a/src/test/ui/resolve/use_suggestion_placement.stderr b/src/test/ui/resolve/use_suggestion_placement.stderr deleted file mode 100644 index 0aadd82f6..000000000 --- a/src/test/ui/resolve/use_suggestion_placement.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error[E0412]: cannot find type `Path` in this scope - --> $DIR/use_suggestion_placement.rs:18:16 - | -LL | type Bar = Path; - | ^^^^ not found in this scope - | -help: consider importing this struct - | -LL | use std::path::Path; - | - -error[E0425]: cannot find value `A` in this scope - --> $DIR/use_suggestion_placement.rs:23:13 - | -LL | let _ = A; - | ^ not found in this scope - | -help: consider importing this constant - | -LL | use m::A; - | - -error[E0412]: cannot find type `HashMap` in this scope - --> $DIR/use_suggestion_placement.rs:28:23 - | -LL | type Dict<K, V> = HashMap<K, V>; - | ^^^^^^^ not found in this scope - | -help: consider importing this struct - | -LL | use std::collections::HashMap; - | - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0412, E0425. -For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/ui/resolve/visibility-indeterminate.rs b/src/test/ui/resolve/visibility-indeterminate.rs deleted file mode 100644 index 0e1142db3..000000000 --- a/src/test/ui/resolve/visibility-indeterminate.rs +++ /dev/null @@ -1,7 +0,0 @@ -// edition:2018 - -foo!(); //~ ERROR cannot find macro `foo` in this scope - -pub(in ::bar) struct Baz {} //~ ERROR cannot determine resolution for the visibility - -fn main() {} diff --git a/src/test/ui/resolve/visibility-indeterminate.stderr b/src/test/ui/resolve/visibility-indeterminate.stderr deleted file mode 100644 index 84d82ce85..000000000 --- a/src/test/ui/resolve/visibility-indeterminate.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0578]: cannot determine resolution for the visibility - --> $DIR/visibility-indeterminate.rs:5:8 - | -LL | pub(in ::bar) struct Baz {} - | ^^^^^ - -error: cannot find macro `foo` in this scope - --> $DIR/visibility-indeterminate.rs:3:1 - | -LL | foo!(); - | ^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0578`. |