Skip to content

Commit

Permalink
fix transmute-from-fn-item-types-lint
Browse files Browse the repository at this point in the history
This test was relying on buggy behavior.
  • Loading branch information
nikomatsakis committed Apr 21, 2016
1 parent 906cc48 commit 399149a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/test/compile-fail/transmute-from-fn-item-types-lint.rs
Expand Up @@ -15,27 +15,27 @@ use std::mem;
unsafe fn foo() -> (isize, *const (), Option<fn()>) {
let i = mem::transmute(bar);
//~^ ERROR is now zero-sized and has to be cast to a pointer before transmuting
//~^^ ERROR was previously accepted
//~^^ WARNING was previously accepted

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

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

(i, p, of)
}

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

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

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

0 comments on commit 399149a

Please sign in to comment.