From: bors Date: Wed, 28 Aug 2013 00:05:46 +0000 (-0700) Subject: auto merge of #8797 : nikomatsakis/rust/issue-8625-assign-to-andmut-in-borrowed-loc... X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=58d6eb50483c44ecc72db6d77b71ad5d5a7aca4d;p=rust.git auto merge of #8797 : nikomatsakis/rust/issue-8625-assign-to-andmut-in-borrowed-loc-2, r=pcwalton Fixes for #8625 to prevent assigning to `&mut` in borrowed or aliasable locations. The old code was insufficient in that it failed to catch bizarre cases like `& &mut &mut`. r? @pnkfelix --- 58d6eb50483c44ecc72db6d77b71ad5d5a7aca4d diff --cc src/librustc/middle/typeck/check/mod.rs index a839ea976e6,8f7d8ac186e..0c8f2229424 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@@ -3092,8 -3092,9 +3092,8 @@@ pub fn ty_param_bounds_and_ty_for_def(f sp: span, defn: ast::def) -> ty_param_bounds_and_ty { - match defn { - ast::def_arg(nid, _) | ast::def_local(nid, _) | ast::def_self(nid, _) | + ast::def_arg(nid, _) | ast::def_local(nid, _) | ast::def_self(nid) | ast::def_binding(nid, _) => { let typ = fcx.local_ty(sp, nid); return no_params(typ);