about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorouz-a <oguz.agcayazi@gmail.com>2022-10-04 21:39:43 +0300
committerouz-a <oguz.agcayazi@gmail.com>2022-10-06 15:32:41 +0300
commitd59c7ff000db581bd03c2da79046af431678fab8 (patch)
tree59b9ba742fd3698bee9d775927e4ba8439912262 /src
parent02cd79afb8080fce8c8ce35533c54d8ecf8f390e (diff)
downloadrust-d59c7ff000db581bd03c2da79046af431678fab8.tar.gz
rust-d59c7ff000db581bd03c2da79046af431678fab8.zip
Remove `mir::CastKind::Misc`
Diffstat (limited to 'src')
-rw-r--r--src/test/mir-opt/const_prop/cast.main.ConstProp.diff4
-rw-r--r--src/test/mir-opt/const_prop/indirect.main.ConstProp.diff2
-rw-r--r--src/test/mir-opt/enum_cast.bar.mir_map.0.mir2
-rw-r--r--src/test/mir-opt/enum_cast.boo.mir_map.0.mir2
-rw-r--r--src/test/mir-opt/enum_cast.droppy.mir_map.0.mir2
-rw-r--r--src/test/mir-opt/enum_cast.foo.mir_map.0.mir2
-rw-r--r--src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff2
-rw-r--r--src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff4
-rw-r--r--src/test/mir-opt/inline/inline_diverging.g.Inline.diff2
-rw-r--r--src/test/mir-opt/issue_101973.inner.ConstProp.diff4
-rw-r--r--src/test/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff4
-rw-r--r--src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir2
-rw-r--r--src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs7
13 files changed, 22 insertions, 17 deletions
diff --git a/src/test/mir-opt/const_prop/cast.main.ConstProp.diff b/src/test/mir-opt/const_prop/cast.main.ConstProp.diff
index e040a4b3a53..1d4dfc29f70 100644
--- a/src/test/mir-opt/const_prop/cast.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/cast.main.ConstProp.diff
@@ -14,10 +14,10 @@
   
       bb0: {
           StorageLive(_1);                 // scope 0 at $DIR/cast.rs:+1:9: +1:10
--         _1 = const 42_u8 as u32 (Misc);  // scope 0 at $DIR/cast.rs:+1:13: +1:24
+-         _1 = const 42_u8 as u32 (IntToInt); // scope 0 at $DIR/cast.rs:+1:13: +1:24
 +         _1 = const 42_u32;               // scope 0 at $DIR/cast.rs:+1:13: +1:24
           StorageLive(_2);                 // scope 1 at $DIR/cast.rs:+3:9: +3:10
--         _2 = const 42_u32 as u8 (Misc);  // scope 1 at $DIR/cast.rs:+3:13: +3:24
+-         _2 = const 42_u32 as u8 (IntToInt); // scope 1 at $DIR/cast.rs:+3:13: +3:24
 +         _2 = const 42_u8;                // scope 1 at $DIR/cast.rs:+3:13: +3:24
           _0 = const ();                   // scope 0 at $DIR/cast.rs:+0:11: +4:2
           StorageDead(_2);                 // scope 1 at $DIR/cast.rs:+4:1: +4:2
diff --git a/src/test/mir-opt/const_prop/indirect.main.ConstProp.diff b/src/test/mir-opt/const_prop/indirect.main.ConstProp.diff
index 948bb7f56fe..f4c0c5c5e7f 100644
--- a/src/test/mir-opt/const_prop/indirect.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/indirect.main.ConstProp.diff
@@ -13,7 +13,7 @@
       bb0: {
           StorageLive(_1);                 // scope 0 at $DIR/indirect.rs:+1:9: +1:10
           StorageLive(_2);                 // scope 0 at $DIR/indirect.rs:+1:13: +1:25
--         _2 = const 2_u32 as u8 (Misc);   // scope 0 at $DIR/indirect.rs:+1:13: +1:25
+-         _2 = const 2_u32 as u8 (IntToInt); // scope 0 at $DIR/indirect.rs:+1:13: +1:25
 -         _3 = CheckedAdd(_2, const 1_u8); // scope 0 at $DIR/indirect.rs:+1:13: +1:29
 -         assert(!move (_3.1: bool), "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
 +         _2 = const 2_u8;                 // scope 0 at $DIR/indirect.rs:+1:13: +1:25
diff --git a/src/test/mir-opt/enum_cast.bar.mir_map.0.mir b/src/test/mir-opt/enum_cast.bar.mir_map.0.mir
index afca2fd2960..8b12525b576 100644
--- a/src/test/mir-opt/enum_cast.bar.mir_map.0.mir
+++ b/src/test/mir-opt/enum_cast.bar.mir_map.0.mir
@@ -7,7 +7,7 @@ fn bar(_1: Bar) -> usize {
 
     bb0: {
         _2 = discriminant(_1);           // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
-        _0 = move _2 as usize (Misc);    // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+        _0 = move _2 as usize (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
         return;                          // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
     }
 }
diff --git a/src/test/mir-opt/enum_cast.boo.mir_map.0.mir b/src/test/mir-opt/enum_cast.boo.mir_map.0.mir
index c79596d7899..a77f4d06c23 100644
--- a/src/test/mir-opt/enum_cast.boo.mir_map.0.mir
+++ b/src/test/mir-opt/enum_cast.boo.mir_map.0.mir
@@ -7,7 +7,7 @@ fn boo(_1: Boo) -> usize {
 
     bb0: {
         _2 = discriminant(_1);           // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
-        _0 = move _2 as usize (Misc);    // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+        _0 = move _2 as usize (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
         return;                          // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
     }
 }
diff --git a/src/test/mir-opt/enum_cast.droppy.mir_map.0.mir b/src/test/mir-opt/enum_cast.droppy.mir_map.0.mir
index 8ced136db84..ae3e71df8c6 100644
--- a/src/test/mir-opt/enum_cast.droppy.mir_map.0.mir
+++ b/src/test/mir-opt/enum_cast.droppy.mir_map.0.mir
@@ -26,7 +26,7 @@ fn droppy() -> () {
         FakeRead(ForLet(None), _2);      // scope 0 at $DIR/enum_cast.rs:+2:13: +2:14
         StorageLive(_3);                 // scope 3 at $DIR/enum_cast.rs:+5:13: +5:14
         _4 = discriminant(_2);           // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
-        _3 = move _4 as usize (Misc);    // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
+        _3 = move _4 as usize (IntToInt); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
         FakeRead(ForLet(None), _3);      // scope 3 at $DIR/enum_cast.rs:+5:13: +5:14
         _1 = const ();                   // scope 0 at $DIR/enum_cast.rs:+1:5: +6:6
         StorageDead(_3);                 // scope 1 at $DIR/enum_cast.rs:+6:5: +6:6
diff --git a/src/test/mir-opt/enum_cast.foo.mir_map.0.mir b/src/test/mir-opt/enum_cast.foo.mir_map.0.mir
index 39d6adeba33..9e44d9158e0 100644
--- a/src/test/mir-opt/enum_cast.foo.mir_map.0.mir
+++ b/src/test/mir-opt/enum_cast.foo.mir_map.0.mir
@@ -7,7 +7,7 @@ fn foo(_1: Foo) -> usize {
 
     bb0: {
         _2 = discriminant(_1);           // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
-        _0 = move _2 as usize (Misc);    // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+        _0 = move _2 as usize (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
         return;                          // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
     }
 }
diff --git a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff b/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
index e83a358b725..6ab63e82e35 100644
--- a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
+++ b/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
@@ -91,7 +91,7 @@
           StorageLive(_15);                // scope 3 at $DIR/funky_arms.rs:+15:59: +15:75
           StorageLive(_16);                // scope 3 at $DIR/funky_arms.rs:+15:59: +15:68
           _16 = _10;                       // scope 3 at $DIR/funky_arms.rs:+15:59: +15:68
-          _15 = move _16 as u32 (Misc);    // scope 3 at $DIR/funky_arms.rs:+15:59: +15:75
+          _15 = move _16 as u32 (IntToInt); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:75
           StorageDead(_16);                // scope 3 at $DIR/funky_arms.rs:+15:74: +15:75
           _14 = Add(move _15, const 1_u32); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:79
           StorageDead(_15);                // scope 3 at $DIR/funky_arms.rs:+15:78: +15:79
diff --git a/src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
index 3f612e03f58..ed53c9a956c 100644
--- a/src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
+++ b/src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
@@ -31,7 +31,7 @@
           StorageLive(_6);                 // scope 1 at $DIR/if-condition-int.rs:+4:23: +4:31
           StorageLive(_7);                 // scope 1 at $DIR/if-condition-int.rs:+4:23: +4:24
           _7 = _2;                         // scope 1 at $DIR/if-condition-int.rs:+4:23: +4:24
-          _6 = move _7 as i32 (Misc);      // scope 1 at $DIR/if-condition-int.rs:+4:23: +4:31
+          _6 = move _7 as i32 (IntToInt);  // scope 1 at $DIR/if-condition-int.rs:+4:23: +4:31
           StorageDead(_7);                 // scope 1 at $DIR/if-condition-int.rs:+4:30: +4:31
           _0 = Add(const 100_i32, move _6); // scope 1 at $DIR/if-condition-int.rs:+4:17: +4:31
           StorageDead(_6);                 // scope 1 at $DIR/if-condition-int.rs:+4:30: +4:31
@@ -43,7 +43,7 @@
           StorageLive(_4);                 // scope 1 at $DIR/if-condition-int.rs:+3:23: +3:31
           StorageLive(_5);                 // scope 1 at $DIR/if-condition-int.rs:+3:23: +3:24
           _5 = _2;                         // scope 1 at $DIR/if-condition-int.rs:+3:23: +3:24
-          _4 = move _5 as i32 (Misc);      // scope 1 at $DIR/if-condition-int.rs:+3:23: +3:31
+          _4 = move _5 as i32 (IntToInt);  // scope 1 at $DIR/if-condition-int.rs:+3:23: +3:31
           StorageDead(_5);                 // scope 1 at $DIR/if-condition-int.rs:+3:30: +3:31
           _0 = Add(const 10_i32, move _4); // scope 1 at $DIR/if-condition-int.rs:+3:18: +3:31
           StorageDead(_4);                 // scope 1 at $DIR/if-condition-int.rs:+3:30: +3:31
diff --git a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff
index a25f1454fac..a71baad3e3e 100644
--- a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff
+++ b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff
@@ -25,7 +25,7 @@
       bb1: {
           StorageLive(_4);                 // scope 0 at $DIR/inline-diverging.rs:+2:9: +2:10
           _4 = _1;                         // scope 0 at $DIR/inline-diverging.rs:+2:9: +2:10
-          _0 = move _4 as u32 (Misc);      // scope 0 at $DIR/inline-diverging.rs:+2:9: +2:17
+          _0 = move _4 as u32 (IntToInt);  // scope 0 at $DIR/inline-diverging.rs:+2:9: +2:17
           StorageDead(_4);                 // scope 0 at $DIR/inline-diverging.rs:+2:16: +2:17
           StorageDead(_2);                 // scope 0 at $DIR/inline-diverging.rs:+5:5: +5:6
           return;                          // scope 0 at $DIR/inline-diverging.rs:+6:2: +6:2
diff --git a/src/test/mir-opt/issue_101973.inner.ConstProp.diff b/src/test/mir-opt/issue_101973.inner.ConstProp.diff
index 89733a9a2cb..281afe4be17 100644
--- a/src/test/mir-opt/issue_101973.inner.ConstProp.diff
+++ b/src/test/mir-opt/issue_101973.inner.ConstProp.diff
@@ -90,9 +90,9 @@
           StorageDead(_16);                // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
           StorageDead(_6);                 // scope 0 at $DIR/issue-101973.rs:+1:57: +1:58
           StorageDead(_4);                 // scope 0 at $DIR/issue-101973.rs:+1:57: +1:58
-          _2 = move _3 as i32 (Misc);      // scope 0 at $DIR/issue-101973.rs:+1:5: +1:65
+          _2 = move _3 as i32 (IntToInt);  // scope 0 at $DIR/issue-101973.rs:+1:5: +1:65
           StorageDead(_3);                 // scope 0 at $DIR/issue-101973.rs:+1:64: +1:65
-          _0 = move _2 as i64 (Misc);      // scope 0 at $DIR/issue-101973.rs:+1:5: +1:72
+          _0 = move _2 as i64 (IntToInt);  // scope 0 at $DIR/issue-101973.rs:+1:5: +1:72
           StorageDead(_2);                 // scope 0 at $DIR/issue-101973.rs:+1:71: +1:72
           return;                          // scope 0 at $DIR/issue-101973.rs:+2:2: +2:2
       }
diff --git a/src/test/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff b/src/test/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff
index 4fb6752b619..ec15fd1ef74 100644
--- a/src/test/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff
+++ b/src/test/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff
@@ -36,7 +36,7 @@
           _7 = &_1;                        // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:33
           _6 = &raw const (*_7);           // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:33
           _5 = _6;                         // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:45
-          _4 = move _5 as *const i32 (Misc); // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:59
+          _4 = move _5 as *const i32 (PtrToPtr); // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:59
           StorageDead(_5);                 // scope 3 at $DIR/lower_intrinsics.rs:+4:58: +4:59
           StorageLive(_8);                 // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:91
           StorageLive(_9);                 // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:79
@@ -45,7 +45,7 @@
           _11 = &mut _2;                   // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:69
           _10 = &raw mut (*_11);           // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:69
           _9 = _10;                        // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:79
-          _8 = move _9 as *mut i32 (Misc); // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:91
+          _8 = move _9 as *mut i32 (PtrToPtr); // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:91
           StorageDead(_9);                 // scope 3 at $DIR/lower_intrinsics.rs:+4:90: +4:91
 -         _3 = copy_nonoverlapping::<i32>(move _4, move _8, const 0_usize) -> bb1; // scope 3 at $DIR/lower_intrinsics.rs:+4:9: +4:95
 -                                          // mir::Constant
diff --git a/src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir b/src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir
index b4b317e84af..31ccf14549c 100644
--- a/src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir
+++ b/src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir
@@ -84,7 +84,7 @@ fn std::ptr::drop_in_place(_1: *mut [String]) -> () {
 
     bb13: {
         _15 = &raw mut (*_1);            // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
-        _9 = move _15 as *mut std::string::String (Misc); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
+        _9 = move _15 as *mut std::string::String (PtrToPtr); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
         _10 = Offset(_9, move _3);       // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
         goto -> bb12;                    // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
     }
diff --git a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs
index f7ce7191772..7af27ebb988 100644
--- a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs
+++ b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs
@@ -129,7 +129,12 @@ fn check_rvalue<'tcx>(
         | Rvalue::Use(operand)
         | Rvalue::Cast(
             CastKind::PointerFromExposedAddress
-            | CastKind::Misc
+            | CastKind::IntToInt
+            | CastKind::FloatToInt
+            | CastKind::IntToFloat
+            | CastKind::FloatToFloat
+            | CastKind::FnPtrToPtr
+            | CastKind::PtrToPtr
             | CastKind::Pointer(PointerCast::MutToConstPointer | PointerCast::ArrayToPointer),
             operand,
             _,