test: update run-pass tests to not use mutable transmuting
This commit is contained in:
parent
e136f93d0f
commit
5624cfbdda
@ -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)
|
||||
}
|
||||
|
@ -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())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user