From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- third_party/rust/wast/src/wat.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'third_party/rust/wast/src/wat.rs') diff --git a/third_party/rust/wast/src/wat.rs b/third_party/rust/wast/src/wat.rs index 6d9a233359..d4982264fa 100644 --- a/third_party/rust/wast/src/wat.rs +++ b/third_party/rust/wast/src/wat.rs @@ -32,6 +32,14 @@ impl Wat<'_> { Wat::Component(c) => c.encode(), } } + + /// Returns the defining span of this file. + pub fn span(&self) -> Span { + match self { + Wat::Module(m) => m.span, + Wat::Component(c) => c.span, + } + } } impl<'a> Parse<'a> for Wat<'a> { -- cgit v1.2.3