Skip to content

Commit

Permalink
test: update run-pass tests to not use mutable transmuting
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed May 5, 2015
1 parent 8963872 commit 5b0d828
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/test/auxiliary/issue_8401.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
4 changes: 2 additions & 2 deletions src/test/run-pass/issue-2718.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down Expand Up @@ -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())
}
Expand Down

0 comments on commit 5b0d828

Please sign in to comment.