]> git.lizzy.rs Git - rust.git/commitdiff
trans/datum -- move mutable variable into closure
authorNiko Matsakis <niko@alum.mit.edu>
Fri, 7 Feb 2014 19:43:05 +0000 (14:43 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Tue, 11 Feb 2014 21:55:23 +0000 (16:55 -0500)
src/librustc/middle/trans/datum.rs

index e7ebc2ef526c4bf5d77b483065185dddf4e2b4b5..329301efa5ebbfaf8f1891e0534c2f1c8c4c31e0 100644 (file)
@@ -480,9 +480,9 @@ pub fn to_rvalue_datum<'a>(self,
          * no cleanup scheduled).
          */
 
-        let mut bcx = bcx;
         self.match_kind(
             |l| {
+                let mut bcx = bcx;
                 match l.appropriate_rvalue_mode(bcx.ccx()) {
                     ByRef => {
                         let scratch = rvalue_scratch_datum(bcx, l.ty, name);