Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
51f42d6
Add temporary scope to assert_eq and assert_ne
Voultapher Apr 24, 2026
37d5a03
Add VS Code new project command
joshka May 6, 2026
d061dcb
Fix misattributed type inference error span for index expressions
Dnreikronos May 24, 2026
f018c4e
Fix new-project log handling
joshka May 25, 2026
abba25e
fix: rename schema subItems with sub_items
A4-Tacks May 25, 2026
460c582
Format launch config test
joshka May 25, 2026
b8155a6
Fix VS Code cargo executable probing
joshka May 25, 2026
1d9b660
internal: add item_list and mod_ constructors to SyntaxFactory
itang06 May 13, 2026
37188cc
internal: migrate extract_module assist to SyntaxEditor
itang06 May 13, 2026
de062d9
Make assist `inline_type_alias` work on ADT definitions
WeiTheShinobi Jun 8, 2026
9685d74
Merge pull request #22444 from A4-Tacks/exclude-config-rename
ChayimFriedman2 Jun 8, 2026
2484892
Merge pull request #22545 from WeiTheShinobi/inline_type_alias_adt_def
A4-Tacks Jun 9, 2026
f42e002
feat: support flyimport exclude variants
A4-Tacks Jun 9, 2026
c5ba706
Merge pull request #22549 from A4-Tacks/exclude-variants
ChayimFriedman2 Jun 9, 2026
c965932
fix: supports inline variable in macro
A4-Tacks Jun 9, 2026
54577e7
fix: do not panic variable def in macro
A4-Tacks Jun 9, 2026
2f67dec
internal: git ignore .vim/coc-settings.json
A4-Tacks Jun 10, 2026
87443b6
Remove docs about removed `analysis-bench` command
Hoverbear Jun 10, 2026
b7b16a1
Merge pull request #22561 from ferrous-systems/hoverbear/analysis-ben…
lnicola Jun 10, 2026
82e2652
Merge pull request #22560 from A4-Tacks/ignore-coc-settings
ChayimFriedman2 Jun 10, 2026
18e2500
Create directory for xtask metrics rustc_tests
Hoverbear Jun 10, 2026
51f4182
Prepare for merging from rust-lang/rust
invalid-email-address Jun 11, 2026
bcf019a
Merge ref '485ec3fbcc12' from rust-lang/rust
invalid-email-address Jun 11, 2026
162c8aa
Merge pull request #22562 from ferrous-systems/hoverbear/create-dir-f…
Veykril Jun 11, 2026
6536d21
Revert default feature
lnicola Jun 11, 2026
cda17e1
Add original file_id check
A4-Tacks Jun 11, 2026
acb1ec3
Merge pull request #22563 from rust-lang/rustc-pull
lnicola Jun 11, 2026
fe1dce1
Fix destructuring assignments not introducing moves
Veykril Jun 11, 2026
7a67fcb
Merge pull request #22566 from Veykril/lukaswirth/push-pwynmypqwmmp
ChayimFriedman2 Jun 11, 2026
7be87ed
Don't ICE on non-lifetime binders under `-Zassumptions-on-binders`
Dnreikronos Jun 11, 2026
a5f132a
Merge pull request #21868 from itang06/feature/US-18285-extract-modul…
Veykril Jun 12, 2026
e7be416
remove all the ted based and editor based API's from edit_in_place
Shourya742 May 12, 2026
de273b8
move all the editor variant of API's from edit-in-place to edit
Shourya742 May 12, 2026
90fe5ef
update test to use editor variant of try_merge_imports
Shourya742 May 12, 2026
e248498
update insert_use to use editor variant of merge_import methods
Shourya742 May 12, 2026
138846d
update normalize_import to use editor variant of merge_import methods
Shourya742 May 12, 2026
7a7e025
update merge_import to use editor variant of merge_import methods
Shourya742 May 12, 2026
bf226d8
migrate merge_import to syntax_editor
Shourya742 May 25, 2026
368efc5
Remove edit in place
Shourya742 Jun 12, 2026
d62c85a
Merge pull request #22551 from A4-Tacks/inline-var-in-macro
A4-Tacks Jun 12, 2026
39b7e48
Remove unnecessary feature flags from tests
Jun 12, 2026
3bfb422
fix: use package id as argument to `--package` if package is not unique
dfireBird Jun 8, 2026
40dc671
Don't count C-variadic `...` as a parameter for fn pointers
ldgabbay Jun 12, 2026
48273db
Merge pull request #22571 from desiderautumn/featureless
ChayimFriedman2 Jun 12, 2026
a1e1bd2
Merge pull request #22574 from dfireBird/push-pvypluxlnwrl
Veykril Jun 12, 2026
a52265f
perf: defer initial workspace flycheck until cache priming completes
tilladam Jun 13, 2026
e5c17d1
Merge pull request #22579 from tilladam/perf/defer-startup-flycheck
Veykril Jun 13, 2026
cfdecac
fix: offer inline macro in macro call and proc macro
eihqnh Jun 13, 2026
b7e4c6b
Merge pull request #22575 from ldgabbay/fix-variadic-fn-pointer-arity
ChayimFriedman2 Jun 13, 2026
9589461
Use ASCII lowercase for file extensions
HuaGu-Dragon Jun 14, 2026
3ac1008
Merge pull request #22584 from eihqnh/fix-inline-macro
Veykril Jun 14, 2026
d5755eb
Add funding links
Kobzol Jun 14, 2026
62ea4ed
Merge pull request #22588 from Kobzol/funding-links
lnicola Jun 14, 2026
93d4b9b
Merge pull request #22585 from HuaGu-Dragon/`change-to-ascii`
ChayimFriedman2 Jun 14, 2026
dc39c18
fix: prefer bench command when target is bench to avoid cargo run
dfireBird Jun 12, 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
3e66bfb
Merge pull request #22591 from dfireBird/push-ozrylzostupm
Veykril Jun 15, 2026
a837e6c
Merge pull request #22103 from joshka/joshka/new-project-command
Veykril Jun 15, 2026
a390036
resolve region inference vars when computing their max universe
Dnreikronos Jun 15, 2026
6f2ad7d
Make `char::is_private_use` unstably public
Jules-Bertholet Jun 15, 2026
3bea8e3
Change `char::is_unassigned` to `is_assigned`, & make it unstably public
Jules-Bertholet Jun 15, 2026
5274656
fix: MIR eval mixed bit and byte sizes
Wilfred Jun 16, 2026
cd053bb
Merge pull request #22594 from Wilfred/const_eval_crash
flodiebold Jun 16, 2026
ae9501c
move batch
zedddie Jun 17, 2026
9e59547
bless batch (and remove duplicate test)
zedddie Jun 17, 2026
a721913
move batch
zedddie Jun 15, 2026
05b0947
bless batch
zedddie Jun 15, 2026
d7a8831
internal: decide not to use `'db` in `NavigationTarget.docs`
ada4a Jun 12, 2026
b1483e3
Update mingw-w64 C toolchain
mati865 Jun 17, 2026
07fa0ea
fix: Crash on static constants in array length positions
Wilfred Jun 17, 2026
f665313
misc improvements
ada4a Apr 18, 2026
2e19915
add failing test
ada4a Apr 18, 2026
7e95dd2
fix: return `false` from `implements_trait_unique` for error types
ada4a May 29, 2026
7d9bf81
internal: Don't rely on FxHashSet order
Wilfred Jun 17, 2026
faa57cd
Check for #[cfg]s in tail expression macros
ChayimFriedman2 Jun 17, 2026
341e9e2
Merge pull request #22576 from ada4a/push-ruukzxtqxvxv
ChayimFriedman2 Jun 17, 2026
a971c4c
Merge pull request #22601 from Wilfred/fix/static-array-len-alias-panic
ChayimFriedman2 Jun 17, 2026
d4bea37
Expand network address parser benchmark suite
niklasf Jun 16, 2026
3f32f51
move batch
zedddie Jun 18, 2026
ed1dd88
bless batch
zedddie Jun 18, 2026
b1403bc
Move derive tests out of tests/ui/issues
danieljofficial Jun 5, 2026
68f9f5a
add issue links and bless
danieljofficial Jun 5, 2026
1624115
Merge pull request #22599 from ChayimFriedman2/tail-cfg-macro
Veykril Jun 19, 2026
26ea5fe
internal: Do not load unnecessary path dependency files into VFS
Veykril Jun 19, 2026
6110a22
Merge pull request #22615 from Veykril/veykril/push-mruzvlozqzrn
Veykril Jun 19, 2026
11da9ef
Merge pull request #22486 from ada4a/22478-spurious-await
Veykril Jun 19, 2026
bed955c
Merge pull request #22604 from Wilfred/scip_hashset_order
Veykril Jun 19, 2026
ae7ee13
internal: remove unused structs
ada4a Jun 12, 2026
8ae8315
fix(implements_trait_unique_with_infcx): only forbid the self type fr…
ada4a Jun 19, 2026
20f2214
Merge pull request #22617 from ada4a/push-mtxzotmzskkx
ChayimFriedman2 Jun 19, 2026
a09fc01
Avoid forcing index operand inference
Dnreikronos Jun 19, 2026
b93132a
Merge pull request #22616 from ada4a/push-uywylvulzkkx
Veykril Jun 19, 2026
a2f80c9
Handle alias outlives ambiguity during rewrite
Dnreikronos Jun 19, 2026
542e70f
fix: Don't panic on out-of-range integer literals in const positions
shulaoda Jun 20, 2026
af7cb85
fix(toolchain): use std::env::home_dir instead of home crate
raushan728 Jun 20, 2026
b860d7b
Fix release pipeline by pinning node docker image. See nodejs/node#63989
BenjaminBrienen Jun 20, 2026
ad1af37
Merge pull request #22624 from BenjaminBrienen/pin-node-docker-image
lnicola Jun 20, 2026
8eba342
Merge pull request #22621 from shulaoda/06-20-fix_don_t_panic_on_out-…
Veykril Jun 20, 2026
cd892fb
Merge pull request #22623 from raushan728/issues/22570
Veykril Jun 20, 2026
837f5bf
Track salsa cancellation time in loop turn warning
Veykril Jun 20, 2026
0d0b23b
Merge pull request #22625 from Veykril/lukaswirth/push-wrlmwoynotzx
Veykril Jun 20, 2026
303b159
Take &SyntaxFactory instead of &SyntaxEditor in merge/normalize impor…
Veykril Jun 20, 2026
a408c10
Consolidate Use/UseTree editor removal into the Removable trait
Veykril Jun 20, 2026
9e66c39
Add regression tests for UseTree::split_prefix_with_editor
Veykril Jun 20, 2026
83b6272
Merge pull request #22351 from Shourya742/2026-05-10-migrate-merge-im…
Veykril Jun 20, 2026
d873a79
bye bye ted
Shourya742 Jun 3, 2026
9f7b1b7
Merge pull request #22516 from Shourya742/2026-06-03-bye-bye-ted
Veykril Jun 20, 2026
8dae457
internal: add merge imports indent tests
A4-Tacks Jun 20, 2026
3bb0a1c
Resolve vars before computing max universe
Dnreikronos Jun 20, 2026
a44ab8d
Format max universe visitor
Dnreikronos Jun 20, 2026
b93879b
Do not visit nodes in GC multiple times
Veykril Jun 20, 2026
e1719ae
Merge pull request #22627 from Veykril/lukaswirth/push-qrozxpkkypks
Veykril Jun 21, 2026
23d6a1c
Merge pull request #21319 from A4-Tacks/merge-imports-indent
A4-Tacks Jun 21, 2026
1d54265
Optimize network address parser
niklasf Jun 17, 2026
fc7e417
fix(assists/replace_match_with_if_let): don't parenthesize if-let guards
ada4a Jun 18, 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
d349fd8
Merge pull request #22618 from ada4a/replace_match_with_if_let-no-par…
A4-Tacks Jun 22, 2026
9b6c684
Prepare for merging from rust-lang/rust
invalid-email-address Jun 22, 2026
93c9899
Merge ref '942ac9ce4116' from rust-lang/rust
invalid-email-address Jun 22, 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
40aef82
c-variadic: test that we use equality up to free lifetimes
folkertdev Jun 17, 2026
225f1ea
Merge pull request #22630 from rust-lang/rustc-pull
lnicola 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
699346d
move batch
zedddie Jun 22, 2026
c862ccd
bless batch
zedddie 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
4fab41a
Update `rustc-literal-escaper` version to `0.0.8`
GuillaumeGomez Jun 23, 2026
bf86b32
Fix incorrect unsafe debug assertion in unchecked_div_exact
yilin0518 Jun 23, 2026
4b62a30
Add tracking issue
Jules-Bertholet Jun 23, 2026
2dad1f8
FromUtf8Error::into_utf8_lossy better example and suggest use
tisonkun Jun 23, 2026
f446391
Stop excluding `stdarch` test crates from `rust-src`
CathalMullan Jun 23, 2026
fbe85e0
Rollup merge of #158315 - lnicola:sync-from-ra, r=lnicola
jhpratt Jun 24, 2026
39ae8eb
Rollup merge of #158336 - CathalMullan:stdarch-dist, r=Mark-Simulacrum
jhpratt Jun 24, 2026
54d8842
Rollup merge of #155739 - Voultapher:add-tmp-scope-to-assert-macros, …
jhpratt Jun 24, 2026
f788aa6
Rollup merge of #156885 - Dnreikronos:fix/index-expr-ambiguous-type-s…
jhpratt Jun 24, 2026
4f01a33
Rollup merge of #157271 - cyrgani:pm-cleaning, r=petrochenkov
jhpratt Jun 24, 2026
a47807b
Rollup merge of #157883 - Shourya742:2026-06-14-remove-strict-invaria…
jhpratt Jun 24, 2026
dd8dd6a
Rollup merge of #157921 - Dnreikronos:fix-assumptions-on-binders-plac…
jhpratt Jun 24, 2026
db05b2a
Rollup merge of #157960 - aerooneqq:delegation-infers-in-generics, r=…
jhpratt Jun 24, 2026
eba52e6
Rollup merge of #157983 - folkertdev:tailcc-lift-same-signature-restr…
jhpratt Jun 24, 2026
c74ee69
Rollup merge of #158053 - niklasf:perf/addr-parser, r=workingjubilee
jhpratt Jun 24, 2026
e9f973b
Rollup merge of #158105 - camelid:group-shims, r=oli-obk
jhpratt Jun 24, 2026
61bf0ee
Rollup merge of #158207 - LorrensP-2158466:split-resolve-fns, r=petro…
jhpratt Jun 24, 2026
0ff05d2
Rollup merge of #158279 - cjgillot:unreachable-goto, r=folkertdev
jhpratt Jun 24, 2026
bb8bd61
Rollup merge of #157527 - danieljofficial:move-tests-derives, r=Kivooeo
jhpratt Jun 24, 2026
7d52c68
Rollup merge of #157807 - Dnreikronos:assumptions_on_binders_non_life…
jhpratt Jun 24, 2026
c2ca40c
Rollup merge of #157939 - zedddie:gsoc-batch-8-meow, r=Kivooeo
jhpratt Jun 24, 2026
a9ba52c
Rollup merge of #157946 - Jules-Bertholet:char-unassigned-private-use…
jhpratt Jun 24, 2026
c1aeb89
Rollup merge of #158003 - zedddie:gsoc-batch-9-meow, r=Kivooeo
jhpratt Jun 24, 2026
89504f6
Rollup merge of #158020 - mati865:mingw-baseline, r=marcoieni
jhpratt Jun 24, 2026
db8e50f
Rollup merge of #158039 - folkertdev:c-variadic-lifetimes, r=RalfJung
jhpratt Jun 24, 2026
40c4351
Rollup merge of #158060 - zedddie:gsoc-batch-10-meow, r=Kivooeo
jhpratt Jun 24, 2026
8a63fe0
Rollup merge of #158222 - Dnreikronos:format/foreign_newline_diagnost…
jhpratt Jun 24, 2026
fe2bfaf
Rollup merge of #158223 - JonathanBrouwer:lang-target, r=mejrs
jhpratt Jun 24, 2026
a4fec63
Rollup merge of #158252 - hkBst:std-os-cfg-select, r=jhpratt
jhpratt Jun 24, 2026
b11ab63
Rollup merge of #158257 - lcnr:normalize-hr-aliases, r=adwinwhite
jhpratt Jun 24, 2026
81ec5dc
Rollup merge of #158263 - oli-obk:feature-once, r=petrochenkov
jhpratt Jun 24, 2026
49e5de7
Rollup merge of #158267 - tisonkun:issue-129436, r=tgross35
jhpratt Jun 24, 2026
92d6c61
Rollup merge of #158272 - zedddie:gsoc-batch-13-meow, r=Kivooeo
jhpratt Jun 24, 2026
82a29d1
Rollup merge of #158274 - aDotInTheVoid:im-american-made-bud-light-ch…
jhpratt Jun 24, 2026
d398d97
Rollup merge of #158282 - ArhanChaudhary:unchecked-subslice, r=tgross…
jhpratt Jun 24, 2026
6700548
Rollup merge of #158300 - evavh:crate-type-suggestions, r=JonathanBro…
jhpratt Jun 24, 2026
7124924
Rollup merge of #158304 - mu001999:main, r=mu001999
jhpratt Jun 24, 2026
5095912
Rollup merge of #158309 - GuillaumeGomez:update-literal-escaper, r=Gu…
jhpratt Jun 24, 2026
bf43eff
Rollup merge of #158314 - yilin0518:fix-unchecked_div_exact, r=jhpratt
jhpratt Jun 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3554,9 +3554,9 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"

[[package]]
name = "rustc-literal-escaper"
version = "0.0.7"
version = "0.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8be87abb9e40db7466e0681dc8ecd9dcfd40360cb10b4c8fe24a7c4c3669b198"
checksum = "bfe6f213fb658c8fb95baabd5420393438cf5a98d707f5dd701d9197c705f71e"

[[package]]
name = "rustc-main"
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2024"
# tidy-alphabetical-start
bitflags = "2.4.1"
memchr = "2.7.6"
rustc-literal-escaper = "0.0.7"
rustc-literal-escaper = "0.0.8"
rustc_ast_ir = { path = "../rustc_ast_ir" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_index = { path = "../rustc_index" }
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