diff options
Diffstat (limited to 'src/eval/control.rs')
| -rw-r--r-- | src/eval/control.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/eval/control.rs b/src/eval/control.rs index b310bfb8..166676d4 100644 --- a/src/eval/control.rs +++ b/src/eval/control.rs @@ -1,5 +1,5 @@ use super::{ops, EvalResult, Value}; -use crate::diag::{At, Error, TypError}; +use crate::diag::{At, TypError}; use crate::syntax::Span; /// A control flow event that occurred during evaluation. @@ -25,12 +25,14 @@ impl From<TypError> for Control { impl From<Control> for TypError { fn from(control: Control) -> Self { match control { - Control::Break(_, span) => Error::boxed(span, "cannot break outside of loop"), + Control::Break(_, span) => { + error!(span, "cannot break outside of loop") + } Control::Continue(_, span) => { - Error::boxed(span, "cannot continue outside of loop") + error!(span, "cannot continue outside of loop") } Control::Return(_, _, span) => { - Error::boxed(span, "cannot return outside of function") + error!(span, "cannot return outside of function") } Control::Err(e) => e, } |
