From bab0e23e7910b9e027db51e22e1a6adbe758aa93 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 18 Jul 2023 17:08:17 +0100 Subject: [PATCH] Unseal Spanned again Spanned was not sealed in syn 1. Currently in syn 2 it is nominally sealed, but since quote::ToTokens isn't sealed, Spanned *can* be implemented for any foreign type, provided one is willing to provide a (possibly broken) implemntation of ToTokens. This means that sealing Spanned has no semver advantage, and neither does it defend syn from any bad behaviour on the part of downstream implementors. See https://github.com/dtolnay/syn/issues/1441 --- src/spanned.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spanned.rs b/src/spanned.rs index 98aa0aa1e7..9f65db5f28 100644 --- a/src/spanned.rs +++ b/src/spanned.rs @@ -93,7 +93,7 @@ use quote::spanned::Spanned as ToTokens; /// See the [module documentation] for an example. /// /// [module documentation]: self -pub trait Spanned: private::Sealed { +pub trait Spanned { /// Returns a `Span` covering the complete contents of this syntax tree /// node, or [`Span::call_site()`] if this node is empty. ///