librustc: Properly tag upvars in proc's to stop misleading unused_mut warnings.

This commit is contained in:
Luqman Aden 2014-08-22 10:10:29 -07:00
parent 36789fbbc5
commit 30ab05aeb5
1 changed files with 6 additions and 5 deletions

View File

@ -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) => {