diff --git a/lib/shared/src/datetime.rs b/lib/shared/src/datetime.rs index 7d0b60727629fe..839e209bc04d98 100644 --- a/lib/shared/src/datetime.rs +++ b/lib/shared/src/datetime.rs @@ -1,7 +1,7 @@ use chrono::{DateTime, Local, ParseError, TimeZone as _, Utc}; use chrono_tz::Tz; use derivative::Derivative; -use std::fmt::{self, Debug}; +use std::fmt::Debug; #[derive(Clone, Copy, Debug, Derivative, Eq, PartialEq)] #[derivative(Default)] @@ -58,7 +58,7 @@ pub mod ser_de { impl<'de> de::Visitor<'de> for TimeZoneVisitor { type Value = TimeZone; - fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "a time zone name") } diff --git a/lib/vrl/compiler/Cargo.toml b/lib/vrl/compiler/Cargo.toml index c7598041f5100f..21249c94dc2edd 100644 --- a/lib/vrl/compiler/Cargo.toml +++ b/lib/vrl/compiler/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] diagnostic = { package = "vrl-diagnostic", path = "../diagnostic" } parser = { package = "vrl-parser", path = "../parser" } -shared = { path = "../../shared", default-features = false } +shared = { path = "../../shared", default-features = false, features = ["conversion"] } lookup = { path = "../../lookup" } bitflags = "1" diff --git a/lib/vrl/compiler/src/expression/function_call.rs b/lib/vrl/compiler/src/expression/function_call.rs index f893b9b48b1f8a..ad838e8723da38 100644 --- a/lib/vrl/compiler/src/expression/function_call.rs +++ b/lib/vrl/compiler/src/expression/function_call.rs @@ -4,7 +4,6 @@ use crate::parser::{Ident, Node}; use crate::{value::Kind, Context, Expression, Function, Resolved, Span, State, TypeDef}; use diagnostic::{DiagnosticError, Label, Note, Urls}; use std::fmt; -use tracing::{span, Level}; #[derive(Clone)] pub struct FunctionCall { @@ -204,31 +203,29 @@ impl FunctionCall { impl Expression for FunctionCall { fn resolve(&self, ctx: &mut Context) -> Resolved { - span!(Level::ERROR, "remap", vrl_position = &self.span.start()).in_scope(|| { - self.expr.resolve(ctx).map_err(|err| match err { - ExpressionError::Abort { .. } => { - panic!("abort errors must only be defined by `abort` statement") - } + self.expr.resolve(ctx).map_err(|err| match err { + ExpressionError::Abort { .. } => { + panic!("abort errors must only be defined by `abort` statement") + } + ExpressionError::Error { + message, + mut labels, + notes, + } => { + labels.push(Label::primary(message.clone(), self.span)); + ExpressionError::Error { - message, - mut labels, + message: format!( + r#"function call error for "{}" at ({}:{}): {}"#, + self.ident, + self.span.start(), + self.span.end(), + message + ), + labels, notes, - } => { - labels.push(Label::primary(message.clone(), self.span)); - - ExpressionError::Error { - message: format!( - r#"function call error for "{}" at ({}:{}): {}"#, - self.ident, - self.span.start(), - self.span.end(), - message - ), - labels, - notes, - } } - }) + } }) }