summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:19 +0000
commita0b8f38ab54ac451646aa00cd5e91b6c76f22a84 (patch)
treefc451898ccaf445814e26b46664d78702178101d /tests/ui/suggestions
parentAdding debian version 1.71.1+dfsg1-2. (diff)
downloadrustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.tar.xz
rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/suggestions')
-rw-r--r--tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr2
-rw-r--r--tests/ui/suggestions/as-ref.rs2
-rw-r--r--tests/ui/suggestions/as-ref.stderr32
-rw-r--r--tests/ui/suggestions/crate-or-module-typo.stderr5
-rw-r--r--tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr12
-rw-r--r--tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr2
-rw-r--r--tests/ui/suggestions/into-str.stderr8
-rw-r--r--tests/ui/suggestions/issue-102972.rs16
-rw-r--r--tests/ui/suggestions/issue-102972.stderr33
-rw-r--r--tests/ui/suggestions/issue-103646.rs11
-rw-r--r--tests/ui/suggestions/issue-103646.stderr21
-rw-r--r--tests/ui/suggestions/issue-109991.rs27
-rw-r--r--tests/ui/suggestions/issue-109991.stderr72
-rw-r--r--tests/ui/suggestions/issue-112590-suggest-import.rs10
-rw-r--r--tests/ui/suggestions/issue-112590-suggest-import.stderr36
-rw-r--r--tests/ui/suggestions/issue-71394-no-from-impl.stderr6
-rw-r--r--tests/ui/suggestions/issue-88696.rs14
-rw-r--r--tests/ui/suggestions/issue-88696.stderr11
-rw-r--r--tests/ui/suggestions/issue-89640.rs3
-rw-r--r--tests/ui/suggestions/issue-89640.stderr13
-rw-r--r--tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr6
-rw-r--r--tests/ui/suggestions/suggest-split-at-mut.stderr1
-rw-r--r--tests/ui/suggestions/while-let-typo.rs2
-rw-r--r--tests/ui/suggestions/while-let-typo.stderr13
24 files changed, 331 insertions, 27 deletions
diff --git a/tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr b/tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr
index b77c8c7fd..d136f5ff6 100644
--- a/tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr
+++ b/tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr
@@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
--> $DIR/adt-param-with-implicit-sized-bound.rs:25:9
|
LL | struct Struct5<T: ?Sized>{
- | - this type parameter needs to be `std::marker::Sized`
+ | - this type parameter needs to be `Sized`
LL | _t: X<T>,
| ^^^^ doesn't have a size known at compile-time
|
diff --git a/tests/ui/suggestions/as-ref.rs b/tests/ui/suggestions/as-ref.rs
index a05353441..0d9790ac2 100644
--- a/tests/ui/suggestions/as-ref.rs
+++ b/tests/ui/suggestions/as-ref.rs
@@ -24,4 +24,6 @@ fn main() {
let multiple_ref_result = &&Ok(Foo);
multiple_ref_result.map(|arg| takes_ref(arg)); //~ ERROR mismatched types [E0308]
multiple_ref_result.and_then(|arg| Ok(takes_ref(arg))); //~ ERROR mismatched types [E0308]
+
+ let _: Result<&usize, _> = &Ok(42); //~ ERROR mismatched types [E0308]
}
diff --git a/tests/ui/suggestions/as-ref.stderr b/tests/ui/suggestions/as-ref.stderr
index 2147d2d92..c5b2bb126 100644
--- a/tests/ui/suggestions/as-ref.stderr
+++ b/tests/ui/suggestions/as-ref.stderr
@@ -74,14 +74,16 @@ error[E0308]: mismatched types
--> $DIR/as-ref.rs:13:29
|
LL | let y: Option<&usize> = x;
- | -------------- ^
- | | |
- | | expected `Option<&usize>`, found `&Option<usize>`
- | | help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`: `x.as_ref()`
+ | -------------- ^ expected `Option<&usize>`, found `&Option<usize>`
+ | |
| expected due to this
|
= note: expected enum `Option<&usize>`
found reference `&Option<usize>`
+help: try using `.as_ref()` to convert `&Option<usize>` to `Option<&usize>`
+ |
+LL | let y: Option<&usize> = x.as_ref();
+ | +++++++++
error[E0308]: mismatched types
--> $DIR/as-ref.rs:15:37
@@ -93,10 +95,10 @@ LL | let y: Result<&usize, &usize> = x;
|
= note: expected enum `Result<&usize, &usize>`
found reference `&Result<usize, usize>`
-help: you can convert from `&Result<T, E>` to `Result<&T, &E>` using `.as_ref()`
+help: try using `.as_ref()` to convert `&Result<usize, usize>` to `Result<&usize, &usize>`
|
LL | let y: Result<&usize, &usize> = x.as_ref();
- | ~~~~~~~~~~
+ | +++++++++
error[E0308]: mismatched types
--> $DIR/as-ref.rs:19:36
@@ -181,6 +183,22 @@ help: consider using `as_ref` instead
LL | multiple_ref_result.as_ref().and_then(|arg| Ok(takes_ref(arg)));
| +++++++++
-error: aborting due to 11 previous errors
+error[E0308]: mismatched types
+ --> $DIR/as-ref.rs:28:32
+ |
+LL | let _: Result<&usize, _> = &Ok(42);
+ | ----------------- ^^^^^^^ expected `Result<&usize, _>`, found `&Result<{integer}, _>`
+ | |
+ | expected due to this
+ |
+ = note: expected enum `Result<&usize, _>`
+ found reference `&Result<{integer}, _>`
+help: try using `.as_ref()` to convert `&Result<{integer}, _>` to `Result<&usize, _>`
+ |
+LL - let _: Result<&usize, _> = &Ok(42);
+LL + let _: Result<&usize, _> = Ok(42).as_ref();
+ |
+
+error: aborting due to 12 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/suggestions/crate-or-module-typo.stderr b/tests/ui/suggestions/crate-or-module-typo.stderr
index 98b88b4fb..5e7a7685a 100644
--- a/tests/ui/suggestions/crate-or-module-typo.stderr
+++ b/tests/ui/suggestions/crate-or-module-typo.stderr
@@ -36,6 +36,11 @@ error[E0433]: failed to resolve: use of undeclared crate or module `bar`
|
LL | pub fn bar() { bar::baz(); }
| ^^^ use of undeclared crate or module `bar`
+ |
+help: consider importing this module
+ |
+LL + use crate::bar;
+ |
error: aborting due to 4 previous errors
diff --git a/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr b/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr
index bc6342004..319d86600 100644
--- a/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr
+++ b/tests/ui/suggestions/dont-suggest-try_into-in-macros.stderr
@@ -1,13 +1,13 @@
error[E0308]: mismatched types
- --> $DIR/dont-suggest-try_into-in-macros.rs:2:5
+ --> $DIR/dont-suggest-try_into-in-macros.rs:2:23
|
LL | assert_eq!(10u64, 10usize);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | expected `u64`, found `usize`
- | expected because this is `u64`
+ | ^^^^^^^ expected `u64`, found `usize`
|
- = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: change the type of the numeric literal from `usize` to `u64`
+ |
+LL | assert_eq!(10u64, 10u64);
+ | ~~~
error: aborting due to previous error
diff --git a/tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr b/tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr
index e74c2c421..6465eeb8b 100644
--- a/tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr
+++ b/tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr
@@ -16,8 +16,8 @@ LL | fn bar() -> impl Bar {
| ^^^^^^^^ the trait `Bar` is not implemented for `()`
|
= help: the following other types implement trait `Bar`:
- Qux
i32
+ Qux
error: aborting due to 2 previous errors
diff --git a/tests/ui/suggestions/into-str.stderr b/tests/ui/suggestions/into-str.stderr
index a56a2a188..7e24150e7 100644
--- a/tests/ui/suggestions/into-str.stderr
+++ b/tests/ui/suggestions/into-str.stderr
@@ -8,12 +8,12 @@ LL | foo(String::new());
|
= note: to coerce a `String` into a `&str`, use `&*` as a prefix
= help: the following other types implement trait `From<T>`:
- <String as From<&String>>
- <String as From<&mut str>>
- <String as From<&str>>
+ <String as From<char>>
<String as From<Box<str>>>
<String as From<Cow<'a, str>>>
- <String as From<char>>
+ <String as From<&str>>
+ <String as From<&mut str>>
+ <String as From<&String>>
= note: required for `String` to implement `Into<&str>`
note: required by a bound in `foo`
--> $DIR/into-str.rs:1:31
diff --git a/tests/ui/suggestions/issue-102972.rs b/tests/ui/suggestions/issue-102972.rs
new file mode 100644
index 000000000..106288b05
--- /dev/null
+++ b/tests/ui/suggestions/issue-102972.rs
@@ -0,0 +1,16 @@
+fn test1() {
+ let mut chars = "Hello".chars();
+ for _c in chars.by_ref() {
+ chars.next(); //~ ERROR cannot borrow `chars` as mutable more than once at a time
+ }
+}
+
+fn test2() {
+ let v = vec![1, 2, 3];
+ let mut iter = v.iter();
+ for _i in iter {
+ iter.next(); //~ ERROR borrow of moved value: `iter`
+ }
+}
+
+fn main() { }
diff --git a/tests/ui/suggestions/issue-102972.stderr b/tests/ui/suggestions/issue-102972.stderr
new file mode 100644
index 000000000..03f9dbb6c
--- /dev/null
+++ b/tests/ui/suggestions/issue-102972.stderr
@@ -0,0 +1,33 @@
+error[E0499]: cannot borrow `chars` as mutable more than once at a time
+ --> $DIR/issue-102972.rs:4:9
+ |
+LL | for _c in chars.by_ref() {
+ | --------------
+ | |
+ | first mutable borrow occurs here
+ | first borrow later used here
+LL | chars.next();
+ | ^^^^^^^^^^^^ second mutable borrow occurs here
+ |
+ = note: a for loop advances the iterator for you, the result is stored in `_c`.
+ = help: if you want to call `next` on a iterator within the loop, consider using `while let`.
+
+error[E0382]: borrow of moved value: `iter`
+ --> $DIR/issue-102972.rs:12:9
+ |
+LL | let mut iter = v.iter();
+ | -------- move occurs because `iter` has type `std::slice::Iter<'_, i32>`, which does not implement the `Copy` trait
+LL | for _i in iter {
+ | ---- `iter` moved due to this implicit call to `.into_iter()`
+LL | iter.next();
+ | ^^^^^^^^^^^ value borrowed here after move
+ |
+ = note: a for loop advances the iterator for you, the result is stored in `_i`.
+ = help: if you want to call `next` on a iterator within the loop, consider using `while let`.
+note: `into_iter` takes ownership of the receiver `self`, which moves `iter`
+ --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0382, E0499.
+For more information about an error, try `rustc --explain E0382`.
diff --git a/tests/ui/suggestions/issue-103646.rs b/tests/ui/suggestions/issue-103646.rs
new file mode 100644
index 000000000..f679640c5
--- /dev/null
+++ b/tests/ui/suggestions/issue-103646.rs
@@ -0,0 +1,11 @@
+trait Cat {
+ fn nya() {}
+}
+
+fn uwu<T: Cat>(c: T) {
+ c.nya();
+ //~^ ERROR no method named `nya` found for type parameter `T` in the current scope
+ //~| Suggestion T::nya()
+}
+
+fn main() {}
diff --git a/tests/ui/suggestions/issue-103646.stderr b/tests/ui/suggestions/issue-103646.stderr
new file mode 100644
index 000000000..3ae9813d4
--- /dev/null
+++ b/tests/ui/suggestions/issue-103646.stderr
@@ -0,0 +1,21 @@
+error[E0599]: no method named `nya` found for type parameter `T` in the current scope
+ --> $DIR/issue-103646.rs:6:7
+ |
+LL | fn uwu<T: Cat>(c: T) {
+ | - method `nya` not found for this type parameter
+LL | c.nya();
+ | --^^^--
+ | | |
+ | | this is an associated function, not a method
+ | help: use associated function syntax instead: `T::nya()`
+ |
+ = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
+note: the candidate is defined in the trait `Cat`
+ --> $DIR/issue-103646.rs:2:5
+ |
+LL | fn nya() {}
+ | ^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/suggestions/issue-109991.rs b/tests/ui/suggestions/issue-109991.rs
new file mode 100644
index 000000000..918451cb8
--- /dev/null
+++ b/tests/ui/suggestions/issue-109991.rs
@@ -0,0 +1,27 @@
+struct S {
+ a: usize,
+ b: usize,
+}
+
+fn main() {
+ let a: usize;
+ let b: usize;
+ let c: usize;
+
+ (c) = (&123); //~ ERROR mismatched types
+ (a, b) = (123, &mut 123); //~ ERROR mismatched types
+
+ let x: String;
+ (x,) = (1,); //~ ERROR mismatched types
+
+ let x: i32;
+ [x] = [&1]; //~ ERROR mismatched types
+
+ let x: &i32;
+ [x] = [1]; //~ ERROR mismatched types
+
+ let x = (1, &mut 2);
+ (a, b) = x; //~ ERROR mismatched types
+
+ S { a, b } = S { a: 1, b: &mut 2 }; //~ ERROR mismatched types
+}
diff --git a/tests/ui/suggestions/issue-109991.stderr b/tests/ui/suggestions/issue-109991.stderr
new file mode 100644
index 000000000..bd21e4de6
--- /dev/null
+++ b/tests/ui/suggestions/issue-109991.stderr
@@ -0,0 +1,72 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-109991.rs:11:11
+ |
+LL | let c: usize;
+ | ----- expected due to this type
+LL |
+LL | (c) = (&123);
+ | ^^^^^^ expected `usize`, found `&{integer}`
+ |
+help: consider removing the borrow
+ |
+LL - (c) = (&123);
+LL + (c) = (123);
+ |
+
+error[E0308]: mismatched types
+ --> $DIR/issue-109991.rs:12:9
+ |
+LL | let b: usize;
+ | ----- expected due to this type
+...
+LL | (a, b) = (123, &mut 123);
+ | ^ expected `usize`, found `&mut {integer}`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-109991.rs:15:6
+ |
+LL | let x: String;
+ | ------ expected due to this type
+LL | (x,) = (1,);
+ | ^ expected `String`, found integer
+
+error[E0308]: mismatched types
+ --> $DIR/issue-109991.rs:18:6
+ |
+LL | let x: i32;
+ | --- expected due to this type
+LL | [x] = [&1];
+ | ^ expected `i32`, found `&{integer}`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-109991.rs:21:6
+ |
+LL | let x: &i32;
+ | ---- expected due to this type
+LL | [x] = [1];
+ | ^ expected `&i32`, found integer
+
+error[E0308]: mismatched types
+ --> $DIR/issue-109991.rs:24:9
+ |
+LL | let b: usize;
+ | ----- expected due to this type
+...
+LL | (a, b) = x;
+ | ^ expected `usize`, found `&mut {integer}`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-109991.rs:26:31
+ |
+LL | S { a, b } = S { a: 1, b: &mut 2 };
+ | ^^^^^^ expected `usize`, found `&mut {integer}`
+ |
+help: consider removing the borrow
+ |
+LL - S { a, b } = S { a: 1, b: &mut 2 };
+LL + S { a, b } = S { a: 1, b: 2 };
+ |
+
+error: aborting due to 7 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/suggestions/issue-112590-suggest-import.rs b/tests/ui/suggestions/issue-112590-suggest-import.rs
new file mode 100644
index 000000000..0938814c5
--- /dev/null
+++ b/tests/ui/suggestions/issue-112590-suggest-import.rs
@@ -0,0 +1,10 @@
+pub struct S;
+
+impl fmt::Debug for S { //~ ERROR failed to resolve: use of undeclared crate or module `fmt`
+ fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { //~ ERROR failed to resolve: use of undeclared crate or module `fmt`
+ //~^ ERROR failed to resolve: use of undeclared crate or module `fmt`
+ Ok(())
+ }
+}
+
+fn main() { }
diff --git a/tests/ui/suggestions/issue-112590-suggest-import.stderr b/tests/ui/suggestions/issue-112590-suggest-import.stderr
new file mode 100644
index 000000000..aeac18c16
--- /dev/null
+++ b/tests/ui/suggestions/issue-112590-suggest-import.stderr
@@ -0,0 +1,36 @@
+error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
+ --> $DIR/issue-112590-suggest-import.rs:3:6
+ |
+LL | impl fmt::Debug for S {
+ | ^^^ use of undeclared crate or module `fmt`
+ |
+help: consider importing this module
+ |
+LL + use std::fmt;
+ |
+
+error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
+ --> $DIR/issue-112590-suggest-import.rs:4:28
+ |
+LL | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ | ^^^ use of undeclared crate or module `fmt`
+ |
+help: consider importing this module
+ |
+LL + use std::fmt;
+ |
+
+error[E0433]: failed to resolve: use of undeclared crate or module `fmt`
+ --> $DIR/issue-112590-suggest-import.rs:4:51
+ |
+LL | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ | ^^^ use of undeclared crate or module `fmt`
+ |
+help: consider importing this module
+ |
+LL + use std::fmt;
+ |
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0433`.
diff --git a/tests/ui/suggestions/issue-71394-no-from-impl.stderr b/tests/ui/suggestions/issue-71394-no-from-impl.stderr
index 2cd036d2b..80be252a0 100644
--- a/tests/ui/suggestions/issue-71394-no-from-impl.stderr
+++ b/tests/ui/suggestions/issue-71394-no-from-impl.stderr
@@ -5,14 +5,14 @@ LL | let _: &[i8] = data.into();
| ^^^^ the trait `From<&[u8]>` is not implemented for `&[i8]`
|
= help: the following other types implement trait `From<T>`:
- <[T; 10] as From<(T, T, T, T, T, T, T, T, T, T)>>
- <[T; 11] as From<(T, T, T, T, T, T, T, T, T, T, T)>>
- <[T; 12] as From<(T, T, T, T, T, T, T, T, T, T, T, T)>>
+ <[bool; LANES] as From<Mask<T, LANES>>>
+ <[T; N] as From<Simd<T, N>>>
<[T; 1] as From<(T,)>>
<[T; 2] as From<(T, T)>>
<[T; 3] as From<(T, T, T)>>
<[T; 4] as From<(T, T, T, T)>>
<[T; 5] as From<(T, T, T, T, T)>>
+ <[T; 6] as From<(T, T, T, T, T, T)>>
and 6 others
= note: required for `&[u8]` to implement `Into<&[i8]>`
diff --git a/tests/ui/suggestions/issue-88696.rs b/tests/ui/suggestions/issue-88696.rs
new file mode 100644
index 000000000..745fdef15
--- /dev/null
+++ b/tests/ui/suggestions/issue-88696.rs
@@ -0,0 +1,14 @@
+// This test case should ensure that miniz_oxide isn't
+// suggested, since it's not a direct dependency.
+
+fn a() -> Result<u64, i32> {
+ Err(1)
+}
+
+fn b() -> Result<u32, i32> {
+ a().into() //~ERROR [E0277]
+}
+
+fn main() {
+ let _ = dbg!(b());
+}
diff --git a/tests/ui/suggestions/issue-88696.stderr b/tests/ui/suggestions/issue-88696.stderr
new file mode 100644
index 000000000..4947269d7
--- /dev/null
+++ b/tests/ui/suggestions/issue-88696.stderr
@@ -0,0 +1,11 @@
+error[E0277]: the trait bound `Result<u32, i32>: From<Result<u64, i32>>` is not satisfied
+ --> $DIR/issue-88696.rs:9:9
+ |
+LL | a().into()
+ | ^^^^ the trait `From<Result<u64, i32>>` is not implemented for `Result<u32, i32>`
+ |
+ = note: required for `Result<u64, i32>` to implement `Into<Result<u32, i32>>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/suggestions/issue-89640.rs b/tests/ui/suggestions/issue-89640.rs
new file mode 100644
index 000000000..6bb33ad8f
--- /dev/null
+++ b/tests/ui/suggestions/issue-89640.rs
@@ -0,0 +1,3 @@
+fn main() {
+ le t x: i32 = 3; //~ ERROR expected one of
+}
diff --git a/tests/ui/suggestions/issue-89640.stderr b/tests/ui/suggestions/issue-89640.stderr
new file mode 100644
index 000000000..8ff4ef4f0
--- /dev/null
+++ b/tests/ui/suggestions/issue-89640.stderr
@@ -0,0 +1,13 @@
+error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `t`
+ --> $DIR/issue-89640.rs:2:8
+ |
+LL | le t x: i32 = 3;
+ | ^ expected one of 8 possible tokens
+ |
+help: consider removing the space to spell keyword `let`
+ |
+LL | let x: i32 = 3;
+ | ~~~
+
+error: aborting due to previous error
+
diff --git a/tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr b/tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr
index 6071b10d3..eb74679d6 100644
--- a/tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr
+++ b/tests/ui/suggestions/removal-of-multiline-trait-bound-in-where-clause.stderr
@@ -4,7 +4,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
LL | fn foo<T>(foo: Wrapper<T>)
| - ^^^^^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `Wrapper`
--> $DIR/removal-of-multiline-trait-bound-in-where-clause.rs:1:16
@@ -33,7 +33,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
LL | fn bar<T>(foo: Wrapper<T>)
| - ^^^^^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `Wrapper`
--> $DIR/removal-of-multiline-trait-bound-in-where-clause.rs:1:16
@@ -58,7 +58,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim
LL | fn qux<T>(foo: Wrapper<T>)
| - ^^^^^^^^^^ doesn't have a size known at compile-time
| |
- | this type parameter needs to be `std::marker::Sized`
+ | this type parameter needs to be `Sized`
|
note: required by a bound in `Wrapper`
--> $DIR/removal-of-multiline-trait-bound-in-where-clause.rs:1:16
diff --git a/tests/ui/suggestions/suggest-split-at-mut.stderr b/tests/ui/suggestions/suggest-split-at-mut.stderr
index 330f012b2..bb1851383 100644
--- a/tests/ui/suggestions/suggest-split-at-mut.stderr
+++ b/tests/ui/suggestions/suggest-split-at-mut.stderr
@@ -9,6 +9,7 @@ LL | *a = 5;
| ------ first borrow later used here
|
= help: consider using `.split_at_mut(position)` or similar method to obtain two mutable non-overlapping sub-slices
+ = help: consider using `.swap(index_1, index_2)` to swap elements at the specified indices
error: aborting due to previous error
diff --git a/tests/ui/suggestions/while-let-typo.rs b/tests/ui/suggestions/while-let-typo.rs
index dbbcdee3c..21b254054 100644
--- a/tests/ui/suggestions/while-let-typo.rs
+++ b/tests/ui/suggestions/while-let-typo.rs
@@ -2,7 +2,7 @@ fn main() {
let foo = Some(0);
let bar = None;
while Some(x) = foo {} //~ ERROR cannot find value `x` in this scope
- while Some(foo) = bar {}
+ while Some(foo) = bar {} //~ ERROR mismatched types
while 3 = foo {} //~ ERROR mismatched types
while Some(3) = foo {} //~ ERROR invalid left-hand side of assignment
while x = 5 {} //~ ERROR cannot find value `x` in this scope
diff --git a/tests/ui/suggestions/while-let-typo.stderr b/tests/ui/suggestions/while-let-typo.stderr
index 7cc2ed314..69a7e5761 100644
--- a/tests/ui/suggestions/while-let-typo.stderr
+++ b/tests/ui/suggestions/while-let-typo.stderr
@@ -21,6 +21,17 @@ LL | while let x = 5 {}
| +++
error[E0308]: mismatched types
+ --> $DIR/while-let-typo.rs:5:11
+ |
+LL | while Some(foo) = bar {}
+ | ^^^^^^^^^^^^^^^ expected `bool`, found `()`
+ |
+help: consider adding `let`
+ |
+LL | while let Some(foo) = bar {}
+ | +++
+
+error[E0308]: mismatched types
--> $DIR/while-let-typo.rs:6:11
|
LL | while 3 = foo {}
@@ -39,7 +50,7 @@ help: you might have meant to use pattern destructuring
LL | while let Some(3) = foo {}
| +++
-error: aborting due to 4 previous errors
+error: aborting due to 5 previous errors
Some errors have detailed explanations: E0070, E0308, E0425.
For more information about an error, try `rustc --explain E0070`.