Skip to content

Commit

Permalink
Merge #267
Browse files Browse the repository at this point in the history
267: Allow `arithmetic_overflow` lint in a cast test r=cuviper a=cuviper

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.


Co-authored-by: Josh Stone <cuviper@gmail.com>
  • Loading branch information
bors[bot] and cuviper committed Apr 12, 2023
2 parents b5906ee + 7cc8d46 commit 8ba2458
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/cast.rs
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 8ba2458

Please sign in to comment.