Skip to content

Commit

Permalink
Deny overflowing (and lossy) integer type cast operations
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsemakula committed Jan 8, 2025
1 parent 712c3ab commit b616ea5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,12 @@ fn exec_cargo_clippy(crate_metadata: &CrateMetadata, verbosity: Verbosity) -> Re
"--all-features",
// customize clippy lints after the "--"
"--",
// this is a hard error because we want to guarantee that implicit overflows
// never happen
// these are hard errors because we want to guarantee that implicit overflows
// and lossy integer conversions never happen
"-Dclippy::arithmetic_side_effects",
"-Dclippy::cast_possible_truncation",
"-Dclippy::cast_possible_wrap",
"-Dclippy::cast_sign_loss",
];
// we execute clippy with the plain manifest no temp dir required
execute_cargo(util::cargo_cmd(
Expand Down

0 comments on commit b616ea5

Please sign in to comment.