Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
430d353
Drop armebv7r-none-eabi* to Tier 3
thejpster Sep 7, 2025
7eea65f
Stop linking rs{begin,end} on x86_64-*-windows-gnu
mati865 Sep 19, 2025
e99e226
Switch `dummy_bang` from `LegacyBang` to `Bang`
joshtriplett Sep 21, 2025
a1646bf
mbe: Switch dummy extension used for errors from `LegacyBang` to `Bang`
joshtriplett Sep 21, 2025
9acc63a
port `#[debugger_visualizer]` to the new attribute system
jdonszelmann Sep 18, 2025
d226e7a
Use standard attribute logic for allocator shim
nikic Sep 19, 2025
9e3f748
mbe: Simplify check_redundant_vis_repetition
joshtriplett Sep 25, 2025
f89660e
resolve: Do not finalize shadowed bindings
petrochenkov Aug 1, 2025
0374fc5
Rename `rust.use-lld` to `rust.bootstrap-override-lld`
Kobzol Sep 25, 2025
fc703ec
fix doc comments to be more standard
hkBst Sep 25, 2025
7a2c173
Add new `tyalias` intra-doc link disambiguator
GuillaumeGomez Sep 25, 2025
dba45cd
Add tests for new `tyalias` intra-doc link disambiguator
GuillaumeGomez Sep 25, 2025
62c457b
Mention `tyalias` in intra-doc link rustdoc book chapter
GuillaumeGomez Sep 25, 2025
a535c7b
Ignore more failing ui tests for GCC backend
GuillaumeGomez Sep 26, 2025
ae70e6b
Rollup merge of #145113 - petrochenkov:lessfinalize, r=lcnr
matthiaskrgr Sep 26, 2025
10b98d6
Rollup merge of #146523 - thejpster:demote-armebv7r-targets, r=jackh726
matthiaskrgr Sep 26, 2025
48884f0
Rollup merge of #146704 - jdonszelmann:port-debug-visualizer, r=petro…
matthiaskrgr Sep 26, 2025
bfd21c1
Rollup merge of #146758 - mati865:amd64_mingw_no_rs_objects, r=petroc…
matthiaskrgr Sep 26, 2025
178f50b
Rollup merge of #146778 - nikic:allocator-shim-attributes, r=jackh726
matthiaskrgr Sep 26, 2025
e497ed3
Rollup merge of #146849 - joshtriplett:macro-reduce-legacy-bang, r=pe…
matthiaskrgr Sep 26, 2025
c1ee12c
Rollup merge of #147016 - hkBst:whitespace-1, r=nnethercote
matthiaskrgr Sep 26, 2025
c0502cf
Rollup merge of #147027 - GuillaumeGomez:tyalias-disambiguator, r=lol…
matthiaskrgr Sep 26, 2025
66cfbfe
Rollup merge of #147031 - joshtriplett:mbe-opt-collect, r=lcnr
matthiaskrgr Sep 26, 2025
9d33ef3
Rollup merge of #147046 - Kobzol:bootstrap-ll, r=jieyouxu
matthiaskrgr Sep 26, 2025
69a3cac
Rollup merge of #147058 - GuillaumeGomez:ignore-more-ui-tests, r=Kobzol
matthiaskrgr Sep 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
resolve: Do not finalize shadowed bindings
I.e. do not mark them as used, or non-speculative loaded, or similar.
Previously they were sometimes finalized during early resolution, causing issues like #144793 (comment).
  • Loading branch information
petrochenkov committed Sep 25, 2025
commit f89660e4aa018401ca993f0df190e5f4c4a6799b
2 changes: 1 addition & 1 deletion compiler/rustc_macros/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use syn::punctuated::Punctuated;
use syn::spanned::Spanned;
use syn::{
AttrStyle, Attribute, Block, Error, Expr, Ident, Pat, ReturnType, Token, Type, braced,
parenthesized, parse_macro_input, parse_quote, token,
parenthesized, parse_macro_input, token,
};

