diff --git a/src/test/auxiliary/issue_8401.rs b/src/test/auxiliary/issue_8401.rs index 04b56442d0b8f..40e01c1474a60 100644 --- a/src/test/auxiliary/issue_8401.rs +++ b/src/test/auxiliary/issue_8401.rs @@ -21,6 +21,6 @@ impl A for B {} fn bar(_: &mut A, _: &T) {} fn foo(t: &T) { - let b = B; - bar(unsafe { mem::transmute(&b as &A) }, t) + let mut b = B; + bar(&mut b as &mut A, t) } diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index a0f18d9f7f1c2..1a139bdf0fb27 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -170,7 +170,7 @@ pub mod pipes { unsafe { if self.p != None { let self_p: &mut Option<*const packet> = - mem::transmute(&self.p); + mem::transmute(&mut self.p); let p = replace(self_p, None); sender_terminate(p.unwrap()) } @@ -199,7 +199,7 @@ pub mod pipes { unsafe { if self.p != None { let self_p: &mut Option<*const packet> = - mem::transmute(&self.p); + mem::transmute(&mut self.p); let p = replace(self_p, None); receiver_terminate(p.unwrap()) }