From 6f8c99ed4c1aa9077df3fe3a2b321271ed257a0d Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Fri, 8 Mar 2024 17:40:07 +0000 Subject: [PATCH] Correctly report source compilation diagnostics --- src/scripting/runtime.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripting/runtime.rs b/src/scripting/runtime.rs index 3c64a2e..fa05724 100644 --- a/src/scripting/runtime.rs +++ b/src/scripting/runtime.rs @@ -23,17 +23,17 @@ impl Runtime { let mut diagnostics = Diagnostics::new(); let (mut sources, source_paths) = Self::get_sources(source_dir)?; - let unit = rune::prepare(&mut sources) + let result = rune::prepare(&mut sources) .with_context(&context) .with_diagnostics(&mut diagnostics) - .build()?; + .build(); if !diagnostics.is_empty() { let mut writer = StandardStream::stderr(ColorChoice::Always); diagnostics.emit(&mut writer, &sources)?; } - let vm = Vm::new(runtime, Arc::new(unit)); + let vm = Vm::new(runtime, Arc::new(result?)); Ok(Self { vm,