]> git.lizzy.rs Git - rust.git/commitdiff
Clear MIR local type annotations after borrowck
authorJonas Schievink <jonasschievink@gmail.com>
Sun, 24 May 2020 00:57:21 +0000 (02:57 +0200)
committerJonas Schievink <jonasschievink@gmail.com>
Sun, 24 May 2020 02:15:23 +0000 (04:15 +0200)
18 files changed:
src/librustc_mir/transform/cleanup_post_borrowck.rs
src/test/incremental/hashes/let_expressions.rs
src/test/mir-opt/array-index-is-temporary/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir
src/test/mir-opt/array-index-is-temporary/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir
src/test/mir-opt/const_prop/array_index/32bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/array_index/64bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/32bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/64bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/checked_add/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/mutable_variable_unprop_assign/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/repeat/32bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/repeat/64bit/rustc.main.ConstProp.diff
src/test/mir-opt/inline/inline-into-box-place/32bit/rustc.main.Inline.diff
src/test/mir-opt/inline/inline-into-box-place/64bit/rustc.main.Inline.diff
src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir
src/test/mir-opt/simplify-arm-identity/32bit/rustc.main.SimplifyArmIdentity.diff
src/test/mir-opt/simplify-arm-identity/64bit/rustc.main.SimplifyArmIdentity.diff

index e80da4f756c64abb5750a694f87509226d3ecd4c..3f3d247a8294f55afee2d959722062a7e17195b8 100644 (file)
@@ -35,6 +35,10 @@ fn run_pass(&self, tcx: TyCtxt<'tcx>, _source: MirSource<'tcx>, body: &mut Body<
         let mut delete = DeleteNonCodegenStatements { tcx };
         delete.visit_body(body);
         body.user_type_annotations.raw.clear();
+
+        for decl in &mut body.local_decls {
+            decl.user_ty = None;
+        }
     }
 }
 
