diff --git a/examples/ptr_hard.reid b/examples/ptr_hard.reid index 5f1d9d2..a83b06c 100644 --- a/examples/ptr_hard.reid +++ b/examples/ptr_hard.reid @@ -1,6 +1,7 @@ -fn main() { +fn main() -> u8 { let mut a = 5; inner(&mut a); + return 0; } fn inner(a: &mut i32) { diff --git a/reid/src/codegen.rs b/reid/src/codegen.rs index 421f2ab..ccd3ec7 100644 --- a/reid/src/codegen.rs +++ b/reid/src/codegen.rs @@ -1179,7 +1179,7 @@ impl mir::Expression { Some({ if state.should_load { - if let TypeKind::CodegenPtr(inner) = *ptr_inner.clone() { + if let TypeKind::Borrow(inner, _) = *ptr_inner.clone() { StackValue( v.0.derive( scope