Skip to content

Commit 399149a

Browse files
committed
fix transmute-from-fn-item-types-lint
This test was relying on buggy behavior.
1 parent 906cc48 commit 399149a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/test/compile-fail/transmute-from-fn-item-types-lint.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@ use std::mem;
1515
unsafe fn foo() -> (isize, *const (), Option<fn()>) {
1616
let i = mem::transmute(bar);
1717
//~^ ERROR is now zero-sized and has to be cast to a pointer before transmuting
18-
//~^^ ERROR was previously accepted
18+
//~^^ WARNING was previously accepted
1919

2020
let p = mem::transmute(foo);
2121
//~^ ERROR is now zero-sized and has to be cast to a pointer before transmuting
22-
//~^^ ERROR was previously accepted
22+
//~^^ WARNING was previously accepted
2323

2424
let of = mem::transmute(main);
2525
//~^ ERROR is now zero-sized and has to be cast to a pointer before transmuting
26-
//~^^ ERROR was previously accepted
26+
//~^^ WARNING was previously accepted
2727

2828
(i, p, of)
2929
}
3030

3131
unsafe fn bar() {
3232
mem::transmute::<_, *mut ()>(foo);
3333
//~^ ERROR is now zero-sized and has to be cast to a pointer before transmuting
34-
//~^^ ERROR was previously accepted
34+
//~^^ WARNING was previously accepted
3535

3636
mem::transmute::<_, fn()>(bar);
3737
//~^ ERROR is now zero-sized and has to be cast to a pointer before transmuting
38-
//~^^ ERROR was previously accepted
38+
//~^^ WARNING was previously accepted
3939

4040
// No error if a coercion would otherwise occur.
4141
mem::transmute::<fn(), usize>(main);

0 commit comments

Comments
 (0)