Skip to content

Commit 35fbbca

Browse files
committed
Update UI tests. Audit these before marking ready and/or merging.
1 parent e90b21d commit 35fbbca

File tree

76 files changed

+238
-98
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+238
-98
lines changed

tests/ui/associated-inherent-types/dispatch-on-self-type-2.stderr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ LL | let _: Parameterized<(), ()>::Output = String::new();
55
| ----------------------------- ^^^^^^^^^^^^^ expected `bool`, found `String`
66
| |
77
| expected due to this
8+
|
9+
= note: expected type `bool`
10+
found struct `String`
811

912
error[E0308]: mismatched types
1013
--> $DIR/dispatch-on-self-type-2.rs:16:47

tests/ui/associated-types/hr-associated-type-bound-1.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
44
LL | type U = str;
55
| ^^^ the trait `Clone` is not implemented for `str`
66
|
7-
= help: the trait `Clone` is implemented for `String`
7+
= help: the trait `Clone` is implemented for `String<A>`
88
note: required by a bound in `X`
99
--> $DIR/hr-associated-type-bound-1.rs:3:33
1010
|
@@ -20,7 +20,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
2020
LL | 1i32.f("abc");
2121
| ^ the trait `Clone` is not implemented for `str`
2222
|
23-
= help: the trait `Clone` is implemented for `String`
23+
= help: the trait `Clone` is implemented for `String<A>`
2424
note: required by a bound in `X::f`
2525
--> $DIR/hr-associated-type-bound-1.rs:3:33
2626
|

tests/ui/associated-types/hr-associated-type-bound-param-1.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
44
LL | type V = str;
55
| ^^^ the trait `Clone` is not implemented for `str`
66
|
7-
= help: the trait `Clone` is implemented for `String`
7+
= help: the trait `Clone` is implemented for `String<A>`
88
note: required by a bound in `Y`
99
--> $DIR/hr-associated-type-bound-param-1.rs:4:36
1010
|
@@ -20,7 +20,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
2020
LL | 1u8.g("abc");
2121
| ^ the trait `Clone` is not implemented for `str`
2222
|
23-
= help: the trait `Clone` is implemented for `String`
23+
= help: the trait `Clone` is implemented for `String<A>`
2424
note: required by a bound in `Y::g`
2525
--> $DIR/hr-associated-type-bound-param-1.rs:4:36
2626
|

