Skip to content

Commit 5e39b35

Browse files
committed
--bless tests
1 parent 260a840 commit 5e39b35

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

src/test/ui/did_you_mean/compatible-variants.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn main() {
6666
}
6767

6868
enum A {
69-
B { b: B},
69+
B { b: B },
7070
}
7171

7272
struct A2(B);
@@ -77,13 +77,12 @@ enum B {
7777
}
7878

7979
fn foo() {
80-
// We don't want to suggest `A::B(B::Fst)` here.
8180
let a: A = B::Fst;
8281
//~^ ERROR mismatched types
82+
//~| HELP try wrapping
8383
}
8484

8585
fn bar() {
86-
// But we _do_ want to suggest `A2(B::Fst)` here!
8786
let a: A2 = B::Fst;
8887
//~^ ERROR mismatched types
8988
//~| HELP try wrapping

src/test/ui/did_you_mean/compatible-variants.stderr

+7-2
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,20 @@ LL | let _ = Foo { bar: Some(bar) };
191191
| ++++++++++ +
192192

193193
error[E0308]: mismatched types
194-
--> $DIR/compatible-variants.rs:81:16
194+
--> $DIR/compatible-variants.rs:80:16
195195
|
196196
LL | let a: A = B::Fst;
197197
| - ^^^^^^ expected enum `A`, found enum `B`
198198
| |
199199
| expected due to this
200+
|
201+
help: try wrapping the expression in `A::B`
202+
|
203+
LL | let a: A = A::B { b: B::Fst };
204+
| +++++++++ +
200205

201206
error[E0308]: mismatched types
202-
--> $DIR/compatible-variants.rs:87:17
207+
--> $DIR/compatible-variants.rs:86:17
203208
|
204209
LL | let a: A2 = B::Fst;
205210
| -- ^^^^^^ expected struct `A2`, found enum `B`

src/test/ui/did_you_mean/issue-42764.rs

+1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ struct Context { wrapper: Wrapper }
2626
fn overton() {
2727
let _c = Context { wrapper: Payload{} };
2828
//~^ ERROR mismatched types
29+
//~| try wrapping the expression in `Wrapper`
2930
}

src/test/ui/did_you_mean/issue-42764.stderr

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ error[E0308]: mismatched types
2525
|
2626
LL | let _c = Context { wrapper: Payload{} };
2727
| ^^^^^^^^^ expected struct `Wrapper`, found struct `Payload`
28+
|
29+
help: try wrapping the expression in `Wrapper`
30+
|
31+
LL | let _c = Context { wrapper: Wrapper { payload: Payload{} } };
32+
| ++++++++++++++++++ +
2833

2934
error: aborting due to 2 previous errors
3035

0 commit comments

Comments
 (0)