internal: Remove span trait

This commit is contained in:
Lukas Wirth 2024-03-21 20:08:30 +01:00
parent 2ad14b8069
commit cd8eb0fe6d
11 changed files with 52 additions and 55 deletions

View file

@ -101,6 +101,8 @@ pub(super) struct TokenStreamBuilder<S> {
/// pub(super)lic implementation details for the `TokenStream` type, such as iterators.
pub(super) mod token_stream {
use core::fmt;
use super::{TokenStream, TokenTree};
/// An iterator over `TokenStream`'s `TokenTree`s.
@ -122,7 +124,7 @@ pub(super) mod token_stream {
///
/// NOTE: some errors may cause panics instead of returning `LexError`. We reserve the right to
/// change these errors into `LexError`s later.
impl<S: tt::Span> TokenStream<S> {
impl<S: Copy + fmt::Debug> TokenStream<S> {
pub(crate) fn from_str(src: &str, call_site: S) -> Result<TokenStream<S>, String> {
let subtree =
mbe::parse_to_token_tree_static_span(call_site, src).ok_or("lexing error")?;