Skip to content

Commit

Permalink
Allow arithmetic_overflow lint in a cast test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cuviper committed Apr 12, 2023
1 parent b5906ee commit 7cc8d46
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ fn cast_float_to_i128_edge_cases() {

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

Expand Down

0 comments on commit 7cc8d46

Please sign in to comment.