]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mir/mir_cast_fn_ret.rs
Merge commit 'e18101137866b79045fee0ef996e696e68c920b4' into clippyup
[rust.git] / src / test / ui / mir / mir_cast_fn_ret.rs
1 // run-pass
2 #[allow(improper_ctypes_definitions)]
3 pub extern "C" fn tuple2() -> (u16, u8) {
4     (1, 2)
5 }
6
7 #[allow(improper_ctypes_definitions)]
8 pub extern "C" fn tuple3() -> (u8, u8, u8) {
9     (1, 2, 3)
10 }
11
12 pub fn test2() -> u8 {
13     tuple2().1
14 }
15
16 pub fn test3() -> u8 {
17     tuple3().2
18 }
19
20 fn main() {
21     assert_eq!(test2(), 2);
22     assert_eq!(test3(), 3);
23 }