Rollup merge of #52810 - matthewjasper:more-immutablity, r=pnkfelix
[NLL] Don't make "fake" match variables mutable These variables can't be mutated by the user, but since they have names the unused-mut lint thinks that it should check them.
This commit is contained in:
commit
333d8c456c
2 changed files with 17 additions and 2 deletions
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue