blob: c86e2865ca8a48970baf96c344a049503f35bde5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
//! Tests that generators that cannot return or unwind don't have unnecessary
//! panic branches.
// compile-flags: -C panic=abort
// no-prefer-dynamic
#![feature(generators, generator_trait)]
struct HasDrop;
impl Drop for HasDrop {
fn drop(&mut self) {}
}
fn callee() {}
// EMIT_MIR rustc.main-{{closure}}.generator_resume.0.mir
fn main() {
let _gen = |_x: u8| {
let _d = HasDrop;
loop {
yield;
callee();
}
};
}
|