summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-12-18 21:57:20 +0000
committerJosh Stone <jistone@redhat.com>2025-01-02 14:28:32 -0800
commit432bd9de3259e5cd73b0e798a05ddffe8eea7759 (patch)
treee7c2ff4cdc520f0de99f94e611bb53781e696629 /tests
parent3113133cb7321abd41c9af2a74af1d75f75d60ab (diff)
downloadrust-432bd9de3259e5cd73b0e798a05ddffe8eea7759.tar.gz
rust-432bd9de3259e5cd73b0e798a05ddffe8eea7759.zip
Separate DropKind::ForLint
(cherry picked from commit 5e079011eafbb1d5fc779c14c7a29d4a620574f9)
Diffstat (limited to 'tests')
-rw-r--r--tests/mir-opt/tail_expr_drop_order_unwind.method_1.ElaborateDrops.after.panic-abort.mir74
-rw-r--r--tests/mir-opt/tail_expr_drop_order_unwind.method_1.ElaborateDrops.after.panic-unwind.mir74
-rw-r--r--tests/mir-opt/tail_expr_drop_order_unwind.rs4
3 files changed, 52 insertions, 100 deletions
diff --git a/tests/mir-opt/tail_expr_drop_order_unwind.method_1.ElaborateDrops.after.panic-abort.mir b/tests/mir-opt/tail_expr_drop_order_unwind.method_1.ElaborateDrops.after.panic-abort.mir
index 54bedfdc0af..e9bbe30bd77 100644
--- a/tests/mir-opt/tail_expr_drop_order_unwind.method_1.ElaborateDrops.after.panic-abort.mir
+++ b/tests/mir-opt/tail_expr_drop_order_unwind.method_1.ElaborateDrops.after.panic-abort.mir
@@ -12,10 +12,9 @@ fn method_1(_1: Guard) -> () {
     let _8: OtherDrop;
     let _9: ();
     let mut _10: bool;
-    let mut _11: bool;
+    let mut _11: isize;
     let mut _12: isize;
     let mut _13: isize;
-    let mut _14: isize;
     scope 1 {
         debug other_drop => _8;
     }
@@ -24,7 +23,6 @@ fn method_1(_1: Guard) -> () {
     }
 
     bb0: {
-        _11 = const false;
         _10 = const false;
         StorageLive(_2);
         StorageLive(_3);
@@ -32,15 +30,14 @@ fn method_1(_1: Guard) -> () {
         StorageLive(_5);
         StorageLive(_6);
         _6 = &_1;
-        _5 = <Guard as Clone>::clone(move _6) -> [return: bb1, unwind: bb16];
+        _5 = <Guard as Clone>::clone(move _6) -> [return: bb1, unwind: bb13];
     }
 
     bb1: {
-        _11 = const true;
         StorageDead(_6);
         _4 = &_5;
         _3 = &(*_4);
-        _2 = method_2(move _3) -> [return: bb2, unwind: bb14];
+        _2 = method_2(move _3) -> [return: bb2, unwind: bb12];
     }
 
     bb2: {
@@ -78,20 +75,19 @@ fn method_1(_1: Guard) -> () {
     bb7: {
         backward incompatible drop(_2);
         backward incompatible drop(_5);
-        goto -> bb24;
+        goto -> bb21;
     }
 
     bb8: {
-        drop(_5) -> [return: bb9, unwind: bb16];
+        drop(_5) -> [return: bb9, unwind: bb13];
     }
 
     bb9: {
-        _11 = const false;
         StorageDead(_5);
         StorageDead(_4);
         _10 = const false;
         StorageDead(_2);
-        drop(_1) -> [return: bb10, unwind: bb17];
+        drop(_1) -> [return: bb10, unwind: bb14];
     }
 
     bb10: {
@@ -99,7 +95,7 @@ fn method_1(_1: Guard) -> () {
     }
 
     bb11 (cleanup): {
-        goto -> bb28;
+        goto -> bb25;
     }
 
     bb12 (cleanup): {
@@ -107,77 +103,57 @@ fn method_1(_1: Guard) -> () {
     }
 
     bb13 (cleanup): {
-        goto -> bb15;
+        drop(_1) -> [return: bb14, unwind terminate(cleanup)];
     }
 
     bb14 (cleanup): {
-        drop(_5) -> [return: bb15, unwind terminate(cleanup)];
+        resume;
     }
 
-    bb15 (cleanup): {
-        goto -> bb30;
+    bb15: {
+        goto -> bb8;
     }
 
     bb16 (cleanup): {
-        drop(_1) -> [return: bb17, unwind terminate(cleanup)];
+        goto -> bb12;
     }
 
     bb17 (cleanup): {
-        resume;
+        goto -> bb12;
     }
 
     bb18: {
-        goto -> bb8;
+        goto -> bb15;
     }
 
-    bb19 (cleanup): {
+    bb19: {
         goto -> bb15;
     }
 
     bb20 (cleanup): {
-        goto -> bb15;
+        goto -> bb12;
     }
 
     bb21: {
-        goto -> bb18;
+        _11 = discriminant(_2);
+        switchInt(move _11) -> [0: bb18, otherwise: bb19];
     }
 
-    bb22: {
-        goto -> bb18;
-    }
-
-    bb23 (cleanup): {
-        goto -> bb15;
-    }
-
-    bb24: {
+    bb22 (cleanup): {
         _12 = discriminant(_2);
-        switchInt(move _12) -> [0: bb21, otherwise: bb22];
+        switchInt(move _12) -> [0: bb16, otherwise: bb20];
     }
 
-    bb25 (cleanup): {
-        _13 = discriminant(_2);
-        switchInt(move _13) -> [0: bb19, otherwise: bb23];
-    }
-
-    bb26 (cleanup): {
+    bb23 (cleanup): {
         goto -> bb12;
     }
 
-    bb27 (cleanup): {
+    bb24 (cleanup): {
         goto -> bb12;
     }
 
-    bb28 (cleanup): {
-        _14 = discriminant(_2);
-        switchInt(move _14) -> [0: bb26, otherwise: bb27];
-    }
-
-    bb29 (cleanup): {
-        drop(_5) -> [return: bb16, unwind terminate(cleanup)];
-    }
-
-    bb30 (cleanup): {
-        switchInt(copy _11) -> [0: bb16, otherwise: bb29];
+    bb25 (cleanup): {
+        _13 = discriminant(_2);
+        switchInt(move _13) -> [0: bb23, otherwise: bb24];
     }
 }
diff --git a/tests/mir-opt/tail_expr_drop_order_unwind.method_1.ElaborateDrops.after.panic-unwind.mir b/tests/mir-opt/tail_expr_drop_order_unwind.method_1.ElaborateDrops.after.panic-unwind.mir
index 54bedfdc0af..e9bbe30bd77 100644
--- a/tests/mir-opt/tail_expr_drop_order_unwind.method_1.ElaborateDrops.after.panic-unwind.mir
+++ b/tests/mir-opt/tail_expr_drop_order_unwind.method_1.ElaborateDrops.after.panic-unwind.mir
@@ -12,10 +12,9 @@ fn method_1(_1: Guard) -> () {
     let _8: OtherDrop;
     let _9: ();
     let mut _10: bool;
-    let mut _11: bool;
+    let mut _11: isize;
     let mut _12: isize;
     let mut _13: isize;
-    let mut _14: isize;
     scope 1 {
         debug other_drop => _8;
     }
@@ -24,7 +23,6 @@ fn method_1(_1: Guard) -> () {
     }
 
     bb0: {
-        _11 = const false;
         _10 = const false;
         StorageLive(_2);
         StorageLive(_3);
@@ -32,15 +30,14 @@ fn method_1(_1: Guard) -> () {
         StorageLive(_5);
         StorageLive(_6);
         _6 = &_1;
-        _5 = <Guard as Clone>::clone(move _6) -> [return: bb1, unwind: bb16];
+        _5 = <Guard as Clone>::clone(move _6) -> [return: bb1, unwind: bb13];
     }
 
     bb1: {
-        _11 = const true;
         StorageDead(_6);
         _4 = &_5;
         _3 = &(*_4);
-        _2 = method_2(move _3) -> [return: bb2, unwind: bb14];
+        _2 = method_2(move _3) -> [return: bb2, unwind: bb12];
     }
 
     bb2: {
@@ -78,20 +75,19 @@ fn method_1(_1: Guard) -> () {
     bb7: {
         backward incompatible drop(_2);
         backward incompatible drop(_5);
-        goto -> bb24;
+        goto -> bb21;
     }
 
     bb8: {
-        drop(_5) -> [return: bb9, unwind: bb16];
+        drop(_5) -> [return: bb9, unwind: bb13];
     }
 
     bb9: {
-        _11 = const false;
         StorageDead(_5);
         StorageDead(_4);
         _10 = const false;
         StorageDead(_2);
-        drop(_1) -> [return: bb10, unwind: bb17];
+        drop(_1) -> [return: bb10, unwind: bb14];
     }
 
     bb10: {
@@ -99,7 +95,7 @@ fn method_1(_1: Guard) -> () {
     }
 
     bb11 (cleanup): {
-        goto -> bb28;
+        goto -> bb25;
     }
 
     bb12 (cleanup): {
@@ -107,77 +103,57 @@ fn method_1(_1: Guard) -> () {
     }
 
     bb13 (cleanup): {
-        goto -> bb15;
+        drop(_1) -> [return: bb14, unwind terminate(cleanup)];
     }
 
     bb14 (cleanup): {
-        drop(_5) -> [return: bb15, unwind terminate(cleanup)];
+        resume;
     }
 
-    bb15 (cleanup): {
-        goto -> bb30;
+    bb15: {
+        goto -> bb8;
     }
 
     bb16 (cleanup): {
-        drop(_1) -> [return: bb17, unwind terminate(cleanup)];
+        goto -> bb12;
     }
 
     bb17 (cleanup): {
-        resume;
+        goto -> bb12;
     }
 
     bb18: {
-        goto -> bb8;
+        goto -> bb15;
     }
 
-    bb19 (cleanup): {
+    bb19: {
         goto -> bb15;
     }
 
     bb20 (cleanup): {
-        goto -> bb15;
+        goto -> bb12;
     }
 
     bb21: {
-        goto -> bb18;
+        _11 = discriminant(_2);
+        switchInt(move _11) -> [0: bb18, otherwise: bb19];
     }
 
-    bb22: {
-        goto -> bb18;
-    }
-
-    bb23 (cleanup): {
-        goto -> bb15;
-    }
-
-    bb24: {
+    bb22 (cleanup): {
         _12 = discriminant(_2);
-        switchInt(move _12) -> [0: bb21, otherwise: bb22];
+        switchInt(move _12) -> [0: bb16, otherwise: bb20];
     }
 
-    bb25 (cleanup): {
-        _13 = discriminant(_2);
-        switchInt(move _13) -> [0: bb19, otherwise: bb23];
-    }
-
-    bb26 (cleanup): {
+    bb23 (cleanup): {
         goto -> bb12;
     }
 
-    bb27 (cleanup): {
+    bb24 (cleanup): {
         goto -> bb12;
     }
 
-    bb28 (cleanup): {
-        _14 = discriminant(_2);
-        switchInt(move _14) -> [0: bb26, otherwise: bb27];
-    }
-
-    bb29 (cleanup): {
-        drop(_5) -> [return: bb16, unwind terminate(cleanup)];
-    }
-
-    bb30 (cleanup): {
-        switchInt(copy _11) -> [0: bb16, otherwise: bb29];
+    bb25 (cleanup): {
+        _13 = discriminant(_2);
+        switchInt(move _13) -> [0: bb23, otherwise: bb24];
     }
 }
diff --git a/tests/mir-opt/tail_expr_drop_order_unwind.rs b/tests/mir-opt/tail_expr_drop_order_unwind.rs
index b67b3580875..065e08c3409 100644
--- a/tests/mir-opt/tail_expr_drop_order_unwind.rs
+++ b/tests/mir-opt/tail_expr_drop_order_unwind.rs
@@ -26,8 +26,8 @@ fn method_1(g: Guard) {
     match method_2(&g.clone()) {
         Ok(other_drop) => {
             // repro needs something else being dropped too.
-        },
-        Err(err) => {},
+        }
+        Err(err) => {}
     }
 }