You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--quality-delta reports Drop::drop as dead code: the compiler calls it at scope end #494
ripwire: 0.6.9 (Release, GNU 14.2.1) Verb:--quality-delta
What happens
impl Drop for T { fn drop(&mut self) { … } } is called by the compiler when a T goes out of scope. No source line names drop, so the index has no edge to it, and the method is listed as dead code.
A plain method that nobody calls would be reported, and it should be. The difference is that the caller of Drop::drop is implicit, and nothing in the index records it.
Why it matters
A guard type that cleans up in Drop is the usual way to make cleanup run on every exit path, including when a future is cancelled. The obvious workaround, an explicit cleanup call, does not run when the future is dropped mid-way. So the row cannot be fixed on the user side without a weaker design. It does not gate, but it shows up on every project that uses a cleanup guard.
Expected
drop in an impl Drop for … block counts as called, the way Python hooks and framework entry points are already excluded from --quality-delta's dead-code rows (PR #437, closing #228).
Fix in #500. It exempts a Rust drop method, which the compiler runs at scope exit, through a Rust-only LangFacts column, and adds section 2b to test/qddialscheck.sh. The arm is red on main and green on the branch.
Activity
zom-2018 commentedon Nov 1, 2026
Fix in #500. It exempts a Rust
dropmethod, which the compiler runs at scope exit, through a Rust-only LangFacts column, and adds section 2b totest/qddialscheck.sh. The arm is red on main and green on the branch.docs(quality): name the open redhat-et#494 bump v27 in the scheme his…
fix(quality): Rust r#drop is Drop::drop; a module-level drop is a fre…
fix(quality): kQSnapCacheScheme 26 -> 27 for redhat-et#494 (redhat-et…
fix(quality): revert the tags.scm route for redhat-et#494, keep main'…
fix(quality): exempt Rust drop only as a method of an impl Drop block (…
docs(quality): state the Rust Drop exemption's containment floor (red…
docs(changelog): say what the redhat-et#494 Drop exemption covers now…