Skip to content

Commit 50c2936

Browse files
committed
Bless new test output (new trait impls in lists of suggestions)
1 parent 040e134 commit 50c2936

9 files changed

+48
-24
lines changed

tests/ui/array-slice-vec/slice-to-vec-comparison.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ fn main() {
22
let a = &[];
33
let b: &Vec<u8> = &vec![];
44
a > b;
5-
//~^ ERROR mismatched types
5+
//~^ ERROR can't compare `[_; 0]` with `Vec<u8>`
66
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1-
error[E0308]: mismatched types
2-
--> $DIR/slice-to-vec-comparison.rs:4:9
1+
error[E0277]: can't compare `[_; 0]` with `Vec<u8>`
2+
--> $DIR/slice-to-vec-comparison.rs:4:7
33
|
44
LL | a > b;
5-
| ^ expected `&[_; 0]`, found `&Vec<u8>`
5+
| ^ no implementation for `[_; 0] < Vec<u8>` and `[_; 0] > Vec<u8>`
66
|
7-
= note: expected reference `&[_; 0]`
8-
found reference `&Vec<u8>`
7+
= help: the trait `PartialOrd<Vec<u8>>` is not implemented for `[_; 0]`
8+
= help: the following other types implement trait `PartialOrd<Rhs>`:
9+
`&[u8; N]` implements `PartialOrd<ByteStr>`
10+
`&[u8; N]` implements `PartialOrd<ByteString>`
11+
`&[u8]` implements `PartialOrd<ByteStr>`
12+
`&[u8]` implements `PartialOrd<ByteString>`
13+
`[T; N]` implements `PartialOrd`
14+
`[T]` implements `PartialOrd`
15+
`[u8; N]` implements `PartialOrd<ByteStr>`
16+
`[u8; N]` implements `PartialOrd<ByteString>`
17+
and 2 others
18+
= note: required for `&[_; 0]` to implement `PartialOrd<&Vec<u8>>`
919

1020
error: aborting due to 1 previous error
1121

12-
For more information about this error, try `rustc --explain E0308`.
22+
For more information about this error, try `rustc --explain E0277`.

tests/ui/associated-types/associated-types-in-ambiguous-context.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ LL | type X = std::ops::Deref::Target;
4040
|
4141
help: use fully-qualified syntax
4242
|
43+
LL | type X = <ByteStr as Deref>::Target;
44+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
45+
LL | type X = <ByteString as Deref>::Target;
46+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4347
LL | type X = <CString as Deref>::Target;
4448
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
4549
LL | type X = <IoSlice<'_> as Deref>::Target;
4650
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47-
LL | type X = <IoSliceMut<'_> as Deref>::Target;
48-
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49-
LL | type X = <OsString as Deref>::Target;
50-
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
5151
and N other candidates
5252

5353
error: aborting due to 5 previous errors

tests/ui/consts/too_generic_eval_ice.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ LL | [5; Self::HOST_SIZE] == [6; 0]
3232
= help: the following other types implement trait `PartialEq<Rhs>`:
3333
`&[T]` implements `PartialEq<Vec<U, A>>`
3434
`&[T]` implements `PartialEq<[U; N]>`
35+
`&[u8; N]` implements `PartialEq<ByteStr>`
36+
`&[u8; N]` implements `PartialEq<ByteString>`
37+
`&[u8]` implements `PartialEq<ByteStr>`
38+
`&[u8]` implements `PartialEq<ByteString>`
3539
`&mut [T]` implements `PartialEq<Vec<U, A>>`
3640
`&mut [T]` implements `PartialEq<[U; N]>`
37-
`[T; N]` implements `PartialEq<&[U]>`
38-
`[T; N]` implements `PartialEq<&mut [U]>`
39-
`[T; N]` implements `PartialEq<[U; N]>`
40-
`[T; N]` implements `PartialEq<[U]>`
41-
and 3 others
41+
and 11 others
4242

4343
error: aborting due to 4 previous errors
4444

tests/ui/indexing/point-at-index-for-obligation-failure.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ error[E0277]: the trait bound `String: Borrow<&str>` is not satisfied
44
LL | &s
55
| ^^ the trait `Borrow<&str>` is not implemented for `String`
66
|
7-
= help: the trait `Borrow<&_>` is not implemented for `String`
8-
but trait `Borrow<_>` is implemented for it
9-
= help: for that trait implementation, expected `str`, found `&str`
7+
= help: the following other types implement trait `Borrow<Borrowed>`:
8+
`String` implements `Borrow<ByteStr>`
9+
`String` implements `Borrow<str>`
1010
= note: required for `HashMap<String, String>` to implement `Index<&&str>`
1111

1212
error: aborting due to 1 previous error

tests/ui/inference/issue-71732.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ LL | .get(&"key".into())
77
| cannot infer type of the type parameter `Q` declared on the method `get`
88
|
99
= note: multiple `impl`s satisfying `String: Borrow<_>` found in the following crates: `alloc`, `core`:
10+
- impl Borrow<ByteStr> for String;
1011
- impl Borrow<str> for String;
1112
- impl<T> Borrow<T> for T
1213
where T: ?Sized;

tests/ui/inference/issue-72616.stderr

+8-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ LL | if String::from("a") == "a".try_into().unwrap() {}
66
| |
77
| type must be known at this point
88
|
9-
= note: multiple `impl`s satisfying `String: PartialEq<_>` found in the `alloc` crate:
10-
- impl PartialEq for String;
11-
- impl<'a, 'b> PartialEq<&'a str> for String;
12-
- impl<'a, 'b> PartialEq<Cow<'a, str>> for String;
13-
- impl<'a, 'b> PartialEq<str> for String;
9+
= note: cannot satisfy `String: PartialEq<_>`
10+
= help: the following types implement trait `PartialEq<Rhs>`:
11+
`String` implements `PartialEq<&str>`
12+
`String` implements `PartialEq<ByteStr>`
13+
`String` implements `PartialEq<ByteString>`
14+
`String` implements `PartialEq<Cow<'_, str>>`
15+
`String` implements `PartialEq<str>`
16+
`String` implements `PartialEq`
1417
help: try using a fully qualified path to specify the expected types
1518
|
1619
LL | if String::from("a") == <&str as TryInto<T>>::try_into("a").unwrap() {}

tests/ui/inference/issue-72690.stderr

+9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ LL | String::from("x".as_ref());
1515
| ^^^^^^
1616
|
1717
= note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
18+
- impl AsRef<ByteStr> for str;
1819
- impl AsRef<OsStr> for str;
1920
- impl AsRef<Path> for str;
2021
- impl AsRef<[u8]> for str;
@@ -41,6 +42,7 @@ LL | |x| String::from("x".as_ref());
4142
| ^^^^^^
4243
|
4344
= note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
45+
- impl AsRef<ByteStr> for str;
4446
- impl AsRef<OsStr> for str;
4547
- impl AsRef<Path> for str;
4648
- impl AsRef<[u8]> for str;
@@ -57,6 +59,7 @@ LL | let _ = "x".as_ref();
5759
| ^ ------ type must be known at this point
5860
|
5961
= note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
62+
- impl AsRef<ByteStr> for str;
6063
- impl AsRef<OsStr> for str;
6164
- impl AsRef<Path> for str;
6265
- impl AsRef<[u8]> for str;
@@ -83,6 +86,7 @@ LL | String::from("x".as_ref());
8386
| ^^^^^^
8487
|
8588
= note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
89+
- impl AsRef<ByteStr> for str;
8690
- impl AsRef<OsStr> for str;
8791
- impl AsRef<Path> for str;
8892
- impl AsRef<[u8]> for str;
@@ -109,6 +113,7 @@ LL | String::from("x".as_ref());
109113
| ^^^^^^
110114
|
111115
= note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
116+
- impl AsRef<ByteStr> for str;
112117
- impl AsRef<OsStr> for str;
113118
- impl AsRef<Path> for str;
114119
- impl AsRef<[u8]> for str;
@@ -135,6 +140,7 @@ LL | String::from("x".as_ref());
135140
| ^^^^^^
136141
|
137142
= note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
143+
- impl AsRef<ByteStr> for str;
138144
- impl AsRef<OsStr> for str;
139145
- impl AsRef<Path> for str;
140146
- impl AsRef<[u8]> for str;
@@ -161,6 +167,7 @@ LL | String::from("x".as_ref());
161167
| ^^^^^^
162168
|
163169
= note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
170+
- impl AsRef<ByteStr> for str;
164171
- impl AsRef<OsStr> for str;
165172
- impl AsRef<Path> for str;
166173
- impl AsRef<[u8]> for str;
@@ -187,6 +194,7 @@ LL | String::from("x".as_ref());
187194
| ^^^^^^
188195
|
189196
= note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
197+
- impl AsRef<ByteStr> for str;
190198
- impl AsRef<OsStr> for str;
191199
- impl AsRef<Path> for str;
192200
- impl AsRef<[u8]> for str;
@@ -213,6 +221,7 @@ LL | String::from("x".as_ref());
213221
| ^^^^^^
214222
|
215223
= note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
224+
- impl AsRef<ByteStr> for str;
216225
- impl AsRef<OsStr> for str;
217226
- impl AsRef<Path> for str;
218227
- impl AsRef<[u8]> for str;

tests/ui/traits/issue-77982.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ LL | opts.get(opt.as_ref());
77
| cannot infer type of the type parameter `Q` declared on the method `get`
88
|
99
= note: multiple `impl`s satisfying `String: Borrow<_>` found in the following crates: `alloc`, `core`:
10+
- impl Borrow<ByteStr> for String;
1011
- impl Borrow<str> for String;
1112
- impl<T> Borrow<T> for T
1213
where T: ?Sized;

0 commit comments

Comments
 (0)