Skip to content

Commit 8146755

Browse files
TomAFrenchasterite
andauthored
chore: address TODO comments (#9379)
Co-authored-by: Ary Borenszweig <[email protected]>
1 parent d7e2c17 commit 8146755

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

compiler/noirc_evaluator/src/acir/mod.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -806,17 +806,13 @@ impl<'a> Context<'a> {
806806
let outputs = self
807807
.convert_ssa_intrinsic_call(*intrinsic, arguments, dfg, result_ids)?;
808808

809-
// Issue #1438 causes this check to fail with intrinsics that return 0
810-
// results but the ssa form instead creates 1 unit result value.
811-
// assert_eq!(result_ids.len(), outputs.len());
809+
assert_eq!(result_ids.len(), outputs.len());
812810
self.handle_ssa_call_outputs(result_ids, outputs, dfg)?;
813811
}
814-
Value::ForeignFunction(_) => {
815-
// TODO: Remove this once elaborator is default frontend. This is now caught by a lint inside the frontend.
816-
return Err(RuntimeError::UnconstrainedOracleReturnToConstrained {
817-
call_stack: self.acir_context.get_call_stack(),
818-
});
819-
}
812+
Value::ForeignFunction(_) => unreachable!(
813+
"Frontend should remove any oracle calls from constrained functions"
814+
),
815+
820816
_ => unreachable!("expected calling a function but got {function_value:?}"),
821817
}
822818
}

compiler/noirc_evaluator/src/errors.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ pub enum RuntimeError {
6464
BigIntModulus { call_stack: CallStack },
6565
#[error("Slices cannot be returned from an unconstrained runtime to a constrained runtime")]
6666
UnconstrainedSliceReturnToConstrained { call_stack: CallStack },
67-
#[error("All `oracle` methods should be wrapped in an unconstrained fn")]
68-
UnconstrainedOracleReturnToConstrained { call_stack: CallStack },
6967
#[error(
7068
"Could not resolve some references to the array. All references must be resolved at compile time"
7169
)]
@@ -200,7 +198,6 @@ impl RuntimeError {
200198
| RuntimeError::NestedSlice { call_stack, .. }
201199
| RuntimeError::BigIntModulus { call_stack, .. }
202200
| RuntimeError::UnconstrainedSliceReturnToConstrained { call_stack }
203-
| RuntimeError::UnconstrainedOracleReturnToConstrained { call_stack }
204201
| RuntimeError::ReturnedReferenceFromDynamicIf { call_stack }
205202
| RuntimeError::ReturnedFunctionFromDynamicIf { call_stack }
206203
| RuntimeError::BreakOrContinue { call_stack }

0 commit comments

Comments
 (0)