diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a7010f5f863e..43c0e2fe8cc59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,6 +162,7 @@ jobs: cache-key: clippy components: clippy - run: cargo lint -- -D warnings + - run: cargo lint --profile dev-no-debug-assertions -- -D warnings - name: Check Char and Byte Offset run: | npm i @ast-grep/cli -g diff --git a/Cargo.toml b/Cargo.toml index 7dad256f2d801..8951e0dce0494 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -247,3 +247,10 @@ codegen-units = 256 # Compile faster lto = "thin" # Faster compile time with thin LTO debug-assertions = true # Make sure `debug_assert!`s pass overflow-checks = true # Catch arithmetic overflow errors + +# Profile for linting with release mode-like settings. +# Catches lint errors which only appear in release mode. +# `cargo lint --profile dev-no-debug-assertions` is about 35% faster than `cargo lint --release`. +[profile.dev-no-debug-assertions] +inherits = "dev" +debug-assertions = false