We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97f88f5 commit 73264f2Copy full SHA for 73264f2
compiler/rustc_mir_transform/src/deduce_param_attrs.rs
@@ -47,7 +47,10 @@ impl<'tcx> Visitor<'tcx> for DeduceReadOnly {
47
// Dereference is not a mutation.
48
_ if place.is_indirect_first_projection() => {}
49
// This is a `Drop`. It could disappear at monomorphization, so mark it specially.
50
- PlaceContext::MutatingUse(MutatingUseContext::Drop) => {
+ PlaceContext::MutatingUse(MutatingUseContext::Drop)
51
+ // Projection changes the place's type, so `needs_drop(local.ty)` is not
52
+ // `needs_drop(place.ty)`.
53
+ if place.projection.is_empty() => {
54
self.read_only[param_index] |= DeducedReadOnlyParam::IF_NO_DROP;
55
}
56
// This is a mutation, so mark it as such.
0 commit comments