From ec60795575c29ee7fc2ea7507cfcc38958fe67bf Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 3 Feb 2020 15:05:34 +0100 Subject: =?UTF-8?q?Port=20tests=20=F0=9F=9A=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/syntax/span.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/syntax/span.rs') diff --git a/src/syntax/span.rs b/src/syntax/span.rs index 7a051d99..8973ef89 100644 --- a/src/syntax/span.rs +++ b/src/syntax/span.rs @@ -116,7 +116,7 @@ impl Debug for Span { } /// A value with the span it corresponds to in the source code. -#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Serialize)] +#[derive(Copy, Clone, Eq, PartialEq, Hash, Serialize)] pub struct Spanned { /// The value. pub v: T, @@ -147,6 +147,14 @@ impl Spanned { } } +impl Debug for Spanned { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + self.span.fmt(f)?; + f.write_str(": ")?; + self.v.fmt(f) + } +} + /// A vector of spanned things. pub type SpanVec = Vec>; -- cgit v1.2.3