2016-08-27 02:44:46 -05:00
|
|
|
fn main() {
|
2016-06-14 03:34:54 -05:00
|
|
|
fn f() {}
|
|
|
|
|
2016-07-06 10:55:05 -05:00
|
|
|
let g = unsafe {
|
2016-06-14 03:34:54 -05:00
|
|
|
std::mem::transmute::<fn(), fn(i32)>(f)
|
|
|
|
};
|
|
|
|
|
2018-07-15 04:21:56 -05:00
|
|
|
g(42) //~ ERROR constant evaluation error
|
2018-05-09 10:45:16 -05:00
|
|
|
//~^ NOTE tried to call a function with sig fn() through a function pointer of type fn(i32)
|
2016-06-14 03:34:54 -05:00
|
|
|
}
|