Repository navigation
mirth-lab lint-check: lint oracles (check 16); findings 33-36 - #35
Merged
Merged
Conversation
… and fix oracles over the UI tests with allow-by-default lints on; findings 33-36 Swept 18,624 UI tests (8,055 compile without errors; 4,244 with a lint warning, 211 lints; 30,100 compilations). Findings: let_underscore_drop fires on places and its fixes break builds or move drops (33); lifetime-lint fixes that change meaning, including a #[may_dangle] that moves to the next parameter (34); dead_code on traits used only in live impls' bounds or self types (stable) and on an opaque type's defining function (35); trivial_numeric_casts on a cast that decides a literal's type (36). Known #110332 and #163369 reproduced. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QXiEXbESemwqMLYKaWLDbT
Contributor
Author
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.
Check 16 of
docs/checks.md(lint oracles), asmirth-lab lint-check.Property: a lint fires only when its premise holds, and acting on it changes nothing else. For every standalone UI test that compiles, with 16 allow-by-default lints turned on, and for each lint that warns, the check does four things:
#![allow(lint)]; only that lint's warnings may change.dead_code,unreachable_patterns,unreachable_codeandunused_extern_cratesflag. The result must still compile and, for run-pass tests, print the same output.trivial_castsgoes through a coercion site;trivial_numeric_castsdrops the cast;missing_copy_implementationsgets animpl Copy.Edits are located with syn (
span-locations). Failures that the lint's design or the edit explains are recorded per test asexpected, not as findings.Sweep: 18,624 UI tests. 8,055 compile without errors; 4,244 of those have a lint warning (211 lints in all); 30,100 compilations.
Findings: in
docs/hunt.mdanddocs/hunt/lint-check.md, with reductions indocs/hunt/tests/lint-check/. Facts only.let_underscore_dropfires onlet _ = place(nothing is dropped there), and its two fixes break builds or move drops: E0716, a lost type annotation, a lost#[coroutine], rewritten macro bodies. 26 UI tests. Low severity:cargo fixskips alternative suggestions (#104910).single_use_lifetimesfix moves#[may_dangle]to the next parameter and still compiles. A'_fix gives E0637. Anunused_lifetimesfix removes afor<'a>that kept a bound from being checked.dead_codereports a trait as "never used" when it appears only in the where-clause or self type of an impl whose methods are called (stable since at least 1.80.0). It also reports the#[define_opaque]function that is an opaque type's only defining use (nightly).trivial_numeric_castswarns on5 as i16, where the cast is what gives the literal its type.Known issues reproduced: #110332 and #163369.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QXiEXbESemwqMLYKaWLDbT