Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
51f42d6
Add temporary scope to assert_eq and assert_ne
Voultapher Apr 24, 2026
d061dcb
Fix misattributed type inference error span for index expressions
Dnreikronos May 24, 2026
7be87ed
Don't ICE on non-lifetime binders under `-Zassumptions-on-binders`
Dnreikronos Jun 11, 2026
5ffbf04
remove some redundant closures
cyrgani May 30, 2026
acac5b3
simplify `Buffer`
cyrgani May 30, 2026
d727a0e
set `issue = none` for `proc_macro_internals`
cyrgani Jun 1, 2026
b292ff8
fix "rountrips" typo
cyrgani Jun 8, 2026
30004a8
improve `nonfatal-parsing` test
cyrgani Jun 8, 2026
a390036
resolve region inference vars when computing their max universe
Dnreikronos Jun 15, 2026
b1483e3
Update mingw-w64 C toolchain
mati865 Jun 17, 2026
b1403bc
Move derive tests out of tests/ui/issues
danieljofficial Jun 5, 2026
68f9f5a
add issue links and bless
danieljofficial Jun 5, 2026
a09fc01
Avoid forcing index operand inference
Dnreikronos Jun 19, 2026
a2f80c9
Handle alias outlives ambiguity during rewrite
Dnreikronos Jun 19, 2026
3bb0a1c
Resolve vars before computing max universe
Dnreikronos Jun 20, 2026
a44ab8d
Format max universe visitor
Dnreikronos Jun 20, 2026
e7b8d13
Ignore println newline in foreign format hints
Dnreikronos Jun 21, 2026
56dfba7
Update foreign format UI baselines
Dnreikronos Jun 21, 2026
356c63f
Correct issue 92267 UI baseline
Dnreikronos Jun 21, 2026
2a86b91
Update issue 92267 stderr ending
Dnreikronos Jun 21, 2026
b1e1db9
Add tup expr arg unbounded assoc const test and update test with prop…
Shourya742 Jun 22, 2026
f0cf392
typo fix from hid_id to hir_id
Shourya742 Jun 22, 2026
cd8c4d0
Check the target and souce tuple elements mismatch duing const_arg_tu…
Shourya742 Jun 22, 2026
3da4612
norm: fix escaping placeholder check
lcnr Jun 22, 2026
f99e894
Move target checking for `#[lang]` to the attribute parser
JonathanBrouwer Jun 21, 2026
b8758a3
Add lifetime parameter to `AllowedTargets`
JonathanBrouwer Jun 21, 2026
9ad6dbf
Use `AllowedTargets::ManuallyChecked` for `LangParser`
JonathanBrouwer Jun 21, 2026
6863281
Split `resolve_ident_in_module_non_globs_unadjusted` into local and e…
LorrensP-2158466 Jun 21, 2026
0eb146c
Extract all instance shim variants into new `ShimKind` enum
camelid Jun 18, 2026
c329a0e
Strip vestigial `Shim` suffix from `ShimKind` variants
camelid Jun 18, 2026
d06469a
Remove `MirSource::from_instance` helper that is only used in one place
camelid Jun 18, 2026
7d42183
Add support for infers in delegation's generics
aerooneqq Jun 22, 2026
2172c51
triagebot: Stop pinging myself
aDotInTheVoid Jun 22, 2026
1bdb472
Add test.
cjgillot Jun 23, 2026
490d32c
Follow goto and drop when linting unreachable code.
cjgillot Jun 22, 2026
24d4439
Use `cfg_select` in `std::os`
hkBst Jun 22, 2026
5d07ed5
slice_split_once: bounds check optimization note
ArhanChaudhary Jun 23, 2026
e638ebe
Lift the same-signature restriction for `extern "tail"`
folkertdev Jun 15, 2026
24a66cb
Improve unknown crate_type diagnostic suggestions
evavh Jun 22, 2026
e290ddc
mailmap: update mu001999
mu001999 Jun 23, 2026
bd73fb8
Only load the feature list once in the entire resolver
oli-obk Jun 22, 2026
4804060
Added implementation on set_permissions_nofollow for all platforms su…
asder8215 Jun 20, 2026
dfe0a98
Rollup merge of #158168 - asder8215:windows_set_permissions_nofollow,…
JonathanBrouwer Jun 23, 2026
aa7596c
Rollup merge of #155739 - Voultapher:add-tmp-scope-to-assert-macros, …
JonathanBrouwer Jun 23, 2026
9216da1
Rollup merge of #156885 - Dnreikronos:fix/index-expr-ambiguous-type-s…
JonathanBrouwer Jun 23, 2026
0cf6fcf
Rollup merge of #157271 - cyrgani:pm-cleaning, r=petrochenkov
JonathanBrouwer Jun 23, 2026
9e4ef27
Rollup merge of #157883 - Shourya742:2026-06-14-remove-strict-invaria…
JonathanBrouwer Jun 23, 2026
085dab6
Rollup merge of #157921 - Dnreikronos:fix-assumptions-on-binders-plac…
JonathanBrouwer Jun 23, 2026
f72f682
Rollup merge of #157960 - aerooneqq:delegation-infers-in-generics, r=…
JonathanBrouwer Jun 23, 2026
31600e1
Rollup merge of #157983 - folkertdev:tailcc-lift-same-signature-restr…
JonathanBrouwer Jun 23, 2026
e1f6568
Rollup merge of #158105 - camelid:group-shims, r=oli-obk
JonathanBrouwer Jun 23, 2026
6da912f
Rollup merge of #158207 - LorrensP-2158466:split-resolve-fns, r=petro…
JonathanBrouwer Jun 23, 2026
bec231e
Rollup merge of #158279 - cjgillot:unreachable-goto, r=folkertdev
JonathanBrouwer Jun 23, 2026
a843bc9
Rollup merge of #157527 - danieljofficial:move-tests-derives, r=Kivooeo
JonathanBrouwer Jun 23, 2026
3822b5c
Rollup merge of #157807 - Dnreikronos:assumptions_on_binders_non_life…
JonathanBrouwer Jun 23, 2026
75f9ff9
Rollup merge of #158020 - mati865:mingw-baseline, r=marcoieni
JonathanBrouwer Jun 23, 2026
b3d17e4
Rollup merge of #158222 - Dnreikronos:format/foreign_newline_diagnost…
JonathanBrouwer Jun 23, 2026
99eecef
Rollup merge of #158223 - JonathanBrouwer:lang-target, r=mejrs
JonathanBrouwer Jun 23, 2026
dc5681e
Rollup merge of #158252 - hkBst:std-os-cfg-select, r=jhpratt
JonathanBrouwer Jun 23, 2026
df2dcad
Rollup merge of #158257 - lcnr:normalize-hr-aliases, r=adwinwhite
JonathanBrouwer Jun 23, 2026
e948bc5
Rollup merge of #158263 - oli-obk:feature-once, r=petrochenkov
JonathanBrouwer Jun 23, 2026
3f51680
Rollup merge of #158274 - aDotInTheVoid:im-american-made-bud-light-ch…
JonathanBrouwer Jun 23, 2026
21eb756
Rollup merge of #158282 - ArhanChaudhary:unchecked-subslice, r=tgross…
JonathanBrouwer Jun 23, 2026
5d4460e
Rollup merge of #158300 - evavh:crate-type-suggestions, r=JonathanBro…
JonathanBrouwer Jun 23, 2026
04e4c9b
Rollup merge of #158304 - mu001999:main, r=mu001999
JonathanBrouwer Jun 23, 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
2 changes: 1 addition & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,6 @@ Milan Landaverde <milanlandaverde@gmail.com>
mjptree <michael.prantl@hotmail.de>
Ms2ger <ms2ger@gmail.com> <Ms2ger@gmail.com>
msizanoen1 <qtmlabs@protonmail.com>
mu001999 <mu001999@outlook.com> <rcu@live.com>
Mukilan Thiagarajan <mukilanthiagarajan@gmail.com>
Nadrieril Feneanar <Nadrieril@users.noreply.github.com>
Nadrieril Feneanar <Nadrieril@users.noreply.github.com> <nadrieril+rust@gmail.com>
Expand Down Expand Up @@ -603,6 +602,7 @@ Robert Habermeier <rphmeier@gmail.com>
Robert Millar <robert.millar@cantab.net>
Roc Yu <rocyu@protonmail.com>
Rohit Joshi <rohitjoshi@users.noreply.github.com> Rohit Joshi <rohit.joshi@capitalone.com>
Roland Xu <rcu@live.com> <mu001999@outlook.com>
Ross Smyth <18294397+RossSmyth@users.noreply.github.com>
Ross Smyth <18294397+RossSmyth@users.noreply.github.com> <crs2017@gmail.com>
Ross Smyth <18294397+RossSmyth@users.noreply.github.com> <rsmyth@electrocraft.com>
Expand Down
97 changes: 65 additions & 32 deletions compiler/rustc_ast_lowering/src/delegation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
return self.generate_delegation_error(span, delegation);
}

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

let (body_id, call_expr_id, unused_target_expr) = self.lower_delegation_body(
delegation,
Expand Down Expand Up @@ -404,10 +404,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
hir::InferDelegationSig::Output(self.arena.alloc(hir::DelegationInfo {
call_expr_id,
call_path_res: self.get_resolution_id(call_path_node_id),
child_args_segment_id: generics.child.args_segment_id,
parent_args_segment_id: generics.parent.args_segment_id,
self_ty_id: generics.self_ty_id,
propagate_self_ty: generics.propagate_self_ty,
child_seg_id: generics.child.args_segment_id,
child_seg_id_for_sig: generics.child.segment_id_for_sig(),
parent_seg_id_for_sig: generics.parent.segment_id_for_sig(),
self_ty_propagation_kind: generics.self_ty_propagation_kind,
group_id: {
let id = match source {
DelegationSource::Single => None,
Expand Down Expand Up @@ -625,20 +625,40 @@ impl<'hir> LoweringContext<'_, 'hir> {
}),
);

hir::QPath::Resolved(ty, self.arena.alloc(new_path))
}
hir::QPath::TypeRelative(ty, segment) => {
let segment = self.process_segment(span, segment, &mut generics.child);
// Explicitly create `Self` self-type in case of infers or static
// free-to-trait reuses.
let ty = match generics.self_ty_propagation_kind {
Some(hir::DelegationSelfTyPropagationKind::SelfParam) => {
let self_param = generics.parent.generics.find_self_param();
let path = self.create_generic_arg_path(self_param);
let kind = hir::TyKind::Path(path);

let ty = match ty {
Some(ty) => hir::Ty { kind, ..ty.clone() },
None => hir::Ty { kind, hir_id: self.next_id(), span },
};

Some(&*self.arena.alloc(ty))
}
_ => ty,
};

hir::QPath::TypeRelative(ty, self.arena.alloc(segment))
hir::QPath::Resolved(ty, self.arena.alloc(new_path))
}
hir::QPath::TypeRelative(..) => unreachable!("until inherent methods are supported"),
};

generics.self_ty_id = match new_path {
hir::QPath::Resolved(ty, _) => ty,
hir::QPath::TypeRelative(ty, _) => Some(ty),
if let Some(hir::DelegationSelfTyPropagationKind::SelfTy(id)) =
generics.self_ty_propagation_kind.as_mut()
{
*id = match new_path {
hir::QPath::Resolved(ty, _) => {
ty.expect("must contain self type as `SelfTy` propagation kind is specified")
}
hir::QPath::TypeRelative(ty, _) => ty,
}
.hir_id;
}
.map(|ty| ty.hir_id);

let callee_path = self.arena.alloc(self.mk_expr(hir::ExprKind::Path(new_path), span));
let args = self.arena.alloc_from_iter(args);
Expand All @@ -662,25 +682,38 @@ impl<'hir> LoweringContext<'_, 'hir> {
segment: &hir::PathSegment<'hir>,
result: &mut GenericsGenerationResult<'hir>,
) -> hir::PathSegment<'hir> {
let details = result.generics.args_propagation_details();

// Always uplift generic params, because if they are not empty then they
// should be generated in delegation.
let generics = result.generics.into_hir_generics(self, span);
let segment = if details.should_propagate {
let args = generics.into_generic_args(self, span);

// Needed for better error messages (`trait-impl-wrong-args-count.rs` test).
let args = if args.is_empty() { None } else { Some(args) };

hir::PathSegment { args, ..segment.clone() }
} else {
segment.clone()
};
let infer_indices = result.generics.infer_indices();
result.generics.into_hir_generics(self, span);

let mut segment = segment.clone();
let mut args_iter = result.generics.create_args_iterator();

let new_args = segment
.args
.filter(|args| !args.is_empty())
.map(|args| {
self.arena.alloc_from_iter(args.args.iter().enumerate().map(|(idx, arg)| {
if infer_indices.contains(&idx) {
args_iter.next(self, |_| arg.hir_id()).expect("arg must exist for infer")
} else {
*arg
}
}))
})
.unwrap_or_else(|| self.arena.alloc_from_iter(args_iter.consume_all(self)));

// Needed for better error messages (`trait-impl-wrong-args-count.rs` test).
segment.args = (!new_args.is_empty()).then(|| {
&*self.arena.alloc(hir::GenericArgs {
args: new_args,
constraints: &[],
parenthesized: hir::GenericArgsParentheses::No,
span_ext: segment.args.map_or(span, |args| args.span_ext),
})
});

if details.use_args_in_sig_inheritance {
result.args_segment_id = Some(segment.hir_id);
}
result.args_segment_id = segment.hir_id;
result.use_for_sig_inheritance = !result.generics.is_trait_impl();

segment
}
Expand Down
Loading
Loading