mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-05 01:24:03 +00:00
fix const_item_mutation lint to use needs_drop instead of has_dtor Description: The const_item_mutation lint was only checking if the outer type has a direct Drop impl (has_dtor). But if a field inside the type has a Drop impl, that drop logic can also observe the mutation — so the warning should be suppressed in that case too. This fixes a false positive where the lint would warn on code like: ```O.inner.val = 42;``` even when Inner has a Drop impl that prints the value — meaning the mutation IS observable and the warning is wrong. Fix: replace has_dtor check with needs_drop, which checks the whole type including all fields inside it.