Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
d780821
Ensure inferred let pattern types are well-formed
s7tya May 27, 2026
9633071
Don't suggest wrong unwrap expect
lokirithm May 31, 2026
2314457
borrowck: avoid ICE describing fields on generic params
pbkx Jun 1, 2026
b573841
Use a placeholder self type for escaping dyn principals in WF
Dnreikronos Jun 2, 2026
0676d4a
Add regression tests for WF-checking dyn in HRTB bounds
Dnreikronos Jun 2, 2026
de37dfd
Add or_try_* variants for HashMap Entry API
peterjoel Feb 6, 2024
92175ed
platform support: add SNaN erratum to MIPS targets
RalfJung Jun 2, 2026
51001cf
Make the retained dep graph deterministic under the parallel frontend
xmakro Jun 3, 2026
d00722c
Re-enable dep-graph ui tests under the parallel frontend
xmakro Jun 3, 2026
5a7ca04
Use field-index fallback for undescribed fields
pbkx Jun 5, 2026
c1cd236
Attribute post-monomorphization error notes by emitting thread
xmakro Jun 5, 2026
2e128c7
Re-enable parallel frontend tests for post-monomorphization errors
xmakro Jun 5, 2026
3ecbb39
Update `browser-ui-test` version to `0.24.0`
GuillaumeGomez Jun 8, 2026
0d980a5
Update nodejs version used in CI to `24.15.0`
GuillaumeGomez Jun 8, 2026
1e125ce
Support defaults for static EIIs
AsakuraMizu May 14, 2026
3669c24
Allow escaping self types in ExistentialTraitRef::with_self_ty
Dnreikronos Jun 9, 2026
e069f47
Add a regression test
oli-obk Jun 8, 2026
947a5b6
Mark `trait_info_of` as comptime and adjust the compiler to handle it
oli-obk Jun 8, 2026
b3c6e82
Mark more reflection things as comptime
oli-obk Jun 8, 2026
5bc21b1
Fix parser error recovery for 'dyn' in Rust 2015
i-like-ICEs Jun 9, 2026
c010b25
Implement or_try_* methods on BTreeMap Entry API
asder8215 Jun 3, 2026
6324b4a
Add flush strategy to allow observing bytes before they are flushed.
Daniel-B-Smith Jun 8, 2026
8ee1dfa
Move symbol hiding code to a new file
cezarbbb Jun 10, 2026
2a5673f
Rename `rustc_expand/src/errors.rs` into `rustc_expand/src/diagnostic…
GuillaumeGomez Jun 9, 2026
96eb195
Rename `rustc_metadata/src/errors.rs` into `rustc_metadata/src/diagno…
GuillaumeGomez Jun 9, 2026
32a2f0c
Add more tests that exercise the well-formedness checking of lazy typ…
fmease Jun 10, 2026
00ac562
Rename `rustc_mir_build/src/errors.rs` into `rustc_mir_build/src/diag…
GuillaumeGomez Jun 10, 2026
b679cbd
Rename `rustc_mir_dataflow/src/errors.rs` into `rustc_mir_dataflow/sr…
GuillaumeGomez Jun 10, 2026
6708111
Emit error for unused target expression in glob and list delegations
aerooneqq Jun 10, 2026
6a0f2d4
Fix doc link to Instant sub in saturating caveat
orlp Jun 10, 2026
f5e5709
Only register the `atexit` hook when `cleanup` is unloadable
ohadravid Jun 9, 2026
7f0f6e0
Add #[rustc_dump_generics] attribute, tests
Jun 3, 2026
88f3ac1
Manually download chrome instead of letting yarn/npm doing it
GuillaumeGomez Jun 8, 2026
cdb6acc
Reject static EII defaults on Apple targets
AsakuraMizu Jun 9, 2026
1c511f4
compiletest: ignore SVG `y` offset in by-lines comparison
xmakro Jun 5, 2026
816c70b
resolve: Partially revert "Remove a special case for dummy imports"
petrochenkov Jun 10, 2026
96362fc
Rollup merge of #157280 - Dnreikronos:existential_trait_ref_escaping_…
jhpratt Jun 10, 2026
f7d3474
Rollup merge of #157282 - xmakro:fix/parallel-pme-note, r=petrochenkov
jhpratt Jun 10, 2026
ab955d4
Rollup merge of #157352 - xmakro:fix/parallel-dep-graph-determinism, …
jhpratt Jun 10, 2026
446f02b
Rollup merge of #157601 - aerooneqq:delegation-glob-useless-target-ex…
jhpratt Jun 10, 2026
e6a9ac7
Rollup merge of #157611 - GuillaumeGomez:update-browser-ui-test, r=ji…
jhpratt Jun 10, 2026
7ffda80
Rollup merge of #157620 - Daniel-B-Smith:smithdb3/fileencoder-strateg…
jhpratt Jun 10, 2026
60c0690
Rollup merge of #157645 - ohadravid:windows-tls-leak-on-dll-instead-o…
jhpratt Jun 10, 2026
e81aa2c
Rollup merge of #157647 - oli-obk:start-using-comptime, r=fee1-dead
jhpratt Jun 10, 2026
75f9a32
Rollup merge of #157719 - petrochenkov:regr197err, r=jackh726
jhpratt Jun 10, 2026
604ea02
Rollup merge of #156497 - lokirithm:fix-155516, r=cjgillot
jhpratt Jun 10, 2026
45c682c
Rollup merge of #156583 - AsakuraMizu:eii-static-default, r=JonathanB…
jhpratt Jun 10, 2026
fcb54aa
Rollup merge of #157013 - s7tya:fix-let-pat-inferred-wf, r=lcnr
jhpratt Jun 10, 2026
5f9d389
Rollup merge of #157230 - pbkx:issue-155344-borrowck-field-param, r=c…
jhpratt Jun 10, 2026
62238c4
Rollup merge of #157288 - RalfJung:mips-snan, r=ehuss,chenx97,Cyanoxygen
jhpratt Jun 10, 2026
c00d504
Rollup merge of #157350 - xmakro:fix/parallel-svg-y-offset, r=petroch…
jhpratt Jun 10, 2026
8900e13
Rollup merge of #157355 - asder8215:entry_try, r=jhpratt
jhpratt Jun 10, 2026
0d69ce2
Rollup merge of #157384 - addiesh:turbofisherwoman, r=oli-obk
jhpratt Jun 10, 2026
e6ff3ff
Rollup merge of #157577 - i-like-ICEs:fix-dyn-2015-parser, r=fmease
jhpratt Jun 10, 2026
7f14df4
Rollup merge of #157670 - GuillaumeGomez:rename-err-to-diag, r=Jonath…
jhpratt Jun 10, 2026
dc03fbd
Rollup merge of #157691 - cezarbbb:staticlib-move-symbol-edit, r=petr…
jhpratt Jun 10, 2026
c3c980d
Rollup merge of #157697 - fmease:lta-more-wf-tests, r=TaKO8Ki
jhpratt Jun 10, 2026
b43c6e9
Rollup merge of #157700 - GuillaumeGomez:rename-err-to-diag-2, r=Jona…
jhpratt Jun 10, 2026
8367944
Rollup merge of #157703 - orlp:fix-instant-comment, r=SimonSapin
jhpratt Jun 10, 2026
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
8 changes: 5 additions & 3 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ use rustc_data_structures::tagged_ptr::Tag;
use rustc_macros::{Decodable, Encodable, StableHash, Walkable};
pub use rustc_span::AttrId;
use rustc_span::{
ByteSymbol, DUMMY_SP, ErrorGuaranteed, Ident, Span, Spanned, Symbol, kw, respan, sym,
ByteSymbol, DUMMY_SP, ErrorGuaranteed, Ident, LocalExpnId, Span, Spanned, Symbol, kw, respan,
sym,
};
use thin_vec::{ThinVec, thin_vec};

