Repository navigation
Conversation
Clippy 1.99 added the pedantic `assert_is_empty` lint (23 errors) and clippy 1.100 extends `needless_bool` to an `if` that returns a bool literal ahead of the final one (1 error), so the Clippy CI job has failed on every run since 7 October. - Rewrite `assert!(x.is_empty())` as `assert_eq!(x, [] as [T; 0])`, and the negated form as `assert_ne!`, so a failing test prints the value. `cargo clippy --fix` suggests a crate-relative path such as `tree::NodeId` that is not in scope, so these were applied by hand. - Return `*token != Token::Eof` directly at the end of `should_use_foreign_content_rules`. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 19, 2026
Owner
|
Thanks so much for this, @dkam, and for taking the time to track down the clippy 1.100 findings! It turns out these exact lints were fixed on main in 45959dc ( |
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.
Summary
The Clippy job has failed on every CI run since 7 October, including Dependabot PRs such as #73:
assert_is_emptylint, which fires 23 times in tests.needless_boolto oneifin the HTML5 tree builder.This PR fixes all 24 without allowing either lint:
assert!(x.is_empty())becomesassert_eq!(x, [] as [T; 0]), andassert!(!x.is_empty())becomesassert_ne!. A failing test now prints the value, which is what the lint is for.cargo clippy --fixcan't make these changes itself: it suggests crate-relative paths such astree::NodeIdthat aren't in scope in the test modules, so I applied them by hand.should_use_foreign_content_rulesnow returns*token != Token::Eofinstead ofif … { return false; } true.All but that last expression are test changes. There is no behaviour change.
Type of Change
Test Plan
Each of the CI jobs was run locally on macOS (aarch64):
cargo fmt --all -- --check: passescargo clippy --all-targets --all-features -- -D warningson 1.100.0: passes (24 errors before this PR)cargo test --all-featureson 1.100.0: passes, including the html5lib, libxml2-compat and W3C suitescargo test --features cli,ffion 1.81.0: passesRUSTDOCFLAGS="-D warnings" cargo doc --all-features --no-deps: passesChecklist
cargo fmt --all)cargo clippy --all-targets --all-features -- -D warnings)cargo test --all-features)<module>: <summary>convention🤖 Generated with Claude Code