Rollup merge of #145113 - petrochenkov:lessfinalize, r=lcnr

resolve: Do not finalize shadowed bindings

I.e. do not mark them as used, or non-speculatively loaded, or similar.
Previously they were sometimes finalized during early resolution, causing issues like https://github.com/rust-lang/rust/pull/144793#issuecomment-3168108005.
This commit is contained in:
Matthias Krüger 2025-09-26 18:11:08 +02:00 committed by GitHub
commit 21c3fe85d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 2 additions and 4 deletions

View file

@ -12,7 +12,7 @@ use tracing::debug;
use crate::{ use crate::{
ExpandError, ExpandResult, MacroCallId, ExpandError, ExpandResult, MacroCallId,
builtin::quote::{dollar_crate, quote}, builtin::quote::dollar_crate,
db::ExpandDatabase, db::ExpandDatabase,
hygiene::span_with_def_site_ctxt, hygiene::span_with_def_site_ctxt,
name::{self, AsName, Name}, name::{self, AsName, Name},

View file

@ -19,7 +19,7 @@ use syntax_bridge::syntax_node_to_token_tree;
use crate::{ use crate::{
EditionedFileId, ExpandError, ExpandResult, Lookup as _, MacroCallId, EditionedFileId, ExpandError, ExpandResult, Lookup as _, MacroCallId,
builtin::quote::{WithDelimiter, dollar_crate, quote}, builtin::quote::{WithDelimiter, dollar_crate},
db::ExpandDatabase, db::ExpandDatabase,
hygiene::{span_with_call_site_ctxt, span_with_def_site_ctxt}, hygiene::{span_with_call_site_ctxt, span_with_def_site_ctxt},
name, name,

View file

@ -229,8 +229,6 @@ mod tests {
use span::{Edition, ROOT_ERASED_FILE_AST_ID, SpanAnchor, SyntaxContext}; use span::{Edition, ROOT_ERASED_FILE_AST_ID, SpanAnchor, SyntaxContext};
use syntax::{TextRange, TextSize}; use syntax::{TextRange, TextSize};
use super::quote;
const DUMMY: tt::Span = tt::Span { const DUMMY: tt::Span = tt::Span {
range: TextRange::empty(TextSize::new(0)), range: TextRange::empty(TextSize::new(0)),
anchor: SpanAnchor { anchor: SpanAnchor {