]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/borrow_check/error_reporting.rs
Move def_id out add substsref
[rust.git] / src / librustc_mir / borrow_check / error_reporting.rs
index c767279dd8c7abad2b852e87174b9b0d33a9d2b2..251d4b727c7544b35427d1b81e5e3e8db6bfd809 100644 (file)
@@ -159,7 +159,7 @@ fn append_place_to_string(
             PlaceRef {
                 base:
                     PlaceBase::Static(box Static {
-                        kind: StaticKind::Promoted(_),
+                        kind: StaticKind::Promoted(..),
                         ..
                     }),
                 projection: None,
@@ -169,7 +169,8 @@ fn append_place_to_string(
             PlaceRef {
                 base:
                     PlaceBase::Static(box Static {
-                        kind: StaticKind::Static(def_id),
+                        kind: StaticKind::Static,
+                        def_id,
                         ..
                     }),
                 projection: None,
@@ -177,7 +178,7 @@ fn append_place_to_string(
                 buf.push_str(&self.infcx.tcx.item_name(*def_id).to_string());
             }
             PlaceRef {
-                ref base,
+                base,
                 projection: Some(ref proj),
             } => {
                 match proj.elem {
@@ -197,7 +198,7 @@ fn append_place_to_string(
                                 // FIXME turn this recursion into iteration
                                 self.append_place_to_string(
                                     PlaceRef {
-                                        base: &base,
+                                        base,
                                         projection: &proj.base,
                                     },
                                     buf,
@@ -210,7 +211,7 @@ fn append_place_to_string(
                                         if self.body.local_decls[*local].is_ref_for_guard() {
                                             self.append_place_to_string(
                                                 PlaceRef {
-                                                    base: &base,
+                                                    base,
                                                     projection: &proj.base,
                                                 },
                                                 buf,
@@ -222,7 +223,7 @@ fn append_place_to_string(
                                             buf.push_str(&"*");
                                             self.append_place_to_string(
                                                 PlaceRef {
-                                                    base: &base,
+                                                    base,
                                                     projection: &proj.base,
                                                 },
                                                 buf,
@@ -236,7 +237,7 @@ fn append_place_to_string(
                                         buf.push_str(&"*");
                                         self.append_place_to_string(
                                             PlaceRef {
-                                                base: &base,
+                                                base,
                                                 projection: &proj.base,
                                             },
                                             buf,
@@ -251,7 +252,7 @@ fn append_place_to_string(
                     ProjectionElem::Downcast(..) => {
                         self.append_place_to_string(
                             PlaceRef {
-                                base: &base,
+                                base,
                                 projection: &proj.base,
                             },
                             buf,
@@ -273,12 +274,12 @@ fn append_place_to_string(
                             buf.push_str(&name);
                         } else {
                             let field_name = self.describe_field(PlaceRef {
-                                base: base,
+                                base,
                                 projection: &proj.base,
                             }, field);
                             self.append_place_to_string(
                                 PlaceRef {
-                                    base: &base,
+                                    base,
                                     projection: &proj.base,
                                 },
                                 buf,
@@ -293,7 +294,7 @@ fn append_place_to_string(
 
                         self.append_place_to_string(
                             PlaceRef {
-                                base: &base,
+                                base,
                                 projection: &proj.base,
                             },
                             buf,
@@ -313,7 +314,7 @@ fn append_place_to_string(
                         // to avoid confusing the end-user
                         self.append_place_to_string(
                             PlaceRef {
-                                base: &base,
+                                base,
                                 projection: &proj.base,
                             },
                             buf,
@@ -440,7 +441,8 @@ fn describe_field_from_ty(
     pub fn is_place_thread_local(&self, place_ref: PlaceRef<'cx, 'tcx>) -> bool {
         if let PlaceRef {
             base: PlaceBase::Static(box Static {
-                kind: StaticKind::Static(def_id),
+                kind: StaticKind::Static,
+                def_id,
                 ..
             }),
             projection: None,