Skip to content

Commit 1fcfba1

Browse files
seanmonstaralexcrichton
authored andcommitted
test: update run-pass tests to not use mutable transmuting
1 parent 8ed0997 commit 1fcfba1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/test/auxiliary/issue_8401.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ impl A for B {}
2121
fn bar<T>(_: &mut A, _: &T) {}
2222

2323
fn foo<T>(t: &T) {
24-
let b = B;
25-
bar(unsafe { mem::transmute(&b as &A) }, t)
24+
let mut b = B;
25+
bar(&mut b as &mut A, t)
2626
}

src/test/run-pass/issue-2718.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ pub mod pipes {
172172
unsafe {
173173
if self.p != None {
174174
let self_p: &mut Option<*const packet<T>> =
175-
mem::transmute(&self.p);
175+
mem::transmute(&mut self.p);
176176
let p = replace(self_p, None);
177177
sender_terminate(p.unwrap())
178178
}
@@ -202,7 +202,7 @@ pub mod pipes {
202202
unsafe {
203203
if self.p != None {
204204
let self_p: &mut Option<*const packet<T>> =
205-
mem::transmute(&self.p);
205+
mem::transmute(&mut self.p);
206206
let p = replace(self_p, None);
207207
receiver_terminate(p.unwrap())
208208
}

0 commit comments

Comments
 (0)