Skip to content
Permalink
Browse files

Expand test

  • Loading branch information...
estebank committed Mar 27, 2019
1 parent 4e7ec07 commit a51ca0268d0b130cbe3ef4a2dd0024d6d136e3fb
Showing with 30 additions and 2 deletions.
  1. +4 −0 src/test/ui/deref-suggestion.rs
  2. +26 −2 src/test/ui/deref-suggestion.stderr
@@ -38,7 +38,11 @@ fn main() {
let u = 3;
let s = S { u };
//~^ ERROR mismatched types
let s = S { u: u };
//~^ ERROR mismatched types
let i = &4;
let r = R { i };
//~^ ERROR mismatched types
let r = R { i: i };
//~^ ERROR mismatched types
}
@@ -81,7 +81,19 @@ LL | let s = S { u };
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/deref-suggestion.rs:42:17
--> $DIR/deref-suggestion.rs:41:20
|
LL | let s = S { u: u };
| ^
| |
| expected &u32, found integer
| help: consider borrowing here: `&u`
|
= note: expected type `&u32`
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/deref-suggestion.rs:44:17
|
LL | let r = R { i };
| ^
@@ -92,6 +104,18 @@ LL | let r = R { i };
= note: expected type `u32`
found type `&{integer}`

error: aborting due to 8 previous errors
error[E0308]: mismatched types
--> $DIR/deref-suggestion.rs:46:20
|
LL | let r = R { i: i };
| ^
| |
| expected u32, found &{integer}
| help: consider dereferencing the borrow: `*i`
|
= note: expected type `u32`
found type `&{integer}`

error: aborting due to 10 previous errors

For more information about this error, try `rustc --explain E0308`.

0 comments on commit a51ca02

Please sign in to comment.
You can’t perform that action at this time.