diff options
Diffstat (limited to 'tests/ui/resolve')
-rw-r--r-- | tests/ui/resolve/issue-108529.rs | 8 | ||||
-rw-r--r-- | tests/ui/resolve/issue-108529.stderr | 9 | ||||
-rw-r--r-- | tests/ui/resolve/name-clash-nullary.stderr | 2 | ||||
-rw-r--r-- | tests/ui/resolve/privacy-enum-ctor.stderr | 6 | ||||
-rw-r--r-- | tests/ui/resolve/resolve-inconsistent-names.stderr | 2 | ||||
-rw-r--r-- | tests/ui/resolve/resolve-primitive-fallback.stderr | 9 | ||||
-rw-r--r-- | tests/ui/resolve/token-error-correct-2.rs | 1 | ||||
-rw-r--r-- | tests/ui/resolve/token-error-correct-2.stderr | 10 | ||||
-rw-r--r-- | tests/ui/resolve/token-error-correct-3.rs | 5 | ||||
-rw-r--r-- | tests/ui/resolve/token-error-correct-3.stderr | 26 | ||||
-rw-r--r-- | tests/ui/resolve/token-error-correct-4.fixed | 10 | ||||
-rw-r--r-- | tests/ui/resolve/token-error-correct-4.rs | 5 | ||||
-rw-r--r-- | tests/ui/resolve/token-error-correct-4.stderr | 18 | ||||
-rw-r--r-- | tests/ui/resolve/token-error-correct.rs | 1 | ||||
-rw-r--r-- | tests/ui/resolve/token-error-correct.stderr | 10 |
15 files changed, 45 insertions, 77 deletions
diff --git a/tests/ui/resolve/issue-108529.rs b/tests/ui/resolve/issue-108529.rs new file mode 100644 index 000000000..8e3aafab6 --- /dev/null +++ b/tests/ui/resolve/issue-108529.rs @@ -0,0 +1,8 @@ +#![allow(nonstandard_style)] +use f::f::f; //~ ERROR + +trait f { + extern "C" fn f(); +} + +fn main() {} diff --git a/tests/ui/resolve/issue-108529.stderr b/tests/ui/resolve/issue-108529.stderr new file mode 100644 index 000000000..cf4e4759c --- /dev/null +++ b/tests/ui/resolve/issue-108529.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import `f::f` + --> $DIR/issue-108529.rs:2:8 + | +LL | use f::f::f; + | ^ expected type, found associated function `f` in `f` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/tests/ui/resolve/name-clash-nullary.stderr b/tests/ui/resolve/name-clash-nullary.stderr index 76c4b5914..fffd3027a 100644 --- a/tests/ui/resolve/name-clash-nullary.stderr +++ b/tests/ui/resolve/name-clash-nullary.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let None: isize = 42; | ^^^^ ----- expected due to this | | - | expected `isize`, found enum `Option` + | expected `isize`, found `Option<_>` | = note: expected type `isize` found enum `Option<_>` diff --git a/tests/ui/resolve/privacy-enum-ctor.stderr b/tests/ui/resolve/privacy-enum-ctor.stderr index a24fe4d23..3c051429f 100644 --- a/tests/ui/resolve/privacy-enum-ctor.stderr +++ b/tests/ui/resolve/privacy-enum-ctor.stderr @@ -267,7 +267,7 @@ LL | Fn(u8), | -- `Fn` defines an enum variant constructor here, which should be called ... LL | let _: Z = Z::Fn; - | - ^^^^^ expected enum `Z`, found enum constructor + | - ^^^^^ expected `Z`, found enum constructor | | | expected due to this | @@ -308,7 +308,7 @@ LL | Fn(u8), | -- `Fn` defines an enum variant constructor here, which should be called ... LL | let _: E = m::E::Fn; - | - ^^^^^^^^ expected enum `E`, found enum constructor + | - ^^^^^^^^ expected `E`, found enum constructor | | | expected due to this | @@ -349,7 +349,7 @@ LL | Fn(u8), | -- `Fn` defines an enum variant constructor here, which should be called ... LL | let _: E = E::Fn; - | - ^^^^^ expected enum `E`, found enum constructor + | - ^^^^^ expected `E`, found enum constructor | | | expected due to this | diff --git a/tests/ui/resolve/resolve-inconsistent-names.stderr b/tests/ui/resolve/resolve-inconsistent-names.stderr index 773c9f6cd..023db303d 100644 --- a/tests/ui/resolve/resolve-inconsistent-names.stderr +++ b/tests/ui/resolve/resolve-inconsistent-names.stderr @@ -87,7 +87,7 @@ error[E0308]: mismatched types LL | match x { | - this expression has type `(E, E)` LL | (A, B) | (ref B, c) | (c, A) => () - | - ^^^^^ expected enum `E`, found `&E` + | - ^^^^^ expected `E`, found `&E` | | | first introduced with type `E` here | diff --git a/tests/ui/resolve/resolve-primitive-fallback.stderr b/tests/ui/resolve/resolve-primitive-fallback.stderr index 964302e92..f803f9da2 100644 --- a/tests/ui/resolve/resolve-primitive-fallback.stderr +++ b/tests/ui/resolve/resolve-primitive-fallback.stderr @@ -24,14 +24,13 @@ 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 + | ^^^^^^^^^^^^^^^^^ --- + | | + | unexpected argument + | help: remove the extra argument | note: function defined here --> $SRC_DIR/core/src/mem/mod.rs:LL:COL -help: remove the extra argument - | -LL | std::mem::size_of(); - | ~~ error: aborting due to 3 previous errors diff --git a/tests/ui/resolve/token-error-correct-2.rs b/tests/ui/resolve/token-error-correct-2.rs index f7c7d908c..a38755dae 100644 --- a/tests/ui/resolve/token-error-correct-2.rs +++ b/tests/ui/resolve/token-error-correct-2.rs @@ -2,6 +2,5 @@ fn main() { if foo { - //~^ ERROR: cannot find value `foo` ) //~ ERROR: mismatched closing delimiter: `)` } diff --git a/tests/ui/resolve/token-error-correct-2.stderr b/tests/ui/resolve/token-error-correct-2.stderr index cca9f2dc8..be5fb18a5 100644 --- a/tests/ui/resolve/token-error-correct-2.stderr +++ b/tests/ui/resolve/token-error-correct-2.stderr @@ -3,16 +3,8 @@ error: mismatched closing delimiter: `)` | 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 +error: aborting due to previous error -For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/resolve/token-error-correct-3.rs b/tests/ui/resolve/token-error-correct-3.rs index 52934085f..2793f1b90 100644 --- a/tests/ui/resolve/token-error-correct-3.rs +++ b/tests/ui/resolve/token-error-correct-3.rs @@ -9,12 +9,9 @@ pub mod raw { 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 `)` + } else { //~ ERROR mismatched closing delimiter Ok(false); } diff --git a/tests/ui/resolve/token-error-correct-3.stderr b/tests/ui/resolve/token-error-correct-3.stderr index 77c87c784..79d1d4883 100644 --- a/tests/ui/resolve/token-error-correct-3.stderr +++ b/tests/ui/resolve/token-error-correct-3.stderr @@ -1,25 +1,13 @@ -error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;` - --> $DIR/token-error-correct-3.rs:13:21 +error: mismatched closing delimiter: `}` + --> $DIR/token-error-correct-3.rs:12:21 | +LL | if !is_directory(path.as_ref()) { + | - closing delimiter possibly meant for this 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 - | + | ^ unclosed delimiter 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 + | ^ mismatched closing delimiter -error: aborting due to 3 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/resolve/token-error-correct-4.fixed b/tests/ui/resolve/token-error-correct-4.fixed deleted file mode 100644 index 064b9e74e..000000000 --- a/tests/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/tests/ui/resolve/token-error-correct-4.rs b/tests/ui/resolve/token-error-correct-4.rs index 5e31d71e7..49fad4bd9 100644 --- a/tests/ui/resolve/token-error-correct-4.rs +++ b/tests/ui/resolve/token-error-correct-4.rs @@ -1,4 +1,3 @@ -// run-rustfix // Test that we do some basic error correction in the tokeniser and apply suggestions. fn setsuna(_: ()) {} @@ -6,5 +5,5 @@ fn setsuna(_: ()) {} fn kazusa() {} fn main() { - setsuna(kazusa(); //~ ERROR: expected one of -} //~ ERROR: expected expression + setsuna(kazusa(); +} //~ ERROR mismatched closing delimiter diff --git a/tests/ui/resolve/token-error-correct-4.stderr b/tests/ui/resolve/token-error-correct-4.stderr index 81e5a1336..3ec97171f 100644 --- a/tests/ui/resolve/token-error-correct-4.stderr +++ b/tests/ui/resolve/token-error-correct-4.stderr @@ -1,16 +1,12 @@ -error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;` - --> $DIR/token-error-correct-4.rs:9:12 +error: mismatched closing delimiter: `}` + --> $DIR/token-error-correct-4.rs:8:12 | +LL | fn main() { + | - closing delimiter possibly meant for this LL | setsuna(kazusa(); - | ^ ^ help: `)` may belong here - | | - | unclosed delimiter - -error: expected expression, found `)` - --> $DIR/token-error-correct-4.rs:10:1 - | + | ^ unclosed delimiter LL | } - | ^ expected expression + | ^ mismatched closing delimiter -error: aborting due to 2 previous errors +error: aborting due to previous error diff --git a/tests/ui/resolve/token-error-correct.rs b/tests/ui/resolve/token-error-correct.rs index 4f74df0bf..84ee90e36 100644 --- a/tests/ui/resolve/token-error-correct.rs +++ b/tests/ui/resolve/token-error-correct.rs @@ -2,7 +2,6 @@ fn main() { foo(bar(; - //~^ ERROR cannot find function `bar` in this scope } //~^ ERROR: mismatched closing delimiter: `}` diff --git a/tests/ui/resolve/token-error-correct.stderr b/tests/ui/resolve/token-error-correct.stderr index ca0c4c18a..35b2d0b32 100644 --- a/tests/ui/resolve/token-error-correct.stderr +++ b/tests/ui/resolve/token-error-correct.stderr @@ -5,16 +5,8 @@ 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 +error: aborting due to previous error -For more information about this error, try `rustc --explain E0425`. |