Skip to content

mirth-lab lint-check: lint oracles (check 16); findings 33-36 - #35

Merged
zmaril merged 1 commit into
mainfrom
mirth/check-lints
Oct 10, 2026
Merged

zmaril merged 1 commit into
mainfrom
mirth/check-lints

Conversation

@zmaril

@zmaril zmaril commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Check 16 of docs/checks.md (lint oracles), as mirth-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: adds #![allow(lint)]; only that lint's warnings may change.
  • delete: removes what dead_code, unreachable_patterns, unreachable_code and unused_extern_crates flag. The result must still compile and, for run-pass tests, print the same output.
  • premise: rewrites to what the lint says is equivalent:
    • trivial_casts goes through a coercion site;
    • trivial_numeric_casts drops the cast;
    • the wide-pointer comparison lint's operands go through a const assertion that they are two words (#163840);
    • missing_copy_implementations gets an impl Copy.
  • widen-fix: applies the machine-applicable fixes of allow-by-default lints, which suggest-diff never sees, alone and then all of a lint's fixes together.

Edits are located with syn (span-locations). Failures that the lint's design or the edit explains are recorded per test as expected, 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.md and docs/hunt/lint-check.md, with reductions in docs/hunt/tests/lint-check/. Facts only.

  • 33: let_underscore_drop fires on let _ = 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 fix skips alternative suggestions (#104910).
  • 34: lifetime-lint fixes that change meaning. A single_use_lifetimes fix moves #[may_dangle] to the next parameter and still compiles. A '_ fix gives E0637. An unused_lifetimes fix removes a for<'a> that kept a bound from being checked.
  • 35: dead_code reports 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).
  • 36: trivial_numeric_casts warns on 5 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

… 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
@zmaril
zmaril merged commit bfe2524 into main Oct 10, 2026
0 of 3 checks passed
@zmaril

zmaril commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

Merged into main together with #33–#38; renumbered at merge so finding numbers are unique: findings 33–36 are now 40–43 (docs/hunt.md).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant