mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
27 lines
488 B
Rust
27 lines
488 B
Rust
//! 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 generator_tiny.main-{closure#0}.generator_resume.0.mir
|
|
fn main() {
|
|
let _gen = |_x: u8| {
|
|
let _d = HasDrop;
|
|
loop {
|
|
yield;
|
|
callee();
|
|
}
|
|
};
|
|
}
|