Don't make "fake" match variables mutable

This commit is contained in:
Matthew Jasper 2018-07-28 21:18:34 +01:00
parent 26e73dabeb
commit 173c33019e
2 changed files with 17 additions and 2 deletions

View file

@ -55,10 +55,19 @@ fn parse_dot_or_call_expr_with(mut attrs: Vec<u32>) {
);
}
// Found when trying to bootstrap rustc
fn if_guard(x: Result<i32, i32>) {
match x {
Ok(mut r) | Err(mut r) if true => r = 1,
_ => (),
}
}
fn main() {
ref_argument(0);
mutable_upvar();
generator_mutable_upvar();
ref_closure_argument();
parse_dot_or_call_expr_with(Vec::new());
if_guard(Ok(0));
}