diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 2e29db56c0..ad1e872172 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -367,7 +367,8 @@ impl<'a> FunctionBuilder<'a> { /// Returns an object with the [`InstBuilder`](../codegen/ir/builder/trait.InstBuilder.html) /// trait that allows to conveniently append an instruction to the current `Ebb` being built. pub fn ins<'short>(&'short mut self) -> FuncInstBuilder<'short, 'a> { - let ebb = self.position.ebb.unwrap(); + let ebb = self.position.ebb + .expect("Please call switch_to_block before inserting instructions"); FuncInstBuilder::new(self, ebb) }