]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/mir/visit.rs
Remove StaticKind
[rust.git] / src / librustc / mir / visit.rs
index fa96b51347d350f0197e0ca6a006c2fd6de0d043..3924a1aa47edab17a3df8ec5c6296c6ebaefcd49 100644 (file)
@@ -1,7 +1,7 @@
+use crate::mir::*;
 use crate::ty::subst::SubstsRef;
 use crate::ty::{CanonicalUserTypeAnnotation, Ty};
-use crate::mir::*;
-use syntax_pos::Span;
+use rustc_span::Span;
 
 // # The MIR Visitor
 //
@@ -712,7 +712,7 @@ fn super_place_base(&mut self,
                     PlaceBase::Local(local) => {
                         self.visit_local(local, context, location);
                     }
-                    PlaceBase::Static(box Static { kind: _, ty, def_id: _ }) => {
+                    PlaceBase::Static(box Static { ty, def_id: _ }) => {
                         self.visit_ty(& $($mutability)? *ty, TyContext::Location(location));
                     }
                 }
@@ -978,29 +978,26 @@ fn super_projection_elem(
 }
 
 make_mir_visitor!(Visitor,);
-make_mir_visitor!(MutVisitor,mut);
+make_mir_visitor!(MutVisitor, mut);
 
 pub trait MirVisitable<'tcx> {
     fn apply(&self, location: Location, visitor: &mut dyn Visitor<'tcx>);
 }
 
 impl<'tcx> MirVisitable<'tcx> for Statement<'tcx> {
-    fn apply(&self, location: Location, visitor: &mut dyn Visitor<'tcx>)
-    {
+    fn apply(&self, location: Location, visitor: &mut dyn Visitor<'tcx>) {
         visitor.visit_statement(self, location)
     }
 }
 
 impl<'tcx> MirVisitable<'tcx> for Terminator<'tcx> {
-    fn apply(&self, location: Location, visitor: &mut dyn Visitor<'tcx>)
-    {
+    fn apply(&self, location: Location, visitor: &mut dyn Visitor<'tcx>) {
         visitor.visit_terminator(self, location)
     }
 }
 
 impl<'tcx> MirVisitable<'tcx> for Option<Terminator<'tcx>> {
-    fn apply(&self, location: Location, visitor: &mut dyn Visitor<'tcx>)
-    {
+    fn apply(&self, location: Location, visitor: &mut dyn Visitor<'tcx>) {
         visitor.visit_terminator(self.as_ref().unwrap(), location)
     }
 }
@@ -1112,10 +1109,10 @@ pub fn is_drop(&self) -> bool {
     /// Returns `true` if this place context represents a borrow.
     pub fn is_borrow(&self) -> bool {
         match *self {
-            PlaceContext::NonMutatingUse(NonMutatingUseContext::SharedBorrow) |
-            PlaceContext::NonMutatingUse(NonMutatingUseContext::ShallowBorrow) |
-            PlaceContext::NonMutatingUse(NonMutatingUseContext::UniqueBorrow) |
-            PlaceContext::MutatingUse(MutatingUseContext::Borrow) => true,
+            PlaceContext::NonMutatingUse(NonMutatingUseContext::SharedBorrow)
+            | PlaceContext::NonMutatingUse(NonMutatingUseContext::ShallowBorrow)
+            | PlaceContext::NonMutatingUse(NonMutatingUseContext::UniqueBorrow)
+            PlaceContext::MutatingUse(MutatingUseContext::Borrow) => true,
             _ => false,
         }
     }
@@ -1123,8 +1120,8 @@ pub fn is_borrow(&self) -> bool {
     /// Returns `true` if this place context represents a storage live or storage dead marker.
     pub fn is_storage_marker(&self) -> bool {
         match *self {
-            PlaceContext::NonUse(NonUseContext::StorageLive) |
-            PlaceContext::NonUse(NonUseContext::StorageDead) => true,
+            PlaceContext::NonUse(NonUseContext::StorageLive)
+            PlaceContext::NonUse(NonUseContext::StorageDead) => true,
             _ => false,
         }
     }
@@ -1172,9 +1169,9 @@ pub fn is_use(&self) -> bool {
     /// Returns `true` if this place context represents an assignment statement.
     pub fn is_place_assignment(&self) -> bool {
         match *self {
-            PlaceContext::MutatingUse(MutatingUseContext::Store) |
-            PlaceContext::MutatingUse(MutatingUseContext::Call) |
-            PlaceContext::MutatingUse(MutatingUseContext::AsmOutput) => true,
+            PlaceContext::MutatingUse(MutatingUseContext::Store)
+            | PlaceContext::MutatingUse(MutatingUseContext::Call)
+            PlaceContext::MutatingUse(MutatingUseContext::AsmOutput) => true,
             _ => false,
         }
     }