diff --git a/reid/src/lib.rs b/reid/src/lib.rs index e80bcc4..15ff340 100644 --- a/reid/src/lib.rs +++ b/reid/src/lib.rs @@ -158,7 +158,7 @@ pub fn compile(source: &str, path: PathBuf) -> Result { println!("{}", &mir_context); - perform_all_passes(&mut mir_context); + perform_all_passes(&mut mir_context)?; let mut context = Context::new(); let codegen_modules = mir_context.codegen(&mut context); diff --git a/reid/src/mir/typeinference.rs b/reid/src/mir/typeinference.rs index 03f7968..2ca430b 100644 --- a/reid/src/mir/typeinference.rs +++ b/reid/src/mir/typeinference.rs @@ -9,7 +9,7 @@ use std::iter; use crate::{mir::TypeKind, util::try_all}; use super::{ - pass::{Pass, PassState, ScopeVariable}, + pass::{Pass, PassState}, typecheck::ErrorKind, typerefs::{ScopeTypeRefs, TypeRef, TypeRefs}, types::{pick_return, ReturnType}, @@ -43,7 +43,7 @@ impl FunctionDefinition { type_refs: &TypeRefs, state: &mut PassState, ) -> Result<(), ErrorKind> { - let mut scope_hints = ScopeTypeRefs::from(type_refs); + let scope_hints = ScopeTypeRefs::from(type_refs); for param in &self.parameters { let param_t = state.or_else(param.1.assert_known(), Vague(Unknown), self.signature()); let res = scope_hints