]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/hair/mod.rs
For diagnostics, set spans of drops of temps to be that of the statement's terminatin...
[rust.git] / src / librustc_mir / hair / mod.rs
index 781b6c92aa13a859b00691c0bf1baa68606b8d97..fd1ddcc1cc6cabaab0d967e8e192273dc4ee7503 100644 (file)
@@ -28,6 +28,7 @@
 
 pub mod pattern;
 pub use self::pattern::{BindingMode, Pattern, PatternKind, FieldPattern};
+pub(crate) use self::pattern::{PatternTypeProjection, PatternTypeProjections};
 
 mod util;
 
@@ -70,10 +71,14 @@ pub enum StmtRef<'tcx> {
     Mirror(Box<Stmt<'tcx>>),
 }
 
+#[derive(Clone, Debug)]
+pub struct StatementSpan(pub Span);
+
 #[derive(Clone, Debug)]
 pub struct Stmt<'tcx> {
     pub kind: StmtKind<'tcx>,
     pub opt_destruction_scope: Option<region::Scope>,
+    pub span: StatementSpan,
 }
 
 #[derive(Clone, Debug)]
@@ -276,12 +281,12 @@ pub enum ExprKind<'tcx> {
     PlaceTypeAscription {
         source: ExprRef<'tcx>,
         /// Type that the user gave to this expression
-        user_ty: UserTypeAnnotation<'tcx>,
+        user_ty: Option<UserTypeAnnotation<'tcx>>,
     },
     ValueTypeAscription {
         source: ExprRef<'tcx>,
         /// Type that the user gave to this expression
-        user_ty: UserTypeAnnotation<'tcx>,
+        user_ty: Option<UserTypeAnnotation<'tcx>>,
     },
     Closure {
         closure_id: DefId,