mod kw {
Expand Down
11 changes: 6 additions & 5 deletions compiler/rustc_resolve/src/ident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,14 +492,13 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
_ => Err(Determinacy::Determined),
},
Scope::Module(module, derive_fallback_lint_id) => {
// FIXME: use `finalize_scope` here.
let (adjusted_parent_scope, adjusted_finalize) =
if matches!(scope_set, ScopeSet::ModuleAndExternPrelude(..)) {
(parent_scope, finalize)
(parent_scope, finalize_scope!())
} else {
(
&ParentScope { module, ..*parent_scope },
finalize.map(|f| Finalize { used: Used::Scope, ..f }),
finalize_scope!().map(|f| Finalize { used: Used::Scope, ..f }),
)
};
let binding = this.reborrow().resolve_ident_in_module_unadjusted(
Expand Down Expand Up @@ -557,8 +556,10 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
None => Err(Determinacy::Determined),
},
Scope::ExternPreludeItems => {
// FIXME: use `finalize_scope` here.
match this.reborrow().extern_prelude_get_item(ident, finalize.is_some()) {
match this
.reborrow()
.extern_prelude_get_item(ident, finalize_scope!().is_some())
{
Some(binding) => {
extern_prelude_item_binding = Some(binding);
Ok((binding, Flags::empty()))
Expand Down
1 change: 0 additions & 1 deletion library/alloctests/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#![deny(unsafe_op_in_unsafe_fn)]

extern crate alloc;
extern crate test;

use std::hash::{DefaultHasher, Hash, Hasher};

Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/unix/stack_overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ mod imp {
use crate::sync::OnceLock;
use crate::sync::atomic::{Atomic, AtomicBool, AtomicPtr, AtomicUsize, Ordering};
use crate::sys::pal::unix::os;
use crate::{io, mem, panic, ptr};
use crate::{io, mem, ptr};

// Signal handler for the SIGSEGV and SIGBUS handlers. We've got guard pages
// (unmapped pages) at the end of every thread's stack, so if a thread ends
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/useless_attribute.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ pub mod redundant_imports_issue {
() => {};
}

#[expect(redundant_imports)]
#[expect(unused_imports)]
pub(crate) use empty;

empty!();
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/tests/ui/useless_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ pub mod redundant_imports_issue {
() => {};
}

#[expect(redundant_imports)]
#[expect(unused_imports)]
pub(crate) use empty;

empty!();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use tracing::debug;

use crate::{
ExpandError, ExpandResult, MacroCallId,
builtin::quote::{dollar_crate, quote},
builtin::quote::dollar_crate,
db::ExpandDatabase,
hygiene::span_with_def_site_ctxt,
name::{self, AsName, Name},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use syntax_bridge::syntax_node_to_token_tree;

use crate::{
EditionedFileId, ExpandError, ExpandResult, Lookup as _, MacroCallId,
builtin::quote::{WithDelimiter, dollar_crate, quote},
builtin::quote::{WithDelimiter, dollar_crate},
db::ExpandDatabase,
hygiene::{span_with_call_site_ctxt, span_with_def_site_ctxt},
name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,6 @@ mod tests {
use span::{Edition, ROOT_ERASED_FILE_AST_ID, SpanAnchor, SyntaxContext};
use syntax::{TextRange, TextSize};

use super::quote;

const DUMMY: tt::Span = tt::Span {
range: TextRange::empty(TextSize::new(0)),
anchor: SpanAnchor {
Expand Down
1 change: 0 additions & 1 deletion src/tools/rustfmt/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,6 @@ mod test {
#[allow(dead_code)]
mod mock {
use super::super::*;
use crate::config_option_with_style_edition_default;
use rustfmt_config_proc_macro::config_type;

#[config_type]
Expand Down
13 changes: 13 additions & 0 deletions tests/ui/resolve/unused-macro-import.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//@ check-pass

#![warn(unused_imports)]

#[macro_export]
macro_rules! mac { () => {} }

fn main() {
// Unused, `mac` as `macro_rules!` is already in scope and has higher priority.
use crate::mac; //~ WARN unused import: `crate::mac`

mac!();
}
14 changes: 14 additions & 0 deletions tests/ui/resolve/unused-macro-import.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
warning: unused import: `crate::mac`
--> $DIR/unused-macro-import.rs:10:9
|
LL | use crate::mac;
| ^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/unused-macro-import.rs:3:9
|
LL | #![warn(unused_imports)]
| ^^^^^^^^^^^^^^

warning: 1 warning emitted

Loading