Skip to content

Suspected miscompilation using 1.63.0.0 #134

@bugadani

Description

@bugadani

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
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions