mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
--bless tests
This commit is contained in:
parent
260a840543
commit
5e39b35a2f
@ -66,7 +66,7 @@ fn main() {
|
||||
}
|
||||
|
||||
enum A {
|
||||
B { b: B},
|
||||
B { b: B },
|
||||
}
|
||||
|
||||
struct A2(B);
|
||||
@ -77,13 +77,12 @@ enum B {
|
||||
}
|
||||
|
||||
fn foo() {
|
||||
// We don't want to suggest `A::B(B::Fst)` here.
|
||||
let a: A = B::Fst;
|
||||
//~^ ERROR mismatched types
|
||||
//~| HELP try wrapping
|
||||
}
|
||||
|
||||
fn bar() {
|
||||
// But we _do_ want to suggest `A2(B::Fst)` here!
|
||||
let a: A2 = B::Fst;
|
||||
//~^ ERROR mismatched types
|
||||
//~| HELP try wrapping
|
||||
|
@ -191,15 +191,20 @@ LL | let _ = Foo { bar: Some(bar) };
|
||||
| ++++++++++ +
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/compatible-variants.rs:81:16
|
||||
--> $DIR/compatible-variants.rs:80:16
|
||||
|
|
||||
LL | let a: A = B::Fst;
|
||||
| - ^^^^^^ expected enum `A`, found enum `B`
|
||||
| |
|
||||
| expected due to this
|
||||
|
|
||||
help: try wrapping the expression in `A::B`
|
||||
|
|
||||
LL | let a: A = A::B { b: B::Fst };
|
||||
| +++++++++ +
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/compatible-variants.rs:87:17
|
||||
--> $DIR/compatible-variants.rs:86:17
|
||||
|
|
||||
LL | let a: A2 = B::Fst;
|
||||
| -- ^^^^^^ expected struct `A2`, found enum `B`
|
||||
|
@ -26,4 +26,5 @@ struct Context { wrapper: Wrapper }
|
||||
fn overton() {
|
||||
let _c = Context { wrapper: Payload{} };
|
||||
//~^ ERROR mismatched types
|
||||
//~| try wrapping the expression in `Wrapper`
|
||||
}
|
||||
|
@ -25,6 +25,11 @@ error[E0308]: mismatched types
|
||||
|
|
||||
LL | let _c = Context { wrapper: Payload{} };
|
||||
| ^^^^^^^^^ expected struct `Wrapper`, found struct `Payload`
|
||||
|
|
||||
help: try wrapping the expression in `Wrapper`
|
||||
|
|
||||
LL | let _c = Context { wrapper: Wrapper { payload: Payload{} } };
|
||||
| ++++++++++++++++++ +
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user