diff options
Diffstat (limited to 'tests/ui/error-codes')
| -rw-r--r-- | tests/ui/error-codes/E0027.stderr | 60 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0034.stderr | 10 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0040.stderr | 5 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0054.stderr | 5 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0057.stderr | 5 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0060.stderr | 5 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0061.stderr | 10 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0121.stderr | 5 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0214.stderr | 5 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0221.stderr | 15 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0259.stderr | 3 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0260.stderr | 3 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0283.stderr | 5 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0423.stderr | 10 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0435.stderr | 5 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0516.stderr | 5 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0637.stderr | 5 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0642.stderr | 15 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0746.stderr | 10 | ||||
| -rw-r--r-- | tests/ui/error-codes/ex-E0612.stderr | 5 |
20 files changed, 115 insertions, 76 deletions
diff --git a/tests/ui/error-codes/E0027.stderr b/tests/ui/error-codes/E0027.stderr index 7bbafcf0a27..701e636dc58 100644 --- a/tests/ui/error-codes/E0027.stderr +++ b/tests/ui/error-codes/E0027.stderr @@ -6,16 +6,19 @@ LL | Dog { age: x } => {} | help: include the missing field in the pattern | -LL | Dog { age: x, name } => {} - | ~~~~~~~~ +LL - Dog { age: x } => {} +LL + Dog { age: x, name } => {} + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | Dog { age: x, name: _ } => {} - | ~~~~~~~~~~~ +LL - Dog { age: x } => {} +LL + Dog { age: x, name: _ } => {} + | help: or always ignore missing fields here | -LL | Dog { age: x, .. } => {} - | ~~~~~~ +LL - Dog { age: x } => {} +LL + Dog { age: x, .. } => {} + | error[E0027]: pattern does not mention field `age` --> $DIR/E0027.rs:15:9 @@ -25,16 +28,19 @@ LL | Dog { name: x, } => {} | help: include the missing field in the pattern | -LL | Dog { name: x, age } => {} - | ~~~~~~~ +LL - Dog { name: x, } => {} +LL + Dog { name: x, age } => {} + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | Dog { name: x, age: _ } => {} - | ~~~~~~~~~~ +LL - Dog { name: x, } => {} +LL + Dog { name: x, age: _ } => {} + | help: or always ignore missing fields here | -LL | Dog { name: x, .. } => {} - | ~~~~~~ +LL - Dog { name: x, } => {} +LL + Dog { name: x, .. } => {} + | error[E0027]: pattern does not mention field `age` --> $DIR/E0027.rs:19:9 @@ -44,16 +50,19 @@ LL | Dog { name: x , } => {} | help: include the missing field in the pattern | -LL | Dog { name: x, age } => {} - | ~~~~~~~ +LL - Dog { name: x , } => {} +LL + Dog { name: x, age } => {} + | help: if you don't care about this missing field, you can explicitly ignore it | -LL | Dog { name: x, age: _ } => {} - | ~~~~~~~~~~ +LL - Dog { name: x , } => {} +LL + Dog { name: x, age: _ } => {} + | help: or always ignore missing fields here | -LL | Dog { name: x, .. } => {} - | ~~~~~~ +LL - Dog { name: x , } => {} +LL + Dog { name: x, .. } => {} + | error[E0027]: pattern does not mention fields `name`, `age` --> $DIR/E0027.rs:22:9 @@ -63,16 +72,19 @@ LL | Dog {} => {} | help: include the missing fields in the pattern | -LL | Dog { name, age } => {} - | ~~~~~~~~~~~~~ +LL - Dog {} => {} +LL + Dog { name, age } => {} + | help: if you don't care about these missing fields, you can explicitly ignore them | -LL | Dog { name: _, age: _ } => {} - | ~~~~~~~~~~~~~~~~~~~ +LL - Dog {} => {} +LL + Dog { name: _, age: _ } => {} + | help: or always ignore missing fields here | -LL | Dog { .. } => {} - | ~~~~~~ +LL - Dog {} => {} +LL + Dog { .. } => {} + | error: aborting due to 4 previous errors diff --git a/tests/ui/error-codes/E0034.stderr b/tests/ui/error-codes/E0034.stderr index 48b8efcf8a2..434518741fc 100644 --- a/tests/ui/error-codes/E0034.stderr +++ b/tests/ui/error-codes/E0034.stderr @@ -16,10 +16,12 @@ LL | fn foo() {} | ^^^^^^^^ help: use fully-qualified syntax to disambiguate | -LL | <Test as Trait1>::foo() - | ~~~~~~~~~~~~~~~~~~ -LL | <Test as Trait2>::foo() - | ~~~~~~~~~~~~~~~~~~ +LL - Test::foo() +LL + <Test as Trait1>::foo() + | +LL - Test::foo() +LL + <Test as Trait2>::foo() + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0040.stderr b/tests/ui/error-codes/E0040.stderr index 00cccb07c0f..674c2b70b03 100644 --- a/tests/ui/error-codes/E0040.stderr +++ b/tests/ui/error-codes/E0040.stderr @@ -6,8 +6,9 @@ LL | x.drop(); | help: consider using `drop` function | -LL | drop(x); - | +++++ ~ +LL - x.drop(); +LL + drop(x); + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0054.stderr b/tests/ui/error-codes/E0054.stderr index be35242ad72..a2e618d9b06 100644 --- a/tests/ui/error-codes/E0054.stderr +++ b/tests/ui/error-codes/E0054.stderr @@ -6,8 +6,9 @@ LL | let x_is_nonzero = x as bool; | help: compare with zero instead | -LL | let x_is_nonzero = x != 0; - | ~~~~ +LL - let x_is_nonzero = x as bool; +LL + let x_is_nonzero = x != 0; + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0057.stderr b/tests/ui/error-codes/E0057.stderr index ef6e2908b93..35bd842b2cf 100644 --- a/tests/ui/error-codes/E0057.stderr +++ b/tests/ui/error-codes/E0057.stderr @@ -11,8 +11,9 @@ LL | let f = |x| x * 3; | ^^^ help: provide the argument | -LL | let a = f(/* x */); - | ~~~~~~~~~ +LL - let a = f(); +LL + let a = f(/* x */); + | error[E0057]: this function takes 1 argument but 2 arguments were supplied --> $DIR/E0057.rs:5:13 diff --git a/tests/ui/error-codes/E0060.stderr b/tests/ui/error-codes/E0060.stderr index aadf1ea93cb..fc52c6fc5ea 100644 --- a/tests/ui/error-codes/E0060.stderr +++ b/tests/ui/error-codes/E0060.stderr @@ -11,8 +11,9 @@ LL | fn printf(_: *const u8, ...) -> u32; | ^^^^^^ - help: provide the argument | -LL | unsafe { printf(/* *const u8 */); } - | ~~~~~~~~~~~~~~~~~ +LL - unsafe { printf(); } +LL + unsafe { printf(/* *const u8 */); } + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0061.stderr b/tests/ui/error-codes/E0061.stderr index 4a420cd118a..b70d607ebeb 100644 --- a/tests/ui/error-codes/E0061.stderr +++ b/tests/ui/error-codes/E0061.stderr @@ -11,8 +11,9 @@ LL | fn f(a: u16, b: &str) {} | ^ ------- help: provide the argument | -LL | f(0, /* &str */); - | ~~~~~~~~~~~~~~~ +LL - f(0); +LL + f(0, /* &str */); + | error[E0061]: this function takes 1 argument but 0 arguments were supplied --> $DIR/E0061.rs:9:5 @@ -27,8 +28,9 @@ LL | fn f2(a: u16) {} | ^^ ------ help: provide the argument | -LL | f2(/* u16 */); - | ~~~~~~~~~~~ +LL - f2(); +LL + f2(/* u16 */); + | error: aborting due to 2 previous errors diff --git a/tests/ui/error-codes/E0121.stderr b/tests/ui/error-codes/E0121.stderr index 5f5df0fd0ae..b169373f643 100644 --- a/tests/ui/error-codes/E0121.stderr +++ b/tests/ui/error-codes/E0121.stderr @@ -15,8 +15,9 @@ LL | static BAR: _ = "test"; | help: replace this with a fully-specified type | -LL | static BAR: &str = "test"; - | ~~~~ +LL - static BAR: _ = "test"; +LL + static BAR: &str = "test"; + | error: aborting due to 2 previous errors diff --git a/tests/ui/error-codes/E0214.stderr b/tests/ui/error-codes/E0214.stderr index 76b11f30996..71ae62d64e3 100644 --- a/tests/ui/error-codes/E0214.stderr +++ b/tests/ui/error-codes/E0214.stderr @@ -6,8 +6,9 @@ LL | let v: Vec(&str) = vec!["foo"]; | help: use angle brackets instead | -LL | let v: Vec<&str> = vec!["foo"]; - | ~ ~ +LL - let v: Vec(&str) = vec!["foo"]; +LL + let v: Vec<&str> = vec!["foo"]; + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0221.stderr b/tests/ui/error-codes/E0221.stderr index 07e7485b67e..a18e91806d7 100644 --- a/tests/ui/error-codes/E0221.stderr +++ b/tests/ui/error-codes/E0221.stderr @@ -12,12 +12,14 @@ LL | let _: Self::A; | help: use fully-qualified syntax to disambiguate | -LL | let _: <Self as Foo>::A; - | ~~~~~~~~~~~~~~~ +LL - let _: Self::A; +LL + let _: <Self as Foo>::A; + | help: use fully-qualified syntax to disambiguate | -LL | let _: <Self as Bar>::A; - | ~~~~~~~~~~~~~~~ +LL - let _: Self::A; +LL + let _: <Self as Bar>::A; + | error[E0221]: ambiguous associated type `Err` in bounds of `Self` --> $DIR/E0221.rs:21:16 @@ -31,8 +33,9 @@ LL | let _: Self::Err; = note: associated type `Err` could derive from `FromStr` help: use fully-qualified syntax to disambiguate | -LL | let _: <Self as My>::Err; - | ~~~~~~~~~~~~~~ +LL - let _: Self::Err; +LL + let _: <Self as My>::Err; + | error: aborting due to 2 previous errors diff --git a/tests/ui/error-codes/E0259.stderr b/tests/ui/error-codes/E0259.stderr index 975d1a161a0..08d3deb68d2 100644 --- a/tests/ui/error-codes/E0259.stderr +++ b/tests/ui/error-codes/E0259.stderr @@ -10,7 +10,8 @@ LL | extern crate test as alloc; = note: `alloc` 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 test as other_alloc; +LL - extern crate test as alloc; +LL + extern crate test as other_alloc; | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0260.stderr b/tests/ui/error-codes/E0260.stderr index 35698c65359..cb47b77904a 100644 --- a/tests/ui/error-codes/E0260.stderr +++ b/tests/ui/error-codes/E0260.stderr @@ -10,7 +10,8 @@ LL | mod alloc { = note: `alloc` 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 alloc as other_alloc; +LL - extern crate alloc; +LL + extern crate alloc as other_alloc; | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0283.stderr b/tests/ui/error-codes/E0283.stderr index 381eca5f2a4..29baae5f133 100644 --- a/tests/ui/error-codes/E0283.stderr +++ b/tests/ui/error-codes/E0283.stderr @@ -30,8 +30,9 @@ LL | impl Into<u32> for Impl { where U: From<T>; help: try using a fully qualified path to specify the expected types | -LL | let bar = <Impl as Into<T>>::into(foo_impl) * 1u32; - | ++++++++++++++++++++++++ ~ +LL - let bar = foo_impl.into() * 1u32; +LL + let bar = <Impl as Into<T>>::into(foo_impl) * 1u32; + | error: aborting due to 2 previous errors diff --git a/tests/ui/error-codes/E0423.stderr b/tests/ui/error-codes/E0423.stderr index dd7a5b034c5..e50b8bd820c 100644 --- a/tests/ui/error-codes/E0423.stderr +++ b/tests/ui/error-codes/E0423.stderr @@ -51,12 +51,14 @@ LL | fn foo() { | help: use struct literal syntax instead | -LL | let f = Foo { a: val }; - | ~~~~~~~~~~~~~~ +LL - let f = Foo(); +LL + let f = Foo { a: val }; + | help: a function with a similar name exists (notice the capitalization difference) | -LL | let f = foo(); - | ~~~ +LL - let f = Foo(); +LL + let f = foo(); + | error: aborting due to 5 previous errors diff --git a/tests/ui/error-codes/E0435.stderr b/tests/ui/error-codes/E0435.stderr index 1ebb9976394..13187472e60 100644 --- a/tests/ui/error-codes/E0435.stderr +++ b/tests/ui/error-codes/E0435.stderr @@ -6,8 +6,9 @@ LL | let _: [u8; foo]; | help: consider using `const` instead of `let` | -LL | const foo: usize = 42; - | ~~~~~ +LL - let foo: usize = 42; +LL + const foo: usize = 42; + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0516.stderr b/tests/ui/error-codes/E0516.stderr index 62e70a4668d..f4127678d5b 100644 --- a/tests/ui/error-codes/E0516.stderr +++ b/tests/ui/error-codes/E0516.stderr @@ -6,8 +6,9 @@ LL | let x: typeof(92) = 92; | help: consider replacing `typeof(...)` with an actual type | -LL | let x: i32 = 92; - | ~~~ +LL - let x: typeof(92) = 92; +LL + let x: i32 = 92; + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0637.stderr b/tests/ui/error-codes/E0637.stderr index d9db89ddb0c..95a5a58ab85 100644 --- a/tests/ui/error-codes/E0637.stderr +++ b/tests/ui/error-codes/E0637.stderr @@ -13,8 +13,9 @@ LL | fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str { = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `str1` or `str2` help: consider introducing a named lifetime parameter | -LL | fn underscore_lifetime<'a, '_>(str1: &'a str, str2: &'a str) -> &'a str { - | +++ ~~ ~~ ~~ +LL - fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str { +LL + fn underscore_lifetime<'a, '_>(str1: &'a str, str2: &'a str) -> &'a str { + | error[E0637]: `&` without an explicit lifetime name cannot be used here --> $DIR/E0637.rs:13:13 diff --git a/tests/ui/error-codes/E0642.stderr b/tests/ui/error-codes/E0642.stderr index dd9e28ad492..97309e95b6b 100644 --- a/tests/ui/error-codes/E0642.stderr +++ b/tests/ui/error-codes/E0642.stderr @@ -6,8 +6,9 @@ LL | fn foo((x, y): (i32, i32)); | help: give this argument a name or use an underscore to ignore it | -LL | fn foo(_: (i32, i32)); - | ~ +LL - fn foo((x, y): (i32, i32)); +LL + fn foo(_: (i32, i32)); + | error[E0642]: patterns aren't allowed in methods without bodies --> $DIR/E0642.rs:11:12 @@ -17,8 +18,9 @@ LL | fn bar((x, y): (i32, i32)) {} | help: give this argument a name or use an underscore to ignore it | -LL | fn bar(_: (i32, i32)) {} - | ~ +LL - fn bar((x, y): (i32, i32)) {} +LL + fn bar(_: (i32, i32)) {} + | error[E0642]: patterns aren't allowed in methods without bodies --> $DIR/E0642.rs:13:15 @@ -28,8 +30,9 @@ LL | fn method(S { .. }: S) {} | help: give this argument a name or use an underscore to ignore it | -LL | fn method(_: S) {} - | ~ +LL - fn method(S { .. }: S) {} +LL + fn method(_: S) {} + | error: aborting due to 3 previous errors diff --git a/tests/ui/error-codes/E0746.stderr b/tests/ui/error-codes/E0746.stderr index ec785561415..07d6b285f76 100644 --- a/tests/ui/error-codes/E0746.stderr +++ b/tests/ui/error-codes/E0746.stderr @@ -6,8 +6,9 @@ LL | fn foo() -> dyn Trait { Struct } | help: consider returning an `impl Trait` instead of a `dyn Trait` | -LL | fn foo() -> impl Trait { Struct } - | ~~~~ +LL - fn foo() -> dyn Trait { Struct } +LL + fn foo() -> impl Trait { Struct } + | help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL | fn foo() -> Box<dyn Trait> { Box::new(Struct) } @@ -21,8 +22,9 @@ LL | fn bar() -> dyn Trait { | help: consider returning an `impl Trait` instead of a `dyn Trait` | -LL | fn bar() -> impl Trait { - | ~~~~ +LL - fn bar() -> dyn Trait { +LL + fn bar() -> impl Trait { + | help: alternatively, box the return type, and wrap all of the returned values in `Box::new` | LL ~ fn bar() -> Box<dyn Trait> { diff --git a/tests/ui/error-codes/ex-E0612.stderr b/tests/ui/error-codes/ex-E0612.stderr index 23c1697b9b2..54451d3d452 100644 --- a/tests/ui/error-codes/ex-E0612.stderr +++ b/tests/ui/error-codes/ex-E0612.stderr @@ -6,8 +6,9 @@ LL | y.1; | help: a field with a similar name exists | -LL | y.0; - | ~ +LL - y.1; +LL + y.0; + | error: aborting due to 1 previous error |
