forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Milestone
Description
I was not able to try the following code with 1.63.0.1 due to an independent issue, but the following code compiles, then unexpectedly panics at runtime:
#[export_name = "app_main"]
pub extern "C" fn test() {
enum E {
A(u32),
B(u32),
}
#[inline(never)]
fn create_vec() -> Vec<E> {
vec![E::A(1), E::A(2), E::A(3), E::A(4)]
}
let vec = create_vec();
vec.iter()
.find(|e| match e {
E::A(id) if *id == 2 => true,
_ => false,
})
.expect("Failed to find element");
}
Metadata
Metadata
Assignees
Labels
No labels