mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Remove Delimier::dummy_invisible
This commit is contained in:
parent
4ec81230db
commit
2c6ce480e3
5 changed files with 24 additions and 25 deletions
|
@ -62,13 +62,11 @@ impl<S: Span> TokenTree<S> {
|
|||
TokenTree::Subtree(s) => s,
|
||||
}
|
||||
}
|
||||
pub fn subtree_or_wrap2(self, span: DelimSpan<S>) -> Subtree<S> {
|
||||
|
||||
pub fn first_span(&self) -> S {
|
||||
match self {
|
||||
TokenTree::Leaf(_) => Subtree {
|
||||
delimiter: Delimiter::invisible_delim_spanned(span),
|
||||
token_trees: vec![self],
|
||||
},
|
||||
TokenTree::Subtree(s) => s,
|
||||
TokenTree::Leaf(l) => *l.span(),
|
||||
TokenTree::Subtree(s) => s.delimiter.open,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -141,11 +139,6 @@ impl<S: Span> Delimiter<S> {
|
|||
pub const DUMMY_INVISIBLE: Self =
|
||||
Self { open: S::DUMMY, close: S::DUMMY, kind: DelimiterKind::Invisible };
|
||||
|
||||
// FIXME should not exist
|
||||
pub const fn dummy_invisible() -> Self {
|
||||
Self::DUMMY_INVISIBLE
|
||||
}
|
||||
|
||||
pub const fn invisible_spanned(span: S) -> Self {
|
||||
Delimiter { open: span, close: span, kind: DelimiterKind::Invisible }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue