Skip to content

Commit fb3565a

Browse files
author
The Miri Conjob Bot
committed
fmt
1 parent 650294c commit fb3565a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/tools/miri/tests/pass/function_calls/abi_compat.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
use std::num;
21
use std::mem;
2+
use std::num;
33

44
fn test_abi_compat<T, U>(t: T, u: U) {
5-
fn id<T>(x: T) -> T { x }
6-
5+
fn id<T>(x: T) -> T {
6+
x
7+
}
8+
79
// This checks ABI compatibility both for arguments and return values,
810
// in both directions.
911
let f: fn(T) -> T = id;
1012
let f: fn(U) -> U = unsafe { std::mem::transmute(f) };
1113
drop(f(u));
12-
14+
1315
let f: fn(U) -> U = id;
1416
let f: fn(T) -> T = unsafe { std::mem::transmute(f) };
1517
drop(f(t));

0 commit comments

Comments
 (0)