test: update run-pass tests to not use mutable transmuting

This commit is contained in:
Sean McArthur 2015-05-05 11:40:41 -07:00
parent e136f93d0f
commit 5624cfbdda
2 changed files with 4 additions and 4 deletions

View File

@ -21,6 +21,6 @@ impl A for B {}
fn bar<T>(_: &mut A, _: &T) {}
fn foo<T>(t: &T) {
let b = B;
bar(unsafe { mem::transmute(&b as &A) }, t)
let mut b = B;
bar(&mut b as &mut A, t)
}

View File

@ -170,7 +170,7 @@ pub mod pipes {
unsafe {
if self.p != None {
let self_p: &mut Option<*const packet<T>> =
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<T>> =
mem::transmute(&self.p);
mem::transmute(&mut self.p);
let p = replace(self_p, None);
receiver_terminate(p.unwrap())
}