File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
src/librustc_mir/borrow_check Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ impl<'tcx> PlaceExt<'tcx> for Place<'tcx> {
57
57
58
58
if * elem == ProjectionElem :: Deref {
59
59
let ty = Place :: ty_from ( & self . base , proj_base, body, tcx) . ty ;
60
- match ty. sty {
60
+ if let ty :: RawPtr ( .. ) | ty :: Ref ( _ , _ , hir :: MutImmutable ) = ty. sty {
61
61
// For both derefs of raw pointers and `&T`
62
62
// references, the original path is `Copy` and
63
63
// therefore not significant. In particular,
@@ -68,8 +68,7 @@ impl<'tcx> PlaceExt<'tcx> for Place<'tcx> {
68
68
// original path into a new variable and
69
69
// borrowed *that* one, leaving the original
70
70
// path unborrowed.
71
- ty:: RawPtr ( ..) | ty:: Ref ( _, _, hir:: MutImmutable ) => return true ,
72
- _ => { }
71
+ return true ;
73
72
}
74
73
}
75
74
}
You can’t perform that action at this time.
0 commit comments