Repository navigation
Lint workspace test targets in CI, and fix the one site that fails - #486
Merged
nihalpasham merged 1 commit intoJul 27, 2026
Merged
Conversation
`just clippy` runs `cargo clippy --all-targets --lib --tests -- -D warnings`
and fails on main:
error: the function `IntegerType::get` doesn't need a mutable reference
--> crates/mir-lower/src/convert/types.rs:2805:52
pliron's IntegerType::get takes &Context. Rust accepts the implicit
downgrade from &mut, clippy's unnecessary_mut_passed does not. Pass the
shared reference.
The clippy workflow runs three steps, and only the workspace one omits
--all-targets, so no workspace test target is linted there. Add it, which
matches the rustc-codegen-cuda step, the per-example loop and the local
recipe. The workspace is clean under it once the site above is fixed.
Closes NVIDIA#401.
Signed-off-by: Alejandro Soto Franco <[email protected]>
Collaborator
|
Thanks. Verified the Merging. |
nihalpasham
approved these changes
Jul 27, 2026
honeyspoon
added a commit
to honeyspoon/cuda-oxide
that referenced
this pull request
Jul 27, 2026
CI now lints test targets too (NVIDIA#486 added --all-targets), and the modulo checks in cast_chunks trip clippy::manual_is_multiple_of under it. No behaviour change. Signed-off-by: abder <[email protected]>
honeyspoon
added a commit
to honeyspoon/cuda-oxide
that referenced
this pull request
Jul 27, 2026
CI now lints test targets (NVIDIA#486). Three modulo checks trip clippy::manual_is_multiple_of and one nested if trips collapsible_if. No behaviour change; tests unchanged and still pass. Signed-off-by: abder <[email protected]>
honeyspoon
added a commit
to honeyspoon/cuda-oxide
that referenced
this pull request
Jul 27, 2026
CI now lints test targets (NVIDIA#486). Three modulo checks trip clippy::manual_is_multiple_of, one of them inside a test. No behaviour change. Signed-off-by: abder <[email protected]>
honeyspoon
added a commit
to honeyspoon/cuda-oxide
that referenced
this pull request
Jul 27, 2026
CI now lints test targets (NVIDIA#486), and the counterexample wrote the colliding pair as `0 * bad_period + 2 * n` against `1 * bad_period + 0 * n`, which trips clippy::erasing_op and clippy::identity_op. The literals were carrying meaning - they are the (k, t) digit pair - so suppressing the lint would have been the wrong fix. Routed through a small `at(k, t, period, n)` instead, which keeps the pair visible at each call and makes the two assertions read as the same expression under two periods. Same assertions, same numbers. Signed-off-by: abder <[email protected]>
honeyspoon
added a commit
to honeyspoon/cuda-oxide
that referenced
this pull request
Jul 27, 2026
CI now lints test targets (NVIDIA#486); the two ownership loops index a slice by range, which trips clippy::needless_range_loop. Iterating the subslice says the same thing more directly. Signed-off-by: abder <[email protected]>
1 of 3 tasks
honeyspoon
added a commit
to honeyspoon/cuda-oxide
that referenced
this pull request
Jul 27, 2026
CI now lints test targets (NVIDIA#486). Three modulo checks trip clippy::manual_is_multiple_of and one nested if trips collapsible_if. No behaviour change; tests unchanged and still pass. Signed-off-by: abder <[email protected]>
honeyspoon
added a commit
to honeyspoon/cuda-oxide
that referenced
this pull request
Jul 27, 2026
CI now lints test targets (NVIDIA#486). Three modulo checks trip clippy::manual_is_multiple_of, one of them inside a test. No behaviour change. Signed-off-by: abder <[email protected]>
honeyspoon
added a commit
to honeyspoon/cuda-oxide
that referenced
this pull request
Jul 27, 2026
CI now lints test targets too (NVIDIA#486 added --all-targets), and the modulo checks in cast_chunks trip clippy::manual_is_multiple_of under it. No behaviour change. Signed-off-by: abder <[email protected]>
This was referenced Jul 27, 2026
Closed
honeyspoon
added a commit
to honeyspoon/cuda-oxide
that referenced
this pull request
Jul 28, 2026
CI now lints test targets (NVIDIA#486). Three modulo checks trip clippy::manual_is_multiple_of and one nested if trips collapsible_if. No behaviour change; tests unchanged and still pass. Signed-off-by: abder <[email protected]>
honeyspoon
added a commit
to honeyspoon/cuda-oxide
that referenced
this pull request
Jul 28, 2026
CI now lints test targets (NVIDIA#486), and the counterexample wrote the colliding pair as `0 * bad_period + 2 * n` against `1 * bad_period + 0 * n`, which trips clippy::erasing_op and clippy::identity_op. The literals were carrying meaning - they are the (k, t) digit pair - so suppressing the lint would have been the wrong fix. Routed through a small `at(k, t, period, n)` instead, which keeps the pair visible at each call and makes the two assertions read as the same expression under two periods. Same assertions, same numbers. Signed-off-by: abder <[email protected]>
honeyspoon
added a commit
to honeyspoon/cuda-oxide
that referenced
this pull request
Jul 28, 2026
CI now lints test targets (NVIDIA#486); the two ownership loops index a slice by range, which trips clippy::needless_range_loop. Iterating the subslice says the same thing more directly. Signed-off-by: abder <[email protected]>
honeyspoon
added a commit
to honeyspoon/cuda-oxide
that referenced
this pull request
Jul 29, 2026
CI now lints test targets (NVIDIA#486), and the counterexample wrote the colliding pair as `0 * bad_period + 2 * n` against `1 * bad_period + 0 * n`, which trips clippy::erasing_op and clippy::identity_op. The literals were carrying meaning - they are the (k, t) digit pair - so suppressing the lint would have been the wrong fix. Routed through a small `at(k, t, period, n)` instead, which keeps the pair visible at each call and makes the two assertions read as the same expression under two periods. Same assertions, same numbers. Signed-off-by: abder <[email protected]>
honeyspoon
added a commit
to honeyspoon/cuda-oxide
that referenced
this pull request
Jul 29, 2026
CI now lints test targets (NVIDIA#486); the two ownership loops index a slice by range, which trips clippy::needless_range_loop. Iterating the subslice says the same thing more directly. Signed-off-by: abder <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #401
Summary
just clippyfails onmain:pliron's
IntegerType::gettakes&Context. Rust accepts the implicit downgrade from&mut, andclippy::unnecessary_mut_passeddoes not.Two changes, of slightly different kinds
They are separable, and I have put them together because each is a few lines and neither is much use alone. Say the word and I will split them.
A lint fix, one line in a
#[cfg(test)]module:A CI change, adding
--all-targetsto one workflow step. The clippy workflow runs three steps and only the first omits it:cargo clippy --workspace -- -D warningscargo clippy --all-targets -- -D warningscargo clippy --all-targets -- -D warningsSo no test target in a workspace crate is linted in CI. That is why this lint sat on
mainwhile failing for anyone running the local recipe, as #401 worked out when it was filed.The lint fix alone closes the issue. Without the CI change the next lint confined to a test target lands just as quietly, so the two belong in one commit.
Scope
crates/mir-lower/src/convert/types.rs:2805is the only site left in the workspace. The ten incrates/mir-lower/tests/lowering_test.rsthat #401 quoted are already gone, as @honeyspoon noted on the issue; this one is in a test module insidesrc/, which is a different file and still present.The CI step now compiles workspace test targets, so it costs more runner time than before.
unit-tests.ymlalready compiles test targets for most of these packages, and clippy checks without linking, so nothing new is needed on the runner beyond the toolkit the job already installs.Validation
Reverting only the one-line change reproduces the failure under both commands, so the workflow step does gate on it:
cargo oxide run <example>passescargo test --workspacepassesNo example added: this is a lint fix in a test module and a workflow flag. No device code changes.
Checklist
git commit -s)