Merge pull request #18410 from Veykril/veykril/push-lvwxpnowqrxk

internal: Invert token iteration order in macro mapping
This commit is contained in:
Lukas Wirth 2024-10-27 10:44:32 +00:00 committed by GitHub
commit 715b67c425
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 67 additions and 58 deletions

View file

@ -945,6 +945,10 @@ impl<'db> SemanticsImpl<'db> {
};
while let Some((expansion, ref mut tokens)) = stack.pop() {
// Reverse the tokens so we prefer first tokens (to accommodate for popping from the
// back)
// alternatively we could pop from the front but that would shift the content on every pop
tokens.reverse();
while let Some((token, ctx)) = tokens.pop() {
let was_not_remapped = (|| {
// First expand into attribute invocations