]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/borrow_check/place_ext.rs
Move def_id out add substsref
[rust.git] / src / librustc_mir / borrow_check / place_ext.rs
index a8f28b64b4953e19103a6f3a16bf5f82d7f5106b..5caba637ccc4abf1b7473d32e478d0da0d69daca 100644 (file)
@@ -46,16 +46,16 @@ fn ignore_borrow(
                         }
                     }
                 }
-                PlaceBase::Static(box Static{ kind: StaticKind::Promoted(_), .. }) =>
+                PlaceBase::Static(box Static{ kind: StaticKind::Promoted(_, _), .. }) =>
                     false,
-                PlaceBase::Static(box Static{ kind: StaticKind::Static(def_id), .. }) => {
+                PlaceBase::Static(box Static{ kind: StaticKind::Static, def_id, .. }) => {
                     tcx.is_mutable_static(*def_id)
                 }
             };
 
             for proj in place_projection {
                 if proj.elem == ProjectionElem::Deref {
-                    let ty = proj.base.ty(body, tcx).ty;
+                    let ty = Place::ty_from(place_base, &proj.base, body, tcx).ty;
                     match ty.sty {
                         // For both derefs of raw pointers and `&T`
                         // references, the original path is `Copy` and