Skip to content

Commit 182f6e8

Browse files
committed
Seal the Spanned trait
1 parent 157a12b commit 182f6e8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/spanned.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ use quote::spanned::Spanned as ToTokens;
9393
/// See the [module documentation] for an example.
9494
///
9595
/// [module documentation]: self
96-
pub trait Spanned {
96+
pub trait Spanned: private::Sealed {
9797
/// Returns a `Span` covering the complete contents of this syntax tree
9898
/// node, or [`Span::call_site()`] if this node is empty.
9999
///
@@ -106,3 +106,10 @@ impl<T: ?Sized + ToTokens> Spanned for T {
106106
self.__span()
107107
}
108108
}
109+
110+
mod private {
111+
use super::*;
112+
113+
pub trait Sealed {}
114+
impl<T: ?Sized + ToTokens> Sealed for T {}
115+
}

0 commit comments

Comments
 (0)