librustc: Properly tag upvars in proc's to stop misleading unused_mut warnings.
This commit is contained in:
parent
36789fbbc5
commit
30ab05aeb5
|
@ -70,18 +70,19 @@ impl<'a> RestrictionsContext<'a> {
|
|||
mc::cat_arg(local_id) => {
|
||||
// R-Variable, locally declared
|
||||
let lp = Rc::new(LpVar(local_id));
|
||||
SafeIf(lp.clone(), vec!(lp))
|
||||
SafeIf(lp.clone(), vec![lp])
|
||||
}
|
||||
|
||||
mc::cat_upvar(upvar_id, _) => {
|
||||
// R-Variable, captured into closure
|
||||
let lp = Rc::new(LpUpvar(upvar_id));
|
||||
SafeIf(lp.clone(), vec!(lp))
|
||||
SafeIf(lp.clone(), vec![lp])
|
||||
}
|
||||
|
||||
mc::cat_copied_upvar(..) => {
|
||||
// FIXME(#2152) allow mutation of upvars
|
||||
Safe
|
||||
mc::cat_copied_upvar(mc::CopiedUpvar { upvar_id, .. }) => {
|
||||
// R-Variable, copied/moved into closure
|
||||
let lp = Rc::new(LpVar(upvar_id));
|
||||
SafeIf(lp.clone(), vec![lp])
|
||||
}
|
||||
|
||||
mc::cat_downcast(cmt_base) => {
|
||||
|
|
Loading…
Reference in New Issue