refactor(tvix/eval): rename CompilationResult -> CompilationOutput

grfn pointed out in cl/6174 that `Result` might cause developers to
believe that this behaves like std::Result, which it does not.

Change-Id: Ia30ab0dcb7e8da7bf842777ee3fe17bcf35cb0c1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6281
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
Vincent Ambo 2022-08-26 20:17:40 +03:00 committed by tazjin
parent 7d34e6e880
commit 3b64b7eb2e

View file

@ -29,7 +29,7 @@ use crate::warnings::{EvalWarning, WarningKind};
/// Represents the result of compiling a piece of Nix code. If /// Represents the result of compiling a piece of Nix code. If
/// compilation was successful, the resulting bytecode can be passed /// compilation was successful, the resulting bytecode can be passed
/// to the VM. /// to the VM.
pub struct CompilationResult { pub struct CompilationOutput {
pub lambda: Lambda, pub lambda: Lambda,
pub warnings: Vec<EvalWarning>, pub warnings: Vec<EvalWarning>,
pub errors: Vec<Error>, pub errors: Vec<Error>,
@ -1070,7 +1070,7 @@ pub fn compile(
expr: ast::Expr, expr: ast::Expr,
location: Option<PathBuf>, location: Option<PathBuf>,
globals: HashMap<&'static str, Value>, globals: HashMap<&'static str, Value>,
) -> EvalResult<CompilationResult> { ) -> EvalResult<CompilationOutput> {
let mut root_dir = match location { let mut root_dir = match location {
Some(dir) => Ok(dir), Some(dir) => Ok(dir),
None => std::env::current_dir().map_err(|e| { None => std::env::current_dir().map_err(|e| {
@ -1095,7 +1095,7 @@ pub fn compile(
c.compile(expr); c.compile(expr);
Ok(CompilationResult { Ok(CompilationOutput {
lambda: c.contexts.pop().unwrap().lambda, lambda: c.contexts.pop().unwrap().lambda,
warnings: c.warnings, warnings: c.warnings,
errors: c.errors, errors: c.errors,