Skip to content

Commit 8f7b6e0

Browse files
authored
Unrolled build for rust-lang#117385
Rollup merge of rust-lang#117385 - RalfJung:deduce_param_attrs, r=oli-obk deduce_param_attrs: explain a read-only case This takes the discussion [here](https://github.com/rust-lang/rust/pull/111517/files#r1243443625) and adds it as comment in the code. Cc `@lukas-code`
2 parents 91bbdd9 + 3f7e506 commit 8f7b6e0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_mir_transform/src/deduce_param_attrs.rs

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ impl<'tcx> Visitor<'tcx> for DeduceReadOnly {
4444
// Whether mutating though a `&raw const` is allowed is still undecided, so we
4545
// disable any sketchy `readonly` optimizations for now.
4646
// But we only need to do this if the pointer would point into the argument.
47+
// IOW: for indirect places, like `&raw (*local).field`, this surely cannot mutate `local`.
4748
!place.is_indirect()
4849
}
4950
PlaceContext::NonMutatingUse(..) | PlaceContext::NonUse(..) => {

0 commit comments

Comments
 (0)