mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
internal: Remove span trait
This commit is contained in:
parent
2ad14b8069
commit
cd8eb0fe6d
11 changed files with 52 additions and 55 deletions
|
@ -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")?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue