From 159e27aebb940926ccf1bad0b2b12087d36ad903 Mon Sep 17 00:00:00 2001 From: Cameron Zwarich Date: Fri, 13 Jun 2014 20:48:09 -0700 Subject: Fix all violations of stronger guarantees for mutable borrows Fix all violations in the Rust source tree of the stronger guarantee of a unique access path for mutable borrows as described in #12624. --- src/libdebug/repr.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libdebug') diff --git a/src/libdebug/repr.rs b/src/libdebug/repr.rs index 86b71eb5b8d..83eb4adfa97 100644 --- a/src/libdebug/repr.rs +++ b/src/libdebug/repr.rs @@ -127,13 +127,15 @@ impl<'a> ReprVisitor<'a> { #[inline] pub fn get(&mut self, f: |&mut ReprVisitor, &T| -> bool) -> bool { unsafe { - f(self, mem::transmute::<*u8,&T>(self.ptr)) + let ptr = self.ptr; + f(self, mem::transmute::<*u8,&T>(ptr)) } } #[inline] pub fn visit_inner(&mut self, inner: *TyDesc) -> bool { - self.visit_ptr_inner(self.ptr, inner) + let ptr = self.ptr; + self.visit_ptr_inner(ptr, inner) } #[inline] -- cgit 1.4.1-3-g733a5