Skip to content

Commit e54c5a9

Browse files
authored
Wrap rhs in ident function
1 parent 256cf86 commit e54c5a9

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/test/run-pass/const-int-conversion.rs

+11-7
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@ const TO_BE_BYTES: [u8; 4] = 0x12_34_56_78_i32.to_be_bytes();
1818
const TO_LE_BYTES: [u8; 4] = 0x12_34_56_78_i32.to_le_bytes();
1919
const TO_NE_BYTES: [u8; 4] = i32::min_value().to_be().to_ne_bytes();
2020

21+
fn ident<T>(ident: T) -> T {
22+
ident
23+
}
24+
2125
fn main() {
22-
assert_eq!(REVERSE, 0x1e6a2c48);
23-
assert_eq!(FROM_BE_BYTES, 0x12_34_56_78);
24-
assert_eq!(FROM_LE_BYTES, 0x78_56_34_12);
25-
assert_eq!(FROM_NE_BYTES, i32::min_value());
26-
assert_eq!(TO_BE_BYTES, [0x12, 0x34, 0x56, 0x78]);
27-
assert_eq!(TO_LE_BYTES, [0x78, 0x56, 0x34, 0x12]);
28-
assert_eq!(TO_NE_BYTES, [0x80, 0, 0, 0]);
26+
assert_eq!(REVERSE, ident(0x1e6a2c48));
27+
assert_eq!(FROM_BE_BYTES, ident(0x12_34_56_78));
28+
assert_eq!(FROM_LE_BYTES, ident(0x78_56_34_12));
29+
assert_eq!(FROM_NE_BYTES, ident(i32::min_value()));
30+
assert_eq!(TO_BE_BYTES, ident([0x12, 0x34, 0x56, 0x78]));
31+
assert_eq!(TO_LE_BYTES, ident([0x78, 0x56, 0x34, 0x12]));
32+
assert_eq!(TO_NE_BYTES, ident([0x80, 0, 0, 0]));
2933
}
3034

0 commit comments

Comments
 (0)