We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 650294c commit fb3565aCopy full SHA for fb3565a
src/tools/miri/tests/pass/function_calls/abi_compat.rs
@@ -1,15 +1,17 @@
1
-use std::num;
2
use std::mem;
+use std::num;
3
4
fn test_abi_compat<T, U>(t: T, u: U) {
5
- fn id<T>(x: T) -> T { x }
6
-
+ fn id<T>(x: T) -> T {
+ x
7
+ }
8
+
9
// This checks ABI compatibility both for arguments and return values,
10
// in both directions.
11
let f: fn(T) -> T = id;
12
let f: fn(U) -> U = unsafe { std::mem::transmute(f) };
13
drop(f(u));
14
15
let f: fn(U) -> U = id;
16
let f: fn(T) -> T = unsafe { std::mem::transmute(f) };
17
drop(f(t));
0 commit comments