We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98edaea commit 6ffc20fCopy full SHA for 6ffc20f
src/librustc_mir/borrow_check/place_ext.rs
@@ -57,7 +57,7 @@ impl<'tcx> PlaceExt<'tcx> for Place<'tcx> {
57
58
if *elem == ProjectionElem::Deref {
59
let ty = Place::ty_from(&self.base, proj_base, body, tcx).ty;
60
- match ty.sty {
+ if let ty::RawPtr(..) | ty::Ref(_, _, hir::MutImmutable) = ty.sty {
61
// For both derefs of raw pointers and `&T`
62
// references, the original path is `Copy` and
63
// therefore not significant. In particular,
@@ -68,8 +68,7 @@ impl<'tcx> PlaceExt<'tcx> for Place<'tcx> {
68
// original path into a new variable and
69
// borrowed *that* one, leaving the original
70
// path unborrowed.
71
- ty::RawPtr(..) | ty::Ref(_, _, hir::MutImmutable) => return true,
72
- _ => {}
+ return true;
73
}
74
75
0 commit comments