diff --git a/tests/ui/array-slice-vec/slice-to-vec-comparison.rs b/tests/ui/array-slice-vec/slice-to-vec-comparison.rs index 7026a49000c55..c1860e4749b91 100644 --- a/tests/ui/array-slice-vec/slice-to-vec-comparison.rs +++ b/tests/ui/array-slice-vec/slice-to-vec-comparison.rs @@ -2,5 +2,5 @@ fn main() { let a = &[]; let b: &Vec = &vec![]; a > b; - //~^ ERROR mismatched types + //~^ ERROR can't compare `[_; 0]` with `Vec` } diff --git a/tests/ui/array-slice-vec/slice-to-vec-comparison.stderr b/tests/ui/array-slice-vec/slice-to-vec-comparison.stderr index 7e5b8afea24b1..1891ed55fa088 100644 --- a/tests/ui/array-slice-vec/slice-to-vec-comparison.stderr +++ b/tests/ui/array-slice-vec/slice-to-vec-comparison.stderr @@ -1,12 +1,22 @@ -error[E0308]: mismatched types - --> $DIR/slice-to-vec-comparison.rs:4:9 +error[E0277]: can't compare `[_; 0]` with `Vec` + --> $DIR/slice-to-vec-comparison.rs:4:7 | LL | a > b; - | ^ expected `&[_; 0]`, found `&Vec` + | ^ no implementation for `[_; 0] < Vec` and `[_; 0] > Vec` | - = note: expected reference `&[_; 0]` - found reference `&Vec` + = help: the trait `PartialOrd>` is not implemented for `[_; 0]` + = help: the following other types implement trait `PartialOrd`: + `&[u8; N]` implements `PartialOrd` + `&[u8; N]` implements `PartialOrd` + `&[u8]` implements `PartialOrd` + `&[u8]` implements `PartialOrd` + `[T; N]` implements `PartialOrd` + `[T]` implements `PartialOrd` + `[u8; N]` implements `PartialOrd` + `[u8; N]` implements `PartialOrd` + and 2 others + = note: required for `&[_; 0]` to implement `PartialOrd<&Vec>` error: aborting due to 1 previous error -For more information about this error, try `rustc --explain E0308`. +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr b/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr index 311ee9be54bc2..88db361171919 100644 --- a/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr +++ b/tests/ui/associated-types/associated-types-in-ambiguous-context.stderr @@ -42,12 +42,12 @@ help: use fully-qualified syntax | LL | type X = ::Target; | ~~~~~~~~~~~~~~~~~~~~~~~~~~ +LL | type X = ::Target; + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LL | type X = ::Target; | ~~~~~~~~~~~~~~~~~~~~~~~~~~ LL | type X = as Deref>::Target; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -LL | type X = as Deref>::Target; - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ and N other candidates error: aborting due to 5 previous errors diff --git a/tests/ui/consts/too_generic_eval_ice.stderr b/tests/ui/consts/too_generic_eval_ice.stderr index b48be16a24c8e..3cc4377514a21 100644 --- a/tests/ui/consts/too_generic_eval_ice.stderr +++ b/tests/ui/consts/too_generic_eval_ice.stderr @@ -32,13 +32,13 @@ LL | [5; Self::HOST_SIZE] == [6; 0] = help: the following other types implement trait `PartialEq`: `&[T]` implements `PartialEq>` `&[T]` implements `PartialEq<[U; N]>` + `&[u8; N]` implements `PartialEq` + `&[u8; N]` implements `PartialEq` + `&[u8]` implements `PartialEq` + `&[u8]` implements `PartialEq` `&mut [T]` implements `PartialEq>` `&mut [T]` implements `PartialEq<[U; N]>` - `[T; N]` implements `PartialEq<&[U]>` - `[T; N]` implements `PartialEq<&mut [U]>` - `[T; N]` implements `PartialEq<[U; N]>` - `[T; N]` implements `PartialEq<[U]>` - and 3 others + and 11 others error: aborting due to 4 previous errors diff --git a/tests/ui/indexing/point-at-index-for-obligation-failure.stderr b/tests/ui/indexing/point-at-index-for-obligation-failure.stderr index 0752231356cfc..905b54d28b538 100644 --- a/tests/ui/indexing/point-at-index-for-obligation-failure.stderr +++ b/tests/ui/indexing/point-at-index-for-obligation-failure.stderr @@ -4,9 +4,9 @@ error[E0277]: the trait bound `String: Borrow<&str>` is not satisfied LL | &s | ^^ the trait `Borrow<&str>` is not implemented for `String` | - = help: the trait `Borrow<&_>` is not implemented for `String` - but trait `Borrow<_>` is implemented for it - = help: for that trait implementation, expected `str`, found `&str` + = help: the following other types implement trait `Borrow`: + `String` implements `Borrow` + `String` implements `Borrow` = note: required for `HashMap` to implement `Index<&&str>` error: aborting due to 1 previous error diff --git a/tests/ui/inference/issue-71732.stderr b/tests/ui/inference/issue-71732.stderr index af8b310fd1d9c..46200e20728ae 100644 --- a/tests/ui/inference/issue-71732.stderr +++ b/tests/ui/inference/issue-71732.stderr @@ -7,6 +7,7 @@ LL | .get(&"key".into()) | cannot infer type of the type parameter `Q` declared on the method `get` | = note: multiple `impl`s satisfying `String: Borrow<_>` found in the following crates: `alloc`, `core`: + - impl Borrow for String; - impl Borrow for String; - impl Borrow for T where T: ?Sized; diff --git a/tests/ui/inference/issue-72616.stderr b/tests/ui/inference/issue-72616.stderr index 02c92c1c11d02..a26f9a1ff5618 100644 --- a/tests/ui/inference/issue-72616.stderr +++ b/tests/ui/inference/issue-72616.stderr @@ -6,11 +6,14 @@ LL | if String::from("a") == "a".try_into().unwrap() {} | | | type must be known at this point | - = note: multiple `impl`s satisfying `String: PartialEq<_>` found in the `alloc` crate: - - impl PartialEq for String; - - impl<'a, 'b> PartialEq<&'a str> for String; - - impl<'a, 'b> PartialEq> for String; - - impl<'a, 'b> PartialEq for String; + = note: cannot satisfy `String: PartialEq<_>` + = help: the following types implement trait `PartialEq`: + `String` implements `PartialEq<&str>` + `String` implements `PartialEq` + `String` implements `PartialEq` + `String` implements `PartialEq>` + `String` implements `PartialEq` + `String` implements `PartialEq` help: try using a fully qualified path to specify the expected types | LL | if String::from("a") == <&str as TryInto>::try_into("a").unwrap() {} diff --git a/tests/ui/inference/issue-72690.stderr b/tests/ui/inference/issue-72690.stderr index 6391672f8617d..2d09f667ae2cf 100644 --- a/tests/ui/inference/issue-72690.stderr +++ b/tests/ui/inference/issue-72690.stderr @@ -15,6 +15,7 @@ LL | String::from("x".as_ref()); | ^^^^^^ | = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; - impl AsRef for str; - impl AsRef for str; - impl AsRef<[u8]> for str; @@ -41,6 +42,7 @@ LL | |x| String::from("x".as_ref()); | ^^^^^^ | = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; - impl AsRef for str; - impl AsRef for str; - impl AsRef<[u8]> for str; @@ -57,6 +59,7 @@ LL | let _ = "x".as_ref(); | ^ ------ type must be known at this point | = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; - impl AsRef for str; - impl AsRef for str; - impl AsRef<[u8]> for str; @@ -83,6 +86,7 @@ LL | String::from("x".as_ref()); | ^^^^^^ | = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; - impl AsRef for str; - impl AsRef for str; - impl AsRef<[u8]> for str; @@ -109,6 +113,7 @@ LL | String::from("x".as_ref()); | ^^^^^^ | = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; - impl AsRef for str; - impl AsRef for str; - impl AsRef<[u8]> for str; @@ -135,6 +140,7 @@ LL | String::from("x".as_ref()); | ^^^^^^ | = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; - impl AsRef for str; - impl AsRef for str; - impl AsRef<[u8]> for str; @@ -161,6 +167,7 @@ LL | String::from("x".as_ref()); | ^^^^^^ | = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; - impl AsRef for str; - impl AsRef for str; - impl AsRef<[u8]> for str; @@ -187,6 +194,7 @@ LL | String::from("x".as_ref()); | ^^^^^^ | = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; - impl AsRef for str; - impl AsRef for str; - impl AsRef<[u8]> for str; @@ -213,6 +221,7 @@ LL | String::from("x".as_ref()); | ^^^^^^ | = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`: + - impl AsRef for str; - impl AsRef for str; - impl AsRef for str; - impl AsRef<[u8]> for str; diff --git a/tests/ui/suggestions/issue-71394-no-from-impl.stderr b/tests/ui/suggestions/issue-71394-no-from-impl.stderr index 31f8f1d455aba..e9f7131721629 100644 --- a/tests/ui/suggestions/issue-71394-no-from-impl.stderr +++ b/tests/ui/suggestions/issue-71394-no-from-impl.stderr @@ -5,15 +5,15 @@ LL | let _: &[i8] = data.into(); | ^^^^ the trait `From<&[u8]>` is not implemented for `&[i8]` | = help: the following other types implement trait `From`: + `&[u8]` implements `From<&ByteStr>` + `&mut [u8]` implements `From<&mut ByteStr>` `[T; 10]` implements `From<(T, T, T, T, T, T, T, T, T, T)>` `[T; 11]` implements `From<(T, T, T, T, T, T, T, T, T, T, T)>` `[T; 12]` implements `From<(T, T, T, T, T, T, T, T, T, T, T, T)>` `[T; 1]` implements `From<(T,)>` `[T; 2]` implements `From<(T, T)>` `[T; 3]` implements `From<(T, T, T)>` - `[T; 4]` implements `From<(T, T, T, T)>` - `[T; 5]` implements `From<(T, T, T, T, T)>` - and 6 others + and 8 others = note: required for `&[u8]` to implement `Into<&[i8]>` error: aborting due to 1 previous error diff --git a/tests/ui/traits/issue-77982.stderr b/tests/ui/traits/issue-77982.stderr index 2b26a1b7ab15a..52af5c2e752c7 100644 --- a/tests/ui/traits/issue-77982.stderr +++ b/tests/ui/traits/issue-77982.stderr @@ -7,6 +7,7 @@ LL | opts.get(opt.as_ref()); | cannot infer type of the type parameter `Q` declared on the method `get` | = note: multiple `impl`s satisfying `String: Borrow<_>` found in the following crates: `alloc`, `core`: + - impl Borrow for String; - impl Borrow for String; - impl Borrow for T where T: ?Sized;