We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d9f633 commit 2cbccceCopy full SHA for 2cbccce
src/test/mir-opt/generator-tiny.rs
@@ -0,0 +1,34 @@
1
+//! Tests that generators that cannot return or unwind don't have unnecessary
2
+//! panic branches.
3
+
4
+// compile-flags: -Zno-landing-pads
5
6
+#![feature(generators, generator_trait)]
7
8
+struct HasDrop;
9
10
+impl Drop for HasDrop {
11
+ fn drop(&mut self) {}
12
+}
13
14
+fn callee() {}
15
16
+fn main() {
17
+ let _gen = |_x: u8| {
18
+ let _d = HasDrop;
19
+ loop {
20
+ yield;
21
+ callee();
22
+ }
23
+ };
24
25
26
+// END RUST SOURCE
27
28
+// START rustc.main-{{closure}}.generator_resume.0.mir
29
+// bb0: {
30
+// ...
31
+// switchInt(move _11) -> [0u32: bb1, 3u32: bb5, otherwise: bb6];
32
+// }
33
34
+// END rustc.main-{{closure}}.generator_resume.0.mir
0 commit comments