refactor(tvix/eval): Drop LightSpan entirely
This was made unnecessary in c92d06271 (feat(tvix/eval): drop
LightSpan::Delayed, 2023-12-08) because it didn't improve benchmarks as
much as expected and has been vestigial since; this continues the
cleanup by just removing it altogether
Change-Id: I21ec7ae9b52a5cccd2092696a5a87f658194d672
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11949
Autosubmit: aspen <root@gws.fyi>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
This commit is contained in:
parent
8e31088a01
commit
6037888e18
8 changed files with 109 additions and 175 deletions
|
|
@ -5,37 +5,6 @@ use codemap::{File, Span};
|
|||
use rnix::ast;
|
||||
use rowan::ast::AstNode;
|
||||
|
||||
/// Helper struct to carry information required for making a span, but
|
||||
/// without actually performing the (expensive) span lookup.
|
||||
///
|
||||
/// This is used for tracking spans across thunk boundaries, as they
|
||||
/// are frequently instantiated but spans are only used in error or
|
||||
/// warning cases.
|
||||
#[derive(Clone, Debug)]
|
||||
pub enum LightSpan {
|
||||
/// The span has already been computed and can just be used right
|
||||
/// away.
|
||||
Actual { span: Span },
|
||||
}
|
||||
|
||||
impl LightSpan {
|
||||
pub fn new_actual(span: Span) -> Self {
|
||||
Self::Actual { span }
|
||||
}
|
||||
|
||||
pub fn span(&self) -> Span {
|
||||
match self {
|
||||
LightSpan::Actual { span } => *span,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Span> for LightSpan {
|
||||
fn from(span: Span) -> Self {
|
||||
LightSpan::Actual { span }
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait implemented by all types from which we can retrieve a span.
|
||||
pub trait ToSpan {
|
||||
fn span_for(&self, file: &File) -> Span;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue