Skip to content

Commit 7cc8d46

Browse files
committed
Allow arithmetic_overflow lint in a cast test
The cast tests generate some code with branches that contain min/max operations that would overflow if they were reachable. Recent rustc changes have gotten more aggressive with const-propagation, causing that code to trigger the deny-by-default `arithmetic_overflow` lint, but we can explicitly allow it in this case.
1 parent b5906ee commit 7cc8d46

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tests/cast.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ fn cast_float_to_i128_edge_cases() {
241241

242242
macro_rules! int_test_edge {
243243
($f:ident -> { $($t:ident)+ } with $BigS:ident $BigU:ident ) => { $({
244+
#[allow(arithmetic_overflow)] // https://github.com/rust-lang/rust/issues/109731
244245
fn test_edge() {
245246
dbg!("testing cast edge cases for {} -> {}", stringify!($f), stringify!($t));
246247

0 commit comments

Comments
 (0)