Rustup for https://github.com/rust-lang/rust/pull/61276
This commit is contained in:
@@ -16,7 +16,7 @@ pub fn mutated_variables<'a, 'tcx: 'a>(expr: &'tcx Expr, cx: &'a LateContext<'a,
|
||||
};
|
||||
let def_id = def_id::DefId::local(expr.hir_id.owner);
|
||||
let region_scope_tree = &cx.tcx.region_scope_tree(def_id);
|
||||
ExprUseVisitor::new(&mut delegate, cx.tcx, cx.param_env, region_scope_tree, cx.tables, None).walk_expr(expr);
|
||||
ExprUseVisitor::new(&mut delegate, cx.tcx, def_id, cx.param_env, region_scope_tree, cx.tables, None).walk_expr(expr);
|
||||
|
||||
if delegate.skip {
|
||||
return None;
|
||||
@@ -29,11 +29,11 @@ pub fn is_potentially_mutated<'a, 'tcx: 'a>(
|
||||
expr: &'tcx Expr,
|
||||
cx: &'a LateContext<'a, 'tcx>,
|
||||
) -> bool {
|
||||
let id = match variable.res {
|
||||
Res::Local(id) | Res::Upvar(id, ..) => id,
|
||||
_ => return true,
|
||||
};
|
||||
mutated_variables(expr, cx).map_or(true, |mutated| mutated.contains(&id))
|
||||
if let Res::Local(id) = variable.res {
|
||||
mutated_variables(expr, cx).map_or(true, |mutated| mutated.contains(&id))
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
struct MutVarsDelegate {
|
||||
|
||||
Reference in New Issue
Block a user