tests/ui/associated-types/hr-associated-type-bound-param-2.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
44
LL | T: Z<'a, u16>,
55
| ^^^^^^^^^^ the trait `Clone` is not implemented for `str`
66
|
7-
= help: the trait `Clone` is implemented for `String`
7+
= help: the trait `Clone` is implemented for `String<A>`
88
note: required by a bound in `Z`
99
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
1010
|
@@ -20,7 +20,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
2020
LL | type W = str;
2121
| ^^^ the trait `Clone` is not implemented for `str`
2222
|
23-
= help: the trait `Clone` is implemented for `String`
23+
= help: the trait `Clone` is implemented for `String<A>`
2424
note: required by a bound in `Z`
2525
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
2626
|
@@ -36,7 +36,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
3636
LL | T: Z<'a, u16>,
3737
| ^^^^^^^^^^ the trait `Clone` is not implemented for `str`
3838
|
39-
= help: the trait `Clone` is implemented for `String`
39+
= help: the trait `Clone` is implemented for `String<A>`
4040
note: required by a bound in `Z`
4141
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
4242
|
@@ -53,7 +53,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
5353
LL | <T::W>::clone(x);
5454
| ^^^^ the trait `Clone` is not implemented for `str`
5555
|
56-
= help: the trait `Clone` is implemented for `String`
56+
= help: the trait `Clone` is implemented for `String<A>`
5757
note: required by a bound in `Z::W`
5858
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
5959
|
@@ -69,7 +69,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
6969
LL | <T::W>::clone(x);
7070
| ^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str`
7171
|
72-
= help: the trait `Clone` is implemented for `String`
72+
= help: the trait `Clone` is implemented for `String<A>`
7373
note: required by a bound in `Z`
7474
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
7575
|
@@ -85,7 +85,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
8585
LL | 1u16.h("abc");
8686
| ^ the trait `Clone` is not implemented for `str`
8787
|
88-
= help: the trait `Clone` is implemented for `String`
88+
= help: the trait `Clone` is implemented for `String<A>`
8989
note: required by a bound in `Z::h`
9090
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
9191
|

tests/ui/associated-types/hr-associated-type-bound-param-3.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
44
LL | type U = str;
55
| ^^^ the trait `Clone` is not implemented for `str`
66
|
7-
= help: the trait `Clone` is implemented for `String`
7+
= help: the trait `Clone` is implemented for `String<A>`
88
note: required by a bound in `X`
99
--> $DIR/hr-associated-type-bound-param-3.rs:4:33
1010
|
@@ -20,7 +20,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
2020
LL | <(i32,) as X<(i32,)>>::f("abc");
2121
| ^^^^^^ the trait `Clone` is not implemented for `str`
2222
|
23-
= help: the trait `Clone` is implemented for `String`
23+
= help: the trait `Clone` is implemented for `String<A>`
2424
note: required by a bound in `X::f`
2525
--> $DIR/hr-associated-type-bound-param-3.rs:4:33
2626
|

tests/ui/associated-types/hr-associated-type-bound-param-4.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
44
LL | type U = str;
55
| ^^^ the trait `Clone` is not implemented for `str`
66
|
7-
= help: the trait `Clone` is implemented for `String`
7+
= help: the trait `Clone` is implemented for `String<A>`
88
note: required by a bound in `X`
99
--> $DIR/hr-associated-type-bound-param-4.rs:4:36
1010
|
@@ -20,7 +20,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
2020
LL | <(i32,) as X<i32>>::f("abc");
2121
| ^^^ the trait `Clone` is not implemented for `str`
2222
|
23-
= help: the trait `Clone` is implemented for `String`
23+
= help: the trait `Clone` is implemented for `String<A>`
2424
note: required by a bound in `X::f`
2525
--> $DIR/hr-associated-type-bound-param-4.rs:4:36
2626
|

tests/ui/associated-types/hr-associated-type-bound-param-5.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
44
LL | type U = str;
55
| ^^^ the trait `Clone` is not implemented for `str`
66
|
7-
= help: the trait `Clone` is implemented for `String`
7+
= help: the trait `Clone` is implemented for `String<A>`
88
note: required by a bound in `X`
99
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
1010
|
@@ -20,7 +20,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
2020
LL | type U = str;
2121
| ^^^ the trait `Clone` is not implemented for `str`
2222
|
23-
= help: the trait `Clone` is implemented for `String`
23+
= help: the trait `Clone` is implemented for `String<A>`
2424
note: required by a bound in `X`
2525
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
2626
|
@@ -36,7 +36,7 @@ error[E0277]: the trait bound `str: Clone` is not satisfied
3636
LL | <i32 as X<Box<i32>>>::f("abc");
3737
| ^^^^^^^^ the trait `Clone` is not implemented for `str`
3838
|
39-
= help: the trait `Clone` is implemented for `String`
39+
= help: the trait `Clone` is implemented for `String<A>`
4040
note: required by a bound in `X::f`
4141
--> $DIR/hr-associated-type-bound-param-5.rs:15:33
4242
|

tests/ui/attributes/dump-preds.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | trait Trait<T>: Iterator<Item: Copy>
77
= note: Binder { value: TraitPredicate(<Self as std::iter::Iterator>, polarity:Positive), bound_vars: [] }
88
= note: Binder { value: TraitPredicate(<<Self as std::iter::Iterator>::Item as std::marker::Copy>, polarity:Positive), bound_vars: [] }
99
= note: Binder { value: TraitPredicate(<T as std::marker::Sized>, polarity:Positive), bound_vars: [] }
10-
= note: Binder { value: TraitPredicate(<std::string::String as std::convert::From<T>>, polarity:Positive), bound_vars: [] }
10+
= note: Binder { value: TraitPredicate(<std::string::string::String as std::convert::From<T>>, polarity:Positive), bound_vars: [] }
1111
= note: Binder { value: TraitPredicate(<Self as Trait<T>>, polarity:Positive), bound_vars: [] }
1212

1313
error: rustc_dump_predicates
@@ -19,7 +19,7 @@ LL | type Assoc<P: Eq>: std::ops::Deref<Target = ()>
1919
= note: Binder { value: TraitPredicate(<Self as std::iter::Iterator>, polarity:Positive), bound_vars: [] }
2020
= note: Binder { value: TraitPredicate(<<Self as std::iter::Iterator>::Item as std::marker::Copy>, polarity:Positive), bound_vars: [] }
2121
= note: Binder { value: TraitPredicate(<T as std::marker::Sized>, polarity:Positive), bound_vars: [] }
22-
= note: Binder { value: TraitPredicate(<std::string::String as std::convert::From<T>>, polarity:Positive), bound_vars: [] }
22+
= note: Binder { value: TraitPredicate(<std::string::string::String as std::convert::From<T>>, polarity:Positive), bound_vars: [] }
2323
= note: Binder { value: TraitPredicate(<Self as Trait<T>>, polarity:Positive), bound_vars: [] }
2424
= note: Binder { value: TraitPredicate(<P as std::marker::Sized>, polarity:Positive), bound_vars: [] }
2525
= note: Binder { value: TraitPredicate(<P as std::cmp::Eq>, polarity:Positive), bound_vars: [] }

tests/ui/attributes/rustc_confusables_std_cases.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ LL | String::new().push("");
8989
| arguments to this method are incorrect
9090
|
9191
note: method defined here
92-
--> $SRC_DIR/alloc/src/string.rs:LL:COL
92+
--> $SRC_DIR/alloc/src/string/string.rs:LL:COL
9393
help: you might have meant to use `push_str`
9494
|
9595
LL | String::new().push_str("");

tests/ui/binop/binop-bitxor-str.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | fn main() { let x = "a".to_string() ^ "b".to_string(); }
77
| String
88
|
99
note: the foreign item type `String` doesn't implement `BitXor`
10-
--> $SRC_DIR/alloc/src/string.rs:LL:COL
10+
--> $SRC_DIR/alloc/src/string/string.rs:LL:COL
1111
|
1212
= note: not implement `BitXor`
1313

tests/ui/block-result/consider-removing-last-semi.stderr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ LL | pub fn f() -> String {
88
LL | 0u8;
99
LL | "bla".to_string();
1010
| - help: remove this semicolon to return this value
11+
|
12+
= note: expected struct `String`
13+
found unit type `()`
1114

1215
error[E0308]: mismatched types
1316
--> $DIR/consider-removing-last-semi.rs:8:15
@@ -19,6 +22,9 @@ LL | pub fn g() -> String {
1922
LL | "this won't work".to_string();
2023
LL | "removeme".to_string();
2124
| - help: remove this semicolon to return this value
25+
|
26+
= note: expected struct `String`
27+
found unit type `()`
2228

2329
error[E0308]: mismatched types
2430
--> $DIR/consider-removing-last-semi.rs:13:25

tests/ui/block-result/issue-13428.stderr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ LL | fn foo() -> String {
55
| --- ^^^^^^ expected `String`, found `()`
66
| |
77
| implicitly returns `()` as its body has no tail or `return` expression
8+
|
9+
= note: expected struct `String`
10+
found unit type `()`
811

912
error[E0308]: mismatched types
1013
--> $DIR/issue-13428.rs:11:13
@@ -16,6 +19,9 @@ LL | fn bar() -> String {
1619
LL | "foobar".to_string()
1720
LL | ;
1821
| - help: remove this semicolon to return this value
22+
|
23+
= note: expected struct `String`
24+
found unit type `()`
1925

2026
error: aborting due to 2 previous errors
2127

tests/ui/coercion/coerce-loop-issue-122561.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ LL | | return String::from("test");
6868
LL | | }
6969
| |_____^ expected `String`, found `()`
7070
|
71+
= note: expected struct `String`
72+
found unit type `()`
7173
= note: `for` loops evaluate to unit type `()`
7274
help: consider returning a value here
7375
|

tests/ui/consts/miri_unleashed/assoc_const_2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trait Foo {
77
}
88

99
trait Bar<U: Foo> {
10-
const F: u32 = 100 / U::X; //~ ERROR evaluation of `<std::string::String as Bar<std::string::String>>::F` failed
10+
const F: u32 = 100 / U::X; //~ ERROR evaluation of `<std::string::string::String as Bar<std::string::string::String>>::F` failed
1111
}
1212

1313
impl Foo for () {

tests/ui/consts/miri_unleashed/assoc_const_2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0080]: evaluation of `<std::string::String as Bar<std::string::String>>::F` failed
1+
error[E0080]: evaluation of `<std::string::string::String as Bar<std::string::string::String>>::F` failed
22
--> $DIR/assoc_const_2.rs:10:20
33
|
44
LL | const F: u32 = 100 / U::X;

tests/ui/deref-patterns/gate.stderr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ LL | match String::new() {
55
| ------------- this expression has type `String`
66
LL | "" | _ => {}
77
| ^^ expected `String`, found `&str`
8+
|
9+
= note: expected struct `String`
10+
found reference `&'static str`
811

