Fix #33819 and update ui test
This commit is contained in:
parent
9e5574803f
commit
428099233a
3 changed files with 16 additions and 1 deletions
9
src/test/compile-fail/issue-33819.rs
Normal file
9
src/test/compile-fail/issue-33819.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
fn main() {
|
||||
let mut op = Some(2);
|
||||
match op {
|
||||
Some(ref v) => { let a = &mut v; },
|
||||
//~^ ERROR:cannot borrow immutable
|
||||
//~| use `ref mut v` here to make mutable
|
||||
None => {},
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
error: mismatched types [--explain E0308]
|
||||
--> $DIR/main.rs:14:18
|
||||
|>
|
||||
14 |> let x: u32 = (
|
||||
|> ^ expected u32, found ()
|
||||
note: expected type `u32`
|
||||
note: found type `()`
|
||||
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue