Skip to content

Commit dec3041

Browse files
committed
Auto merge of #153538 - JonathanBrouwer:rollup-vxnszYl, r=<try>
Rollup of 3 pull requests try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1
2 parents ea5573a + 701acb7 commit dec3041

111 files changed

Lines changed: 806 additions & 816 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

compiler/rustc_ast/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//! This API is completely unstable and subject to change.
66
77
// tidy-alphabetical-start
8-
#![cfg_attr(bootstrap, feature(if_let_guard))]
98
#![doc(test(attr(deny(warnings), allow(internal_features))))]
109
#![feature(associated_type_defaults)]
1110
#![feature(box_patterns)]

compiler/rustc_ast/src/visit.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,8 +762,7 @@ macro_rules! common_visitor_and_walkers {
762762
// This is only used by the MutVisitor. We include this symmetry here to make writing other
763763
// functions easier.
764764
$(${ignore($lt)}
765-
#[cfg_attr(not(bootstrap), expect(unused, rustc::disallowed_pass_by_ref))]
766-
#[cfg_attr(bootstrap, expect(unused, rustc::pass_by_value))]
765+
#[expect(unused, rustc::disallowed_pass_by_ref)]
767766
#[inline]
768767
)?
769768
fn visit_span<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, span: &$($lt)? $($mut)? Span) -> V::Result {

compiler/rustc_ast_lowering/src/delegation.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,19 @@ use ast::visit::Visitor;
4242
use hir::def::{DefKind, PartialRes, Res};
4343
use hir::{BodyId, HirId};
4444
use rustc_abi::ExternAbi;
45+
use rustc_ast as ast;
4546
use rustc_ast::*;
4647
use rustc_attr_parsing::{AttributeParser, ShouldEmit};
4748
use rustc_data_structures::fx::FxHashSet;
4849
use rustc_errors::ErrorGuaranteed;
50+
use rustc_hir as hir;
4951
use rustc_hir::attrs::{AttributeKind, InlineAttr};
5052
use rustc_hir::def_id::{DefId, LocalDefId};
5153
use rustc_middle::span_bug;
5254
use rustc_middle::ty::{Asyncness, DelegationAttrs, DelegationFnSigAttrs, ResolverAstLowering};
5355
use rustc_span::symbol::kw;
5456
use rustc_span::{DUMMY_SP, Ident, Span, Symbol};
5557
use smallvec::SmallVec;
56-
use {rustc_ast as ast, rustc_hir as hir};
5758

5859
use crate::delegation::generics::{GenericsGenerationResult, GenericsGenerationResults};
5960
use crate::errors::{CycleInDelegationSignatureResolution, UnresolvedDelegationCallee};
@@ -815,13 +816,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
815816
}
816817
}
817818

818-
struct SelfResolver<'a> {
819-
resolver: &'a mut ResolverAstLowering,
819+
struct SelfResolver<'a, 'tcx> {
820+
resolver: &'a mut ResolverAstLowering<'tcx>,
820821
path_id: NodeId,
821822
self_param_id: NodeId,
822823
}
823824