index 924ed451e59f8928331d71f0e3f54ecd91478f85..846bfc6d0e4dbb3e64b1efbddf429246a4f997ba 100644 (file)
@@ -38,7 +38,7 @@ pub fn add_type() {
 
 #[cfg(not(cfail1))]
 #[rustc_clean(cfg="cfail2",
-    except="hir_owner_nodes,typeck_tables_of,mir_built,optimized_mir")]
+    except="hir_owner_nodes,typeck_tables_of,mir_built")]
 #[rustc_clean(cfg="cfail3")]
 pub fn add_type() {
     let _x: u32 = 2u32;
index c42d5adce4f2b3121c7854dd9c0b59611e93b195..d39b9b8a3b4447bc14b14c822b90d82c99c89f09 100644 (file)
@@ -14,7 +14,7 @@ fn main() -> () {
         let mut _2: usize;               // in scope 1 at $DIR/array-index-is-temporary.rs:14:9: 14:14
         scope 2 {
             debug y => _2;               // in scope 2 at $DIR/array-index-is-temporary.rs:14:9: 14:14
-            let _3: *mut usize as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
+            let _3: *mut usize;          // in scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
             scope 3 {
                 debug z => _3;           // in scope 3 at $DIR/array-index-is-temporary.rs:15:9: 15:10
                 scope 4 {
index 05d9b3b9b6f777c88bdfaa3cc9de7e31caee9216..381c1ca6f22efc163563e3e052d1bf004ce9ad1e 100644 (file)
@@ -14,7 +14,7 @@ fn main() -> () {
         let mut _2: usize;               // in scope 1 at $DIR/array-index-is-temporary.rs:14:9: 14:14
         scope 2 {
             debug y => _2;               // in scope 2 at $DIR/array-index-is-temporary.rs:14:9: 14:14
-            let _3: *mut usize as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
+            let _3: *mut usize;          // in scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
             scope 3 {
                 debug z => _3;           // in scope 3 at $DIR/array-index-is-temporary.rs:15:9: 15:10
                 scope 4 {
index e24751d39a7df8868ebfa67e56b30b6a0188f748..d02906132e296a9259dd15a6b36e27e308722f95 100644 (file)
@@ -3,7 +3,7 @@
   
   fn main() -> () {
       let mut _0: ();                      // return place in scope 0 at $DIR/array_index.rs:4:11: 4:11
-      let _1: u32 as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/array_index.rs:5:9: 5:10
+      let _1: u32;                         // in scope 0 at $DIR/array_index.rs:5:9: 5:10
       let mut _2: [u32; 4];                // in scope 0 at $DIR/array_index.rs:5:18: 5:30
       let _3: usize;                       // in scope 0 at $DIR/array_index.rs:5:31: 5:32
       let mut _4: usize;                   // in scope 0 at $DIR/array_index.rs:5:18: 5:33
index ad9992bb94905d690b3043547d6e507984af5bb4..4fe3f08955894cb2046d41d1a4260801b94e4292 100644 (file)
@@ -3,7 +3,7 @@
   
   fn main() -> () {
       let mut _0: ();                      // return place in scope 0 at $DIR/array_index.rs:4:11: 4:11
-      let _1: u32 as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/array_index.rs:5:9: 5:10
+      let _1: u32;                         // in scope 0 at $DIR/array_index.rs:5:9: 5:10
       let mut _2: [u32; 4];                // in scope 0 at $DIR/array_index.rs:5:18: 5:30
       let _3: usize;                       // in scope 0 at $DIR/array_index.rs:5:31: 5:32
       let mut _4: usize;                   // in scope 0 at $DIR/array_index.rs:5:18: 5:33
index 8ecb77752bb395b4f47e119746eb4cbb4a89531e..7071f31dbf104d60324aee2279332ba9825053a7 100644 (file)
@@ -3,7 +3,7 @@
   
   fn main() -> () {
       let mut _0: ();                      // return place in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:4:11: 4:11
-      let _1: *const [i32] as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
+      let _1: *const [i32];                // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
       let mut _2: *const [i32; 3];         // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
       let _3: &[i32; 3];                   // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
       let _4: [i32; 3];                    // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:26: 5:35
index 2778ec02724df89826fcc9fc5c4dce22edff18bf..15995ab070019842123a9424033798a69999a48d 100644 (file)
@@ -3,7 +3,7 @@
   
   fn main() -> () {
       let mut _0: ();                      // return place in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:4:11: 4:11
-      let _1: *const [i32] as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
+      let _1: *const [i32];                // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
       let mut _2: *const [i32; 3];         // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
       let _3: &[i32; 3];                   // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
       let _4: [i32; 3];                    // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:26: 5:35
index 92add8bafdc0363f92a8c2d841f32580a0e0e55f..f9f7d543d21f514153cc1836b7abb1b1d7f8798e 100644 (file)
@@ -3,7 +3,7 @@
   
   fn main() -> () {
       let mut _0: ();                      // return place in scope 0 at $DIR/checked_add.rs:4:11: 4:11
-      let _1: u32 as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/checked_add.rs:5:9: 5:10
+      let _1: u32;                         // in scope 0 at $DIR/checked_add.rs:5:9: 5:10
       let mut _2: (u32, bool);             // in scope 0 at $DIR/checked_add.rs:5:18: 5:23
       scope 1 {
           debug x => _1;                   // in scope 1 at $DIR/checked_add.rs:5:9: 5:10
index 6834bb6bdd4f74a1840dbe54d7c9bc16b3b61e8c..f6bb72baea41990c92a25876c9566b2b5074bab1 100644 (file)
@@ -3,7 +3,7 @@
   
   fn main() -> () {
       let mut _0: ();                      // return place in scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:4:11: 4:11
-      let mut _1: (i32, i32) as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:5:9: 5:14
+      let mut _1: (i32, i32);              // in scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:5:9: 5:14
       scope 1 {
           debug x => _1;                   // in scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:5:9: 5:14
           let _2: i32;                     // in scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:8:9: 8:10
index 738343c655e360b11ed205d4f99be0032e119728..e0b9fbe04c387465bb1d8788040237df30c20eba 100644 (file)
@@ -7,7 +7,7 @@
       let mut _3: i32;                     // in scope 0 at $DIR/mutable_variable_unprop_assign.rs:7:11: 7:12
       scope 1 {
           debug a => _1;                   // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:5:9: 5:10
-          let mut _2: (i32, i32) as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:6:9: 6:14
+          let mut _2: (i32, i32);          // in scope 1 at $DIR/mutable_variable_unprop_assign.rs:6:9: 6:14
           scope 2 {
               debug x => _2;               // in scope 2 at $DIR/mutable_variable_unprop_assign.rs:6:9: 6:14
               let _4: i32;                 // in scope 2 at $DIR/mutable_variable_unprop_assign.rs:8:9: 8:10
index 4ccfe1838d9cceca5f089ac72481ccc6cc7654c6..b1c9e22913935d2fae793db7b9e56c5fb3fe3aa8 100644 (file)
@@ -3,7 +3,7 @@
   
   fn main() -> () {
       let mut _0: ();                      // return place in scope 0 at $DIR/repeat.rs:5:11: 5:11
-      let _1: u32 as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/repeat.rs:6:9: 6:10
+      let _1: u32;                         // in scope 0 at $DIR/repeat.rs:6:9: 6:10
       let mut _2: u32;                     // in scope 0 at $DIR/repeat.rs:6:18: 6:28
       let mut _3: [u32; 8];                // in scope 0 at $DIR/repeat.rs:6:18: 6:25
       let _4: usize;                       // in scope 0 at $DIR/repeat.rs:6:26: 6:27
index fe9d16c4ffabb91b851979226413f5c0335402f3..29555b03a8b8e031a94f744df6fcf790168753da 100644 (file)
@@ -3,7 +3,7 @@
   
   fn main() -> () {
       let mut _0: ();                      // return place in scope 0 at $DIR/repeat.rs:5:11: 5:11
-      let _1: u32 as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/repeat.rs:6:9: 6:10
+      let _1: u32;                         // in scope 0 at $DIR/repeat.rs:6:9: 6:10
       let mut _2: u32;                     // in scope 0 at $DIR/repeat.rs:6:18: 6:28
       let mut _3: [u32; 8];                // in scope 0 at $DIR/repeat.rs:6:18: 6:25
       let _4: usize;                       // in scope 0 at $DIR/repeat.rs:6:26: 6:27
index 607dd468e598bf3a7a99ca16f230435c9bea97d2..f31d5fae9ed379ea1ca68e328300b0f4b0ff419d 100644 (file)
@@ -3,7 +3,7 @@
   
   fn main() -> () {
       let mut _0: ();                      // return place in scope 0 at $DIR/inline-into-box-place.rs:7:11: 7:11
-      let _1: std::boxed::Box<std::vec::Vec<u32>> as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
+      let _1: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
       let mut _2: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
       let mut _3: ();                      // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
 +     let mut _4: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
index e83ca36706af756561674adc1b7f50b87e9ce4be..324ec2d7c5bcd34cf712295e932e297ca24fa0f7 100644 (file)
@@ -3,7 +3,7 @@
   
   fn main() -> () {
       let mut _0: ();                      // return place in scope 0 at $DIR/inline-into-box-place.rs:7:11: 7:11
-      let _1: std::boxed::Box<std::vec::Vec<u32>> as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
+      let _1: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
       let mut _2: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
       let mut _3: ();                      // in scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
 +     let mut _4: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
index f2154ef6b1e9110b1608faf0a36d1de976ad1b03..459c6b7a70a3633b525d13e8ae8c63c5bcec3be3 100644 (file)
@@ -24,7 +24,7 @@ fn main() -> () {
     scope 1 {
         debug x => _1;                   // in scope 1 at $DIR/retag.rs:30:9: 30:14
         let _3: &mut i32;                // in scope 1 at $DIR/retag.rs:32:13: 32:14
-        let _13: for<'r> fn(&'r i32) -> &'r i32 as UserTypeProjection { base: UserType(1), projs: [] }; // in scope 1 at $DIR/retag.rs:40:9: 40:10
+        let _13: for<'r> fn(&'r i32) -> &'r i32; // in scope 1 at $DIR/retag.rs:40:9: 40:10
         scope 2 {
             debug v => _3;               // in scope 2 at $DIR/retag.rs:32:13: 32:14
             let _8: &mut i32;            // in scope 2 at $DIR/retag.rs:33:13: 33:14
index 6199e2c56625df1718ee1aab101577feb19c7197..dfd6d6f0f2ecd270b614f4ddfad3a17c47f5cc8e 100644 (file)
@@ -3,7 +3,7 @@
   
   fn main() -> () {
       let mut _0: ();                      // return place in scope 0 at $DIR/simplify-arm-identity.rs:17:11: 17:11
-      let _1: Src as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/simplify-arm-identity.rs:18:9: 18:10
+      let _1: Src;                         // in scope 0 at $DIR/simplify-arm-identity.rs:18:9: 18:10
       let mut _2: Dst;                     // in scope 0 at $DIR/simplify-arm-identity.rs:19:18: 22:6
       let mut _3: isize;                   // in scope 0 at $DIR/simplify-arm-identity.rs:20:9: 20:20
       let mut _5: u8;                      // in scope 0 at $DIR/simplify-arm-identity.rs:20:33: 20:34
index bf875c6a555fe3d2f6241d7e63a8c0fd867e2453..f2bbd195869931ae0d53989d03c705461ae8e5ee 100644 (file)
@@ -3,7 +3,7 @@
   
   fn main() -> () {
       let mut _0: ();                      // return place in scope 0 at $DIR/simplify-arm-identity.rs:17:11: 17:11
-      let _1: Src as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/simplify-arm-identity.rs:18:9: 18:10
+      let _1: Src;                         // in scope 0 at $DIR/simplify-arm-identity.rs:18:9: 18:10
       let mut _2: Dst;                     // in scope 0 at $DIR/simplify-arm-identity.rs:19:18: 22:6
       let mut _3: isize;                   // in scope 0 at $DIR/simplify-arm-identity.rs:20:9: 20:20
       let mut _5: u8;                      // in scope 0 at $DIR/simplify-arm-identity.rs:20:33: 20:34