Some more minor cleanups

This commit is contained in:
Lukas Wirth 2023-12-02 16:50:21 +01:00
parent 5edf7bddc6
commit 02a3a9438a
7 changed files with 65 additions and 21 deletions

View file

@ -557,11 +557,6 @@ impl<'db> SemanticsImpl<'db> {
.span_at(token.text_range().start()),
};
// fetch span information of token in real file, then use that look through expansions of
// calls the token is in and afterwards recursively with the same span.
// what about things where spans change? Due to being joined etc, that is we don't find the
// exact span anymore?
let def_map = sa.resolver.def_map();
let mut stack: SmallVec<[_; 4]> = smallvec![InFile::new(sa.file_id, token)];
@ -580,7 +575,7 @@ impl<'db> SemanticsImpl<'db> {
let len = stack.len();
// requeue the tokens we got from mapping our current token down
stack.extend(mapped_tokens);
stack.extend(mapped_tokens.map(Into::into));
// if the length changed we have found a mapping for the token
(stack.len() != len).then_some(())
};