824-
impl<'a> SelfResolver<'a> {
825+
impl SelfResolver<'_, '_> {
825826
fn try_replace_id(&mut self, id: NodeId) {
826827
if let Some(res) = self.resolver.partial_res_map.get(&id)
827828
&& let Some(Res::Local(sig_id)) = res.full_res()
@@ -833,7 +834,7 @@ impl<'a> SelfResolver<'a> {
833834
}
834835
}
835836

836-
impl<'ast, 'a> Visitor<'ast> for SelfResolver<'a> {
837+
impl<'ast, 'a> Visitor<'ast> for SelfResolver<'a, '_> {
837838
fn visit_id(&mut self, id: NodeId) {
838839
self.try_replace_id(id);
839840
}

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use super::{
2727

2828
pub(super) struct ItemLowerer<'a, 'hir> {
2929
pub(super) tcx: TyCtxt<'hir>,
30-
pub(super) resolver: &'a mut ResolverAstLowering,
30+
pub(super) resolver: &'a mut ResolverAstLowering<'hir>,
3131
pub(super) ast_index: &'a IndexSlice<LocalDefId, AstOwner<'a>>,
3232
pub(super) owners: &'a mut IndexVec<LocalDefId, hir::MaybeOwner<'hir>>,
3333
}

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
//! in the HIR, especially for multiple identifiers.
3232
3333
// tidy-alphabetical-start
34-
#![cfg_attr(bootstrap, feature(if_let_guard))]
3534
#![feature(box_patterns)]
3635
#![recursion_limit = "256"]
3736
// tidy-alphabetical-end
@@ -99,7 +98,7 @@ struct LoweringContext<'a, 'hir> {
9998
// will be in AST index.
10099
ast_index: &'a IndexSlice<LocalDefId, AstOwner<'a>>,
101100

102-
resolver: &'a mut ResolverAstLowering,
101+
resolver: &'a mut ResolverAstLowering<'hir>,
103102
disambiguator: DisambiguatorState,
104103

105104
/// Used to allocate HIR nodes.
@@ -133,7 +132,7 @@ struct LoweringContext<'a, 'hir> {
133132

134133
current_hir_id_owner: hir::OwnerId,
135134
item_local_id_counter: hir::ItemLocalId,
136-
trait_map: ItemLocalMap<Box<[TraitCandidate]>>,
135+
trait_map: ItemLocalMap<&'hir [TraitCandidate<'hir>]>,
137136

138137
impl_trait_defs: Vec<hir::GenericParam<'hir>>,
139138
impl_trait_bounds: Vec<hir::WherePredicate<'hir>>,
@@ -162,7 +161,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
162161
fn new(
163162
tcx: TyCtxt<'hir>,
164163
ast_index: &'a IndexSlice<LocalDefId, AstOwner<'a>>,
165-
resolver: &'a mut ResolverAstLowering,
164+
resolver: &'a mut ResolverAstLowering<'hir>,
166165
) -> Self {
167166
let registered_tools = tcx.registered_tools(()).iter().map(|x| x.name).collect();
168167
Self {
@@ -248,7 +247,7 @@ impl SpanLowerer {
248247
}
249248

250249
#[extension(trait ResolverAstLoweringExt)]
251-
impl ResolverAstLowering {
250+
impl ResolverAstLowering<'_> {
252251
fn legacy_const_generic_args(&self, expr: &Expr, tcx: TyCtxt<'_>) -> Option<Vec<usize>> {
253252
let ExprKind::Path(None, path) = &expr.kind else {
254253
return None;
@@ -748,8 +747,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
748747
self.children.push((def_id, hir::MaybeOwner::NonOwner(hir_id)));
749748
}
750749

751-
if let Some(traits) = self.resolver.trait_map.remove(&ast_node_id) {
752-
self.trait_map.insert(hir_id.local_id, traits.into_boxed_slice());
750+
if let Some(&traits) = self.resolver.trait_map.get(&ast_node_id) {
751+
self.trait_map.insert(hir_id.local_id, traits);
753752
}
754753

755754
// Check whether the same `NodeId` is lowered more than once.

compiler/rustc_ast_passes/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//! by `rustc_ast_lowering`.
44
55
// tidy-alphabetical-start
6-
#![cfg_attr(bootstrap, feature(if_let_guard))]
76
#![feature(box_patterns)]
87
#![feature(iter_intersperse)]
98
#![feature(iter_is_partitioned)]

compiler/rustc_attr_parsing/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
//! containing both `C` and `packed` annotations.
7878
7979
// tidy-alphabetical-start
80-
#![cfg_attr(bootstrap, feature(if_let_guard))]
8180
#![feature(decl_macro)]
8281
#![feature(iter_intersperse)]
8382
#![recursion_limit = "256"]

compiler/rustc_borrowck/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
33
// tidy-alphabetical-start
44
#![allow(internal_features)]
5-
#![cfg_attr(bootstrap, feature(assert_matches))]
6-
#![cfg_attr(bootstrap, feature(if_let_guard))]
75
#![feature(box_patterns)]
86
#![feature(default_field_values)]
97
#![feature(file_buffered)]

compiler/rustc_builtin_macros/src/asm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
use rustc_ast as ast;
12
use rustc_ast::tokenstream::TokenStream;
23
use rustc_ast::{AsmMacro, token};
34
use rustc_data_structures::fx::{FxHashMap, FxIndexMap};
45
use rustc_errors::PResult;
56
use rustc_expand::base::*;
67
use rustc_index::bit_set::GrowableBitSet;
78
use rustc_parse::parser::asm::*;
9+
use rustc_parse_format as parse;
810
use rustc_session::lint;
911
use rustc_span::{ErrorGuaranteed, InnerSpan, Span, Symbol, sym};
1012
use rustc_target::asm::InlineAsmArch;
1113
use smallvec::smallvec;
12-
use {rustc_ast as ast, rustc_parse_format as parse};
1314

1415
use crate::errors;
1516
use crate::util::{ExprToSpannedString, expr_to_spanned_string};

compiler/rustc_builtin_macros/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
44
// tidy-alphabetical-start
55
#![allow(internal_features)]
6-
#![cfg_attr(bootstrap, feature(assert_matches))]
7-
#![cfg_attr(bootstrap, feature(if_let_guard))]
86
#![feature(box_patterns)]
97
#![feature(decl_macro)]
108
#![feature(iter_order_by)]

0 commit comments

Comments
 (0)