Expand Down Expand Up @@ -3906,10 +3907,10 @@ pub struct EiiImpl {
pub is_default: bool,
}

#[derive(Clone, Encodable, Decodable, Debug, Walkable, PartialEq, Eq)]
#[derive(Clone, Copy, Encodable, Decodable, Debug, PartialEq, Eq)]
pub enum DelegationSource {
Single,
List,
List(LocalExpnId),
Glob,
}

Expand All @@ -3923,6 +3924,7 @@ pub struct Delegation {
pub rename: Option<Ident>,
pub body: Option<Box<Block>>,
/// The item was expanded from a glob delegation item.
#[visitable(ignore)]
pub source: DelegationSource,
}

Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_ast/src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ macro_rules! common_visitor_and_walkers {
Delegation,
DelegationMac,
DelegationSuffixes,
DelegationSource,
DelimArgs,
DelimSpan,
EnumDef,
Expand Down
38 changes: 29 additions & 9 deletions compiler/rustc_ast_lowering/src/delegation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ use crate::diagnostics::{
};
use crate::{
AllowReturnTypeNotation, ImplTraitContext, ImplTraitPosition, LoweringContext, ParamMode,
ResolverAstLoweringExt, index_crate,
index_crate,
};

mod generics;
Expand Down Expand Up @@ -126,7 +126,7 @@ pub(crate) fn delegations_resolutions(
let delegation = ast_index[def_id].delegation().expect("processing delegations");
let span = delegation.last_segment_span();

if let Some(info) = resolver.delegation_info(def_id) {
if let Some(info) = tcx.resolutions(()).delegation_infos.get(&def_id) {
let res = info.resolution_id.map(|id| check_for_cycles(tcx, id, span).map(|_| id));
result.insert(def_id, res.flatten());
} else {
Expand All @@ -143,16 +143,14 @@ pub(crate) fn delegations_resolutions(
fn check_for_cycles(tcx: TyCtxt<'_>, mut def_id: DefId, span: Span) -> Result<(), ErrorGuaranteed> {
let mut visited: FxHashSet<DefId> = Default::default();

let (resolver, _) = &*tcx.hir_crate(()).delayed_resolver.borrow();

loop {
visited.insert(def_id);

// If def_id is in local crate and it corresponds to another delegation
// it means that we refer to another delegation as a callee, so in order to obtain
// a signature DefId we obtain NodeId of the callee delegation and try to get signature from it.
if let Some(local_id) = def_id.as_local()
&& let Some(info) = resolver.delegation_info(local_id)
&& let Some(info) = tcx.resolutions(()).delegation_infos.get(&local_id)
&& let Ok(id) = info.resolution_id
{
def_id = id;
Expand Down Expand Up @@ -209,17 +207,19 @@ impl<'hir> LoweringContext<'_, 'hir> {

let mut generics = self.uplift_delegation_generics(delegation, sig_id, is_method);

let (body_id, call_expr_id) =
let (body_id, call_expr_id, unused_target_expr) =
self.lower_delegation_body(delegation, sig_id, param_count, &mut generics, span);

let decl = self.lower_delegation_decl(
delegation.source,
sig_id,
param_count,
c_variadic,
span,
&generics,
delegation.id,
call_expr_id,
unused_target_expr,
);

let sig = self.lower_delegation_sig(sig_id, decl, span);
Expand Down Expand Up @@ -375,13 +375,15 @@ impl<'hir> LoweringContext<'_, 'hir> {

fn lower_delegation_decl(
&mut self,
source: DelegationSource,
sig_id: DefId,
param_count: usize,
c_variadic: bool,
span: Span,
generics: &GenericsGenerationResults<'hir>,
call_path_node_id: NodeId,
call_expr_id: HirId,
unused_target_expr: bool,
) -> &'hir hir::FnDecl<'hir> {
// The last parameter in C variadic functions is skipped in the signature,
// like during regular lowering.
Expand All @@ -406,6 +408,17 @@ impl<'hir> LoweringContext<'_, 'hir> {
parent_args_segment_id: generics.parent.args_segment_id,
self_ty_id: generics.self_ty_id,
propagate_self_ty: generics.propagate_self_ty,
group_id: {
let id = match source {
DelegationSource::Single => None,
DelegationSource::List(expn_id) => Some(expn_id),
DelegationSource::Glob => {
Some(self.tcx.expn_that_defined(self.owner.def_id).expect_local())
}
};

id.map(|id| (id, unused_target_expr))
},
})),
)),
span,
Expand Down Expand Up @@ -504,16 +517,23 @@ impl<'hir> LoweringContext<'_, 'hir> {
param_count: usize,
generics: &mut GenericsGenerationResults<'hir>,
span: Span,
) -> (BodyId, HirId) {
) -> (BodyId, HirId, bool) {
let block = delegation.body.as_deref();
let mut call_expr_id = HirId::INVALID;
let mut unused_target_expr = false;

let block_id = self.lower_body(|this| {
let mut parameters: Vec<hir::Param<'_>> = Vec::with_capacity(param_count);
let mut args: Vec<hir::Expr<'_>> = Vec::with_capacity(param_count);
let mut stmts: &[hir::Stmt<'hir>] = &[];

let is_method = this.is_method(sig_id, span);
let should_generate_block = this.should_generate_block(delegation, sig_id, is_method);

// Consider non-specified target expression as generated,
// as we do not want to emit error when target expression is
// not specified.
unused_target_expr = block.is_some() && (param_count == 0 || !should_generate_block);

for idx in 0..param_count {
let (param, pat_node_id) = this.generate_param(is_method, idx, span);
Expand All @@ -524,7 +544,7 @@ impl<'hir> LoweringContext<'_, 'hir> {

let arg = if let Some(block) = block
&& idx == 0
&& this.should_generate_block(delegation, sig_id, is_method)
&& should_generate_block
{
let mut self_resolver = SelfResolver {
ctxt: this,
Expand Down Expand Up @@ -565,7 +585,7 @@ impl<'hir> LoweringContext<'_, 'hir> {

debug_assert_ne!(call_expr_id, HirId::INVALID);

(block_id, call_expr_id)
(block_id, call_expr_id, unused_target_expr)
}

fn finalize_body_lowering(
Expand Down
6 changes: 1 addition & 5 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ use rustc_macros::extension;
use rustc_middle::hir::{self as mid_hir};
use rustc_middle::queries::Providers;
use rustc_middle::span_bug;
use rustc_middle::ty::{DelegationInfo, PerOwnerResolverData, ResolverAstLowering, TyCtxt};
use rustc_middle::ty::{PerOwnerResolverData, ResolverAstLowering, TyCtxt};
use rustc_session::errors::add_feature_diagnostics;
use rustc_span::symbol::{Ident, Symbol, kw, sym};
use rustc_span::{DUMMY_SP, DesugaringKind, Span};
Expand Down Expand Up @@ -307,10 +307,6 @@ impl<'tcx> ResolverAstLowering<'tcx> {
self.extra_lifetime_params_map.get(&id).map_or(&[], |v| &v[..])
}

fn delegation_info(&self, id: LocalDefId) -> Option<&DelegationInfo> {
self.delegation_infos.get(&id)
}

fn owner_def_id(&self, id: NodeId) -> LocalDefId {
self.owners[&id].def_id
}
Expand Down
29 changes: 29 additions & 0 deletions compiler/rustc_attr_parsing/src/attributes/rustc_dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,35 @@ impl SingleAttributeParser for RustcDumpDefPathParser {
}
}

pub(crate) struct RustcDumpGenericsParser;

impl NoArgsAttributeParser for RustcDumpGenericsParser {
const PATH: &[Symbol] = &[sym::rustc_dump_generics];
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[
Allow(Target::Struct),
Allow(Target::Enum),
Allow(Target::Union),
Allow(Target::Trait),
Allow(Target::TraitAlias),
Allow(Target::Fn),
Allow(Target::Closure),
Allow(Target::TyAlias),
Allow(Target::Const),
Allow(Target::AssocConst),
Allow(Target::AssocTy),
Allow(Target::Impl { of_trait: false }),
Allow(Target::Impl { of_trait: true }),
Allow(Target::Method(MethodKind::Inherent)),
Allow(Target::Method(MethodKind::Trait { body: false })),
Allow(Target::Method(MethodKind::Trait { body: true })),
Allow(Target::Method(MethodKind::TraitImpl)),
Allow(Target::Delegation { mac: false }),
Allow(Target::Delegation { mac: true }),
]);
const STABILITY: AttributeStability = unstable!(rustc_attrs);
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcDumpGenerics;
}

pub(crate) struct RustcDumpHiddenTypeOfOpaquesParser;

impl NoArgsAttributeParser for RustcDumpHiddenTypeOfOpaquesParser {
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_attr_parsing/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ attribute_parsers!(
Single<WithoutArgs<RustcDenyExplicitImplParser>>,
Single<WithoutArgs<RustcDoNotConstCheckParser>>,
Single<WithoutArgs<RustcDumpDefParentsParser>>,
Single<WithoutArgs<RustcDumpGenericsParser>>,
Single<WithoutArgs<RustcDumpHiddenTypeOfOpaquesParser>>,
Single<WithoutArgs<RustcDumpInferredOutlivesParser>>,
Single<WithoutArgs<RustcDumpItemBoundsParser>>,
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_borrowck/src/diagnostics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,9 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
Some(self.infcx.tcx.hir_name(var_id).to_string())
}
_ => {
// Might need a revision when the fields in trait RFC is implemented
// (https://github.com/rust-lang/rfcs/pull/1546)
bug!("End-user description not implemented for field access on `{:?}`", ty);
// This can happen for field accesses on `Box<T>`: the field is
// described from the boxed type, which may have no named fields
Some(field.index().to_string())
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_builtin_macros/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,8 +1135,9 @@ pub(crate) struct EiiStaticMultipleImplementations {
}

#[derive(Diagnostic)]
#[diag("`#[{$name}]` cannot be used on statics with a value")]
pub(crate) struct EiiStaticDefault {
#[diag("`#[{$name}]` cannot be used on statics with a value on Apple targets")]
#[note("see issue #157649 <https://github.com/rust-lang/rust/issues/157649> for more information")]
pub(crate) struct EiiStaticDefaultApple {
#[primary_span]
pub span: Span,
pub name: String,
Expand Down
Loading
Loading