912
error: aborting due to 1 previous error
1013

tests/ui/impl-trait/in-trait/default-body-type-err-2.stderr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ LL | 42
77
| ^^- help: try using a conversion method: `.to_string()`
88
| |
99
| expected `String`, found integer
10+
|
11+
= note: expected struct `String`
12+
found type `{integer}`
1013

1114
error: aborting due to 1 previous error
1215

tests/ui/impl-trait/in-trait/default-body-type-err.stderr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ LL | fn lol(&self) -> impl Deref<Target = String> {
66
LL |
77
LL | &1i32
88
| ----- return type was inferred to be `&i32` here
9+
|
10+
= note: expected struct `String`
11+
found type `i32`
912

1013
error: aborting due to 1 previous error
1114

tests/ui/inference/deref-suggestion.stderr

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LL | foo(s);
77
| | expected `String`, found `&String`
88
| arguments to this function are incorrect
99
|
10+
= note: expected struct `String`
11+
found reference `&String`
1012
note: function defined here
1113
--> $DIR/deref-suggestion.rs:5:4
1214
|
@@ -39,6 +41,8 @@ LL | foo(&"aaa".to_owned());
3941
| |
4042
| arguments to this function are incorrect
4143
|
44+
= note: expected struct `String`
45+
found reference `&String`
4246
note: function defined here
4347
--> $DIR/deref-suggestion.rs:5:4
4448
|
@@ -58,6 +62,8 @@ LL | foo(&mut "aaa".to_owned());
5862
| |
5963
| arguments to this function are incorrect
6064
|
65+
= note: expected struct `String`
66+
found mutable reference `&mut String`
6167
note: function defined here
6268
--> $DIR/deref-suggestion.rs:5:4
6369
|

tests/ui/inference/issue-71732.stderr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ 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<str> for String;
10+
- impl<A> Borrow<str> for String<A>
11+
where A: Allocator;
1112
- impl<T> Borrow<T> for T
1213
where T: ?Sized;
1314
note: required by a bound in `HashMap::<K, V, S>::get`

tests/ui/inference/issue-72616.stderr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ LL | if String::from("a") == "a".try_into().unwrap() {}
88
|
99
= note: cannot satisfy `String: PartialEq<_>`
1010
= help: the following types implement trait `PartialEq<Rhs>`:
11-
`String` implements `PartialEq<&str>`
1211
`String` implements `PartialEq<ByteStr>`
1312
`String` implements `PartialEq<ByteString>`
14-
`String` implements `PartialEq<Cow<'_, str>>`
15-
`String` implements `PartialEq<str>`
16-
`String` implements `PartialEq`
1713
help: try using a fully qualified path to specify the expected types
1814
|
1915
LL | if String::from("a") == <&str as TryInto<T>>::try_into("a").unwrap() {}

tests/ui/issues/issue-53348.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ fn main() {
1010
a = *i.to_string();
1111
//~^ ERROR mismatched types
1212
//~| NOTE expected `String`, found `str`
13+
//~| NOTE expected struct `String`
1314
v2.push(a);
1415
}
1516
}

tests/ui/issues/issue-53348.stderr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ LL | let mut a = String::new();
66
LL | for i in v {
77
LL | a = *i.to_string();
88
| ^^^^^^^^^^^^^^ expected `String`, found `str`
9+
|
10+
= note: expected struct `String`
11+
found type `str`
912

1013
error: aborting due to 1 previous error
1114

tests/ui/issues/issue-61106.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ LL | foo(x.clone());
66
| |
77
| arguments to this function are incorrect
88
|
9+
= note: expected reference `&str`
10+
found struct `String`
911
note: function defined here
1012
--> $DIR/issue-61106.rs:6:4
1113
|

0 commit comments

Comments
 (0)