Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
286 commits
Select commit Hold shift + click to select a range
8ef5250
Remove spell checks in CI
antoyo Aug 7, 2026
51584dd
Fix test on m68k
antoyo Aug 7, 2026
c7ef7a9
Merge pull request #946 from rust-lang/fix/arg-alignment
antoyo Aug 7, 2026
0a026ec
Fix unwinding bug in release mode
antoyo Jul 14, 2026
c52a94a
Remove passing UI tests
antoyo Aug 7, 2026
8278c77
Update GCC version
antoyo Aug 7, 2026
406a6d0
Fix compilation without the master feature
antoyo Aug 7, 2026
65f62e3
Remove passing UI tests
antoyo Aug 7, 2026
dbefafb
Correctly implement assume to fix a warning in a UI test
antoyo Aug 7, 2026
e9f0998
Improve assume and unreachable
antoyo Aug 7, 2026
972d229
Rollup merge of #160530 - RalfJung:internal-target-features, r=nnethe…
JonathanBrouwer Aug 7, 2026
aa9101f
Ignore catch_unwind.rs test on m68k because of a GCC bug
antoyo Aug 8, 2026
93bb59c
Merge pull request #947 from rust-lang/fix/try-catch
antoyo Aug 8, 2026
e127e33
Run the libcore tests in release mode
antoyo Aug 8, 2026
f30a912
Remove passing LTO tests
antoyo Aug 8, 2026
e691e6b
Merge pull request #949 from rust-lang/remove-failing-lto-tests
antoyo Aug 8, 2026
df356ea
Finish the m68000 target CPU LLVM list for GCC
techmetx11 Aug 9, 2026
ed5fcc9
Add explicit register support for m68k
techmetx11 Aug 9, 2026
5e9f15f
Fix mismatched type without native 128-bit integers
antoyo Aug 8, 2026
a3e9834
Merge pull request #948 from rust-lang/test/release-libcore
antoyo Aug 9, 2026
d768a56
Update GCC version to `201ca90ac810d1c6509c252cc9c87d3ace0661d7`
GuillaumeGomez Aug 9, 2026
db95625
Update `gccjit.rs` dependency version to `6.0.0`
GuillaumeGomez Aug 9, 2026
a911628
Merge pull request #951 from techmetx11/m68k-explicit-reg
antoyo Aug 9, 2026
7ec80c0
Merge pull request #950 from techmetx11/master
antoyo Aug 9, 2026
14bc9eb
Improve failing tests lists
antoyo Aug 9, 2026
f25445a
Merge pull request #952 from GuillaumeGomez/update
antoyo Aug 9, 2026
c3aa887
Merge pull request #953 from rust-lang/improve-failing-tests-lists
antoyo Aug 9, 2026
5173175
Use rust target triple instead of LLVM's
antoyo Aug 9, 2026
66e7637
Merge pull request #954 from rust-lang/fix/libgccjit-sysroot-path
antoyo Aug 10, 2026
0bc3bfe
Load libgccjit from the LLVM target path as a fallback
antoyo Aug 10, 2026
c319901
Merge pull request #956 from rust-lang/fix/libgccjit-sysroot-fallback
antoyo Aug 10, 2026
bcd8937
Upgrade and deduplicate dependencies
cuviper Aug 4, 2026
3c300ce
Add MSA and `f16` inline ASM support for MIPS
beetrees Aug 10, 2026
ca241a4
atomic volatile: add intrinsics
RalfJung Jul 28, 2026
0ac1585
Rollup merge of #160058 - RalfJung:atomic-volatile, r=JohnTitor
JonathanBrouwer Aug 17, 2026
d7a283d
Add floating point inline ASM support for SPARC
beetrees Aug 11, 2026
4256f1d
reformat
cuviper Aug 18, 2026
568de9a
Mark default EII function aliases as weak
AsakuraMizu Aug 20, 2026
9c5bcb6
Fix EII static alias declarations
AsakuraMizu Aug 20, 2026
19ea707
Refactor to avoid having to use set_type for global variables
antoyo Aug 20, 2026
ea7e819
make `pad_i32` of `PassMode::cast` an integer
folkertdev Jul 29, 2026
542dc48
Merge pull request #960 from rust-lang/remove/set_type
antoyo Aug 21, 2026
0b243c5
test `f16::mul_add` not double-rounding the result
folkertdev Aug 22, 2026
ba10b84
Fix abort implementation
antoyo Aug 21, 2026
221cb48
Rollup merge of #160949 - beetrees:f128-inline-asm-sparc, r=folkertdev
jhpratt Aug 22, 2026
5b0c59b
Merge pull request #961 from rust-lang/fix/abort
antoyo Aug 23, 2026
5e4a79b
Add regression test for #827
antoyo Aug 23, 2026
7e3f8a5
Merge pull request #963 from rust-lang/segfault-regression-test
antoyo Aug 23, 2026
58c4569
Rollup merge of #160132 - folkertdev:pad-i32-count, r=bjorn3
JonathanBrouwer Aug 24, 2026
658e9db
Handle alignment and volatile flag for mem operations
antoyo Aug 24, 2026
6331144
Merge pull request #962 from AsakuraMizu/eii
antoyo Aug 24, 2026
4d72ce2
Merge pull request #964 from rust-lang/fix/mem-ops-volatile
antoyo Aug 24, 2026
df82806
Fix and support more linkages
antoyo Aug 23, 2026
642aaa8
Implement linkage in predefine_static and fix internal linkage on ext…
antoyo Aug 23, 2026
9ad916e
Use internal linkage for check_and_apply_linkage
antoyo Aug 23, 2026
b0feb7f
Fix ICE that happened on a weak function marked inline
antoyo Aug 24, 2026
746c872
Add performance notes for the floating-point round method
joonas-001 Aug 25, 2026
b8dca7f
Rollup merge of #161522 - folkertdev:gcc-fma16-correctly-rounded, r=t…
JonathanBrouwer Aug 25, 2026
9f3034d
Cleanup
antoyo Aug 25, 2026
7a6930e
Update .gitignore
antoyo Aug 25, 2026
ec5988d
Improve tests
antoyo Aug 26, 2026
64092c9
Add support for the common attribute
antoyo Aug 26, 2026
996806b
Update comments
antoyo Aug 26, 2026
3de358d
Update libgccjit version
antoyo Aug 26, 2026
85cfc8d
Merge pull request #965 from rust-lang/fix/linkage
antoyo Aug 26, 2026
c447e2e
open issues when scheduled linkcheck fails
jyn514 Aug 29, 2026
c56a566
Rollup merge of #160851 - beetrees:f16-inline-asm-mips, r=folkertdev
JonathanBrouwer Aug 29, 2026
6f389ff
Use the correct sign for the division
antoyo Aug 29, 2026
4cd7da5
Merge pull request #968 from rust-lang/fix/division
antoyo Aug 29, 2026
eb6851e
attach naked function target features to module assembly
folkertdev Aug 6, 2026
f092d9a
Make sin, cos, exp, exp2, log, log2, log10 generic
N1ark Aug 17, 2026
6a305b1
Rollup merge of #137720 - folkertdev:naked-function-target-feature, r…
JonathanBrouwer Sep 1, 2026
0dd319c
Rollup merge of #160989 - N1ark:08-12-generic-float-intrinsincs, r=fo…
JonathanBrouwer Sep 1, 2026
ab24497
Add core doctests
antoyo Jul 26, 2026
4da8c74
Fix libcore doc tests
antoyo Sep 2, 2026
bee81fe
Run libcore doctests in CI
antoyo Sep 3, 2026
ad87e6c
Implement simd_arith_offset
antoyo Sep 2, 2026
0f89894
Workaround broken libcore doc-test
antoyo Sep 2, 2026
5e6146f
Fix generic_simd_intrinsic
antoyo Sep 2, 2026
15cc449
Switch to new_rvalue_from_long in generic_simd_intrinsic
antoyo Sep 3, 2026
d35eac8
Remove passing test
antoyo Sep 3, 2026
070ed79
Merge pull request #971 from rust-lang/fix/simd
antoyo Sep 3, 2026
df87871
Adds support for AArch64 SVE to inline assembly
CrooseGit Jun 15, 2026
64eb188
Merge zreg into vreg and keep ffr in a clobber-only class
Amanieu Aug 25, 2026
c820367
Disable inline asm line info cookies when llvm bitcode is saved or LT…
susitsm Jul 30, 2026
dc65780
Error on stale entries in failing test files
antoyo Sep 6, 2026
162c62c
Update failing test lists
antoyo Sep 6, 2026
f0570c2
Remap the sysroot path and keep non-test files
antoyo Sep 6, 2026
894f27b
Add new ICEing tests
antoyo Sep 6, 2026
5619786
Merge pull request #973 from rust-lang/fix/test-list
antoyo Sep 7, 2026
9565ced
Add regression test for importing block-scoped traits
chenyukang Sep 7, 2026
0e0cd87
Rollup merge of #160197 - susitsm:restrict-inline-asm-cookies, r=petr…
JonathanBrouwer Sep 7, 2026
c9e2b67
Avoid suggesting imports of traits declared inside bodies
chenyukang Sep 7, 2026
38e12ff
Merge branch 'master' into sync_from_rust_2026_09_08
antoyo Sep 8, 2026
2850a4c
Update to nightly-2026-09-08
antoyo Sep 8, 2026
55be6d9
Fix clippy warning
antoyo Sep 8, 2026
406f9ec
Fix failing libcore doctests
antoyo Sep 4, 2026
45528bc
Merge pull request #974 from rust-lang/sync_from_rust_2026_09_08
antoyo Sep 8, 2026
c18476f
fix: typo in thir.md
000wahab000 Sep 8, 2026
40dc2a3
Merge pull request rust-lang/rustc-dev-guide#3005 from 000wahab000/fi…
reddevilmidzy Sep 9, 2026
ebd2995
Ported cg_gcc to the new cg_ssa version
FractalFir Aug 5, 2025
8b916a8
Apply suggestions from code review
FractalFir Sep 19, 2025
a03efcf
Add missing indirect return argument to new calls
antoyo Nov 1, 2025
5b910ff
Improve the new indirect return API
antoyo Jul 19, 2026
aa64bfc
Don't rely on codegen emitting fn_abi_of_* errors in abi checks
bjorn3 Aug 31, 2026
7878498
address review comments
jyn514 Sep 10, 2026
b1c6599
Merge pull request #2993 from jyn514/track-broken-links
jyn514 Sep 10, 2026
4aee1dc
spelling
supercooltest2024 Sep 10, 2026
68ddb1e
Merge pull request #3011 from supercooltest2024/patch-1
BoxyUwU Sep 10, 2026
5cf9eac
Rollup merge of #160023 - antoyo:ssa-indirect-return, r=workingjubilee
JonathanBrouwer Sep 11, 2026
fe47365
Add the alternatives parts in `Cache::paths`
GuillaumeGomez Sep 11, 2026
3ddd7e4
adjust docs to latest offload usage
ZuseZ4 Sep 11, 2026
e5d963f
Merge pull request #3012 from rust-lang/offload-usage-update
ZuseZ4 Sep 11, 2026
10e1f7e
adjust docs to latest offload install
ZuseZ4 Sep 11, 2026
301f62f
Merge pull request #3013 from rust-lang/offload-install-update
ZuseZ4 Sep 11, 2026
1629bcd
Add useful APIs to `Unique(Arc|Rc)`
maxdexh Sep 13, 2026
7e37472
Prepare for merging from rust-lang/rust
invalid-email-address Sep 14, 2026
93c39bc
Merge ref '4b6d04e70610' from rust-lang/rust
invalid-email-address Sep 14, 2026
bfbf4b1
Merge pull request #3014 from rust-lang/rustc-pull
tshepang Sep 14, 2026
a124c91
Merge branch 'master' into sync_from_rust_2026_09_14
antoyo Sep 15, 2026
84201e9
Fix compile errors
antoyo Sep 15, 2026
fddfb9c
Update to nightly-2026-09-14
antoyo Sep 15, 2026
8c2eb2a
Fix clippy warning
antoyo Sep 15, 2026
529a10d
Merge pull request #977 from rust-lang/sync_from_rust_2026_09_14
antoyo Sep 15, 2026
a74f1e7
fix generic offload usage
ZuseZ4 Sep 15, 2026
b88268a
Merge pull request #3015 from rust-lang/offload-usage-update2
ZuseZ4 Sep 15, 2026
9e67ac6
compiler: fix bug and span_bug imports
mejrs Aug 27, 2026
a1864bd
Ping T-libs-ping instead of T-libs-fcp for backports
clarfonthey Sep 16, 2026
aa95ad8
Split `build_session`
nnethercote Aug 28, 2026
68b945d
Change `CodegenBackend::init` to take `&mut self`
nnethercote Aug 28, 2026
c2cd957
Remove `global_backend_features` query
nnethercote Aug 28, 2026
f68cc95
Fix formatting, and make wording consistent
Urhengulas Sep 16, 2026
ac0e9fa
First pass at windows::fs::FileExt.seek_read_exact()
json420 Sep 16, 2026
88af4fd
First pass at windows::fs::FileExt.seek_write_all()
json420 Sep 16, 2026
535fa77
Fix function signature in seek_read_exact(), duh
json420 Sep 16, 2026
ba736a0
Provide the "preferred name" when generating `href` and `title` for i…
GuillaumeGomez Sep 11, 2026
cd6287f
Add regression test for inlined same item with different names
GuillaumeGomez Sep 11, 2026
5c56219
First pass at tests for .seek_read_exact(), seek_write_all()
json420 Sep 16, 2026
6df2dd9
Whitespace fix
json420 Sep 16, 2026
482f884
Use hypothetical seek_read_exact_seek_write_all feature also for .see…
json420 Sep 16, 2026
165e755
Tracking issues 162868
json420 Sep 16, 2026
fafa1ee
Oops, fix seek_write_all() doc example, was using write_all_at() still
json420 Sep 17, 2026
d179246
Add mocked test for windows FileExt trait
json420 Sep 17, 2026
c0785e4
Spelling fixes
json420 Sep 17, 2026
fff83c5
Prepare for merging from rust-lang/rust
invalid-email-address Sep 17, 2026
359cb6c
Merge ref 'c999cef531ea' from rust-lang/rust
invalid-email-address Sep 17, 2026
093dd66
Merge pull request #3019 from rust-lang/rustc-pull
tshepang Sep 17, 2026
2cce379
Merge pull request #3018 from Urhengulas/patch-1
tshepang Sep 17, 2026
2adb748
Expand test for windows FileExt trait to include almost all scenarios
json420 Sep 17, 2026
a73d5f1
Add regression test for recursive type bug found a while ago when com…
antoyo Sep 17, 2026
d5f2a49
Merge pull request #978 from rust-lang/recursive-types-test
antoyo Sep 17, 2026
5edb259
Add non-zero div test
antoyo Sep 3, 2026
64b4249
Re-enable disabled project tests
antoyo Sep 4, 2026
0dd8e99
Ignore a librsvg test since it fails in CI
antoyo Sep 18, 2026
6d00f27
Add a new `-Ztrack-diagnostics` test
nnethercote Sep 18, 2026
0e617d4
Adjust `bug!`/`span_bug!` emission
nnethercote Sep 16, 2026
653076c
yeet AliasConstKind::opt_def_id
khyperia Sep 18, 2026
44d6e57
sembr src/offload/installation.md
tshepang Sep 18, 2026
ae341a2
sembr src/test-implementation.md
tshepang Sep 18, 2026
9327b11
redundant
tshepang Sep 18, 2026
8a9db74
whitespace
tshepang Sep 18, 2026
ec49841
reflow
tshepang Sep 18, 2026
9e7d4b2
Don't double-allocate `OwnerInfo`
nnethercote Sep 1, 2026
9a03326
Convert some `&mut self` to `&self` in the lowerer
nnethercote Sep 1, 2026
990c292
Reduce the scope of a local
nnethercote Sep 1, 2026
9b817c5
Rename `LoweringContext::current_item`
nnethercote Sep 1, 2026
3ee39bd
Fix an inconsistent comment
nnethercote Sep 1, 2026
6e7d014
Inline and remove `lower_delim_args`
nnethercote Sep 1, 2026
f1b023a
sembr src/solve/sharing-crates-with-rust-analyzer.md
tshepang Sep 18, 2026
11b373e
Eliminate `ItemLowerer`
nnethercote Sep 1, 2026
d3f8246
whitespace
tshepang Sep 18, 2026
1b9a608
sembr src/tests/ecosystem.md
tshepang Sep 18, 2026
cff4b1a
reduce indentation
tshepang Sep 18, 2026
6f51268
split some more lines on commas
tshepang Sep 18, 2026
0999e10
generic
tshepang Sep 18, 2026
bf9557a
sembr src/tests/intro.md
tshepang Sep 18, 2026
6a7d5e6
Fix for librsvg project tests
antoyo Sep 18, 2026
d4be232
Merge pull request #979 from rust-lang/fix/project-tests
antoyo Sep 18, 2026
5539256
respect indents
tshepang Sep 18, 2026
6e5231a
sembr src/tests/compiletest.md
tshepang Sep 18, 2026
55ec44e
missing pause
tshepang Sep 18, 2026
65ee597
sembr src/tests/ecosystem-test-jobs/rust-for-linux.md
tshepang Sep 18, 2026
6c549a9
sembr src/tests/ecosystem-test-jobs/fuchsia.md
tshepang Sep 18, 2026
9f09251
improve tests/ecosystem-test-jobs/fuchsia.md
tshepang Sep 18, 2026
04357ed
sembr src/closure.md
tshepang Sep 18, 2026
b0f83b7
Update `browser-ui-test` version to `0.25.2`
GuillaumeGomez Sep 18, 2026
14e479d
improve closure.md
tshepang Sep 18, 2026
d6c1c9c
Merge pull request #3020 from rust-lang/tshepang/misc
tshepang Sep 18, 2026
f8f15cf
fix whitespace
tshepang Sep 18, 2026
d142688
Merge pull request #3021 from rust-lang/tshepang-patch-1
tshepang Sep 18, 2026
c60430f
Add missing `#[repr(C)]` in UI, codegen and assembly tests
beetrees Sep 18, 2026
cc48855
Merge branch 'master' into sync_from_rust_2026_09_18
antoyo Sep 18, 2026
9e0ad85
Update to nightly-2026-09-18
antoyo Sep 18, 2026
5cc5408
Fix compilation
antoyo Sep 18, 2026
461b541
Fix formatting
antoyo Sep 18, 2026
addf907
Add failing ICE tests
antoyo Sep 18, 2026
e7d3a6a
Move parse error recovery from some invalid expr ops out of line
fmease Sep 10, 2026
b945d68
Don't needlessly pass the operand through some recovery functions by …
fmease Sep 10, 2026
ceede0b
Remove odd special case of some parse error recovery functions
fmease Sep 6, 2026
6c0ab88
Dismantle bespoke diagnostic suggestion wrapper API
fmease Sep 6, 2026
ddb9380
Move parse error recovery from C-style inc/dec ops out of line
fmease Sep 10, 2026
1adccf2
Inline fns & data types related to parse error recovery from C-style …
fmease Sep 10, 2026
d85d3f5
Refactor the way we finish parsing expr ops
fmease Sep 10, 2026
f0ae097
Refactor `check_assoc_op` to make it more legible
fmease Aug 25, 2026
2815872
Don't mistake `<->` for `<>`
fmease Sep 11, 2026
39f626b
Merge pull request #980 from rust-lang/sync_from_rust_2026_09_18
antoyo Sep 18, 2026
c99166f
Revert "improve tests/ecosystem-test-jobs/fuchsia.md"
tshepang Sep 18, 2026
2e95aa2
Revert "sembr src/tests/ecosystem-test-jobs/fuchsia.md"
tshepang Sep 18, 2026
68b9e16
Merge pull request #3022 from rust-lang/tshepang/reverts
tshepang Sep 18, 2026
cec9479
Prepare for merging from rust-lang/rust
invalid-email-address Sep 18, 2026
c684a2f
Merge ref '420ed2a0c3d7' from rust-lang/rust
invalid-email-address Sep 18, 2026
079eba0
Merge pull request #3023 from rust-lang/rustc-pull
tshepang Sep 18, 2026
6863838
improve closure.md
tshepang Sep 18, 2026
b8c15ce
sembr src/tests/ecosystem-test-jobs/fuchsia.md
tshepang Sep 18, 2026
d9d1b3e
improve tests/ecosystem-test-jobs/fuchsia.md
tshepang Sep 18, 2026
40060e4
Merge pull request #3024 from rust-lang/tshepang/misc
tshepang Sep 18, 2026
b7bad07
Add Natvis visualiser and debuginfo tests for `f128`
beetrees Aug 25, 2026
1ee8475
Split three tests out of file_test_windows_fileext_trait()
json420 Sep 18, 2026
c9c5a06
Remove old versions of those 3 tests
json420 Sep 18, 2026
66a3b72
Split remaining file_test_windows_fileext_trait() into case 4, 5
json420 Sep 18, 2026
3d281d4
implement `VaArgSafe` for `f128`
folkertdev Sep 3, 2026
f5965de
Merge commit '39f626bc72757517b75d8e2dde50fa832b8d6c03'
GuillaumeGomez Sep 18, 2026
71f10b4
More test cleanup, always test expected_offset where possible
json420 Sep 18, 2026
4ca0cc1
Update gcc submodule
GuillaumeGomez Sep 18, 2026
c10c4cf
Fix source code divergence
GuillaumeGomez Sep 18, 2026
e9aaeef
Test read first for consistency
json420 Sep 18, 2026
c2218a7
Use same doctsring examples as seek_read(), seek_write()
json420 Sep 18, 2026
6ac2b72
Missing period
json420 Sep 18, 2026
a3ad87e
mark `f128` as reliable on `powerpc` with `+vsx`
folkertdev Sep 18, 2026
9f6895f
Ignore more `run-make` tests for the GCC backend
GuillaumeGomez Sep 18, 2026
cf4bee6
Remove forgotten file
GuillaumeGomez Sep 18, 2026
b2c6d2d
Refactor LivenessResults into LivenessComputation, without typeck
jackh726 Aug 28, 2026
325dec1
Rollup merge of #162499 - GuillaumeGomez:subtree-update_cg_gcc_2026-0…
Zalathar Sep 19, 2026
167fcb2
Rollup merge of #161424 - folkertdev:va-arg-f128, r=tgross35
Zalathar Sep 19, 2026
ad44572
Rollup merge of #161777 - beetrees:f128-debuginfo, r=JohnTitor
Zalathar Sep 19, 2026
566f9b3
Rollup merge of #162506 - chenyukang:yukang-fix-134146-block-scoped-t…
Zalathar Sep 19, 2026
894d8b7
Rollup merge of #162591 - fmease:out-of-line-recovery, r=petrochenkov
Zalathar Sep 19, 2026
22dc4ee
Rollup merge of #162669 - GuillaumeGomez:inline-same-item-with-differ…
Zalathar Sep 19, 2026
e30280a
Rollup merge of #162733 - maxdexh:unique-arc-pub-apis, r=nia-e
Zalathar Sep 19, 2026
ad3325f
Rollup merge of #162913 - jackh726:trace-refactor, r=lqd
Zalathar Sep 19, 2026
05be82c
Rollup merge of #162950 - nnethercote:more-lowering-cleanups, r=spast…
Zalathar Sep 19, 2026
d03b033
Rollup merge of #162964 - GuillaumeGomez:update-browser-ui-test, r=ji…
Zalathar Sep 19, 2026
966cb7e
Rollup merge of #162979 - folkertdev:ppc-enable-f128, r=beetrees
Zalathar Sep 19, 2026
b835aa1
Rollup merge of #161743 - joonas-001:codex/round-ties-even-docs, r=Jo…
Zalathar Sep 19, 2026
6097e9b
Rollup merge of #162797 - khyperia:yeet-opt_def_id, r=BoxyUwU,bit-aloo
Zalathar Sep 19, 2026
0bc076d
Rollup merge of #162836 - clarfonthey:libs-ping, r=ChrisDenton
Zalathar Sep 19, 2026
b8949e5
Rollup merge of #162873 - nnethercote:fix-emit_bug, r=mejrs
Zalathar Sep 19, 2026
6eb6b8e
Rollup merge of #162875 - json420:seek_read_exact, r=clarfonthey
Zalathar Sep 19, 2026
55f42cf
Rollup merge of #162956 - beetrees:test-repr-c-struct, r=folkertdev
Zalathar Sep 19, 2026
d634e9c
Rollup merge of #162981 - tshepang:rdg-sync, r=tshepang
Zalathar Sep 19, 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
4 changes: 2 additions & 2 deletions compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
expr.span,
hir::ExprKind::Err(self.dcx().emit_err(AwaitOnlyInAsyncFnAndBlocks {
await_kw_span,
item_span: self.current_item,
item_span: self.current_item_span,
})),
);
return hir::ExprKind::Block(
Expand Down Expand Up @@ -1712,7 +1712,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
}
Some(hir::CoroutineKind::Coroutine(_)) => false,
None => {
let suggestion = self.current_item.map(|s| s.shrink_to_lo());
let suggestion = self.current_item_span.map(|s| s.shrink_to_lo());
self.dcx().emit_err(YieldInClosure { span, suggestion });
self.coroutine_kind = Some(hir::CoroutineKind::Coroutine(Movability::Movable));

Expand Down
68 changes: 9 additions & 59 deletions compiler/rustc_ast_lowering/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ use rustc_errors::{E0570, ErrorGuaranteed, struct_span_code_err};
use rustc_hir::attrs::{AttributeKind, EiiImplResolution};
use rustc_hir::def::{DefKind, PerNS, Res};
use rustc_hir::{
self as hir, CRATE_OWNER_ID, HirId, ImplItemImplKind, LifetimeSource, PredicateOrigin, Target,
find_attr,
self as hir, HirId, ImplItemImplKind, LifetimeSource, PredicateOrigin, Target, find_attr,
};
use rustc_middle::middle::resolve::ResolverAstLowering;
use rustc_middle::ty::TyCtxt;
use rustc_middle::ty::data_structures::IndexMap;
use rustc_span::def_id::{DefId, LocalDefId};
use rustc_span::edit_distance::find_best_match_for_name;
Expand All @@ -28,14 +25,9 @@ use super::{
};
use crate::diagnostics::{ConstComptimeFn, ResolvingRestrictionKind, RestrictionAncestorOnly};

pub(super) struct ItemLowerer<'a, 'hir> {
pub(super) tcx: TyCtxt<'hir>,
pub(super) resolver: &'a ResolverAstLowering<'hir>,
}

/// When we have a ty alias we *may* have two where clauses. To give the best diagnostics, we set the span
/// to the where clause that is preferred, if it exists. Otherwise, it sets the span to the other where
/// clause if it exists.
/// When we have a ty alias we *may* have two where clauses. To give the best diagnostics, we set
/// the span to the where clause that is preferred, if it exists. Otherwise, it sets the span to
/// the other where clause if it exists.
fn add_ty_alias_where_clause(
generics: &mut ast::Generics,
after_where_clause: &ast::WhereClause,
Expand All @@ -52,48 +44,6 @@ fn add_ty_alias_where_clause(
if before.0 || !after.0 { before } else { after };
}

impl<'hir> ItemLowerer<'_, 'hir> {
fn with_lctx(
&mut self,
owner: NodeId,
f: impl FnOnce(&mut LoweringContext<'_, 'hir>) -> hir::OwnerNode<'hir>,
) -> hir::MaybeOwner<'hir> {
let mut lctx = LoweringContext::new(self.tcx, self.resolver, owner);

let item = f(&mut lctx);

let info = lctx.curr_owner.into_owner_info(self.tcx, item);
hir::MaybeOwner::Owner(lctx.arena.alloc(info))
}

#[instrument(level = "debug", skip(self, c))]
pub(super) fn lower_crate(&mut self, c: &Crate) -> hir::MaybeOwner<'hir> {
self.with_lctx(CRATE_NODE_ID, |lctx| {
debug_assert_eq!(lctx.curr_owner.owner_id(), CRATE_OWNER_ID);
let module = lctx.lower_mod(&c.items, &c.spans);
lctx.lower_attrs(hir::CRATE_HIR_ID, &c.attrs, c.spans.inner_span, Target::Crate);
hir::OwnerNode::Crate(module)
})
}

#[instrument(level = "debug", skip(self))]
pub(super) fn lower_item(&mut self, item: &Item) -> hir::MaybeOwner<'hir> {
self.with_lctx(item.id, |lctx| hir::OwnerNode::Item(lctx.lower_item(item)))
}

pub(super) fn lower_trait_item(&mut self, item: &AssocItem) -> hir::MaybeOwner<'hir> {
self.with_lctx(item.id, |lctx| hir::OwnerNode::TraitItem(lctx.lower_trait_item(item)))
}

pub(super) fn lower_impl_item(&mut self, item: &AssocItem) -> hir::MaybeOwner<'hir> {
self.with_lctx(item.id, |lctx| hir::OwnerNode::ImplItem(lctx.lower_impl_item(item)))
}

pub(super) fn lower_foreign_item(&mut self, item: &ForeignItem) -> hir::MaybeOwner<'hir> {
self.with_lctx(item.id, |lctx| hir::OwnerNode::ForeignItem(lctx.lower_foreign_item(item)))
}
}

impl<'hir> LoweringContext<'_, 'hir> {
pub(super) fn lower_mod(
&mut self,
Expand Down Expand Up @@ -203,7 +153,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
}
}

fn lower_item(&mut self, i: &Item) -> &'hir hir::Item<'hir> {
pub(super) fn lower_item(&mut self, i: &Item) -> &'hir hir::Item<'hir> {
let owner_id = self.curr_owner.owner_id();
let hir_id: HirId = owner_id.into();
let vis_span = self.lower_span(i.vis.span);
Expand Down Expand Up @@ -544,7 +494,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
}
ItemKind::MacroDef(ident, MacroDef { body, macro_rules, eii_declaration: _ }) => {
let ident = self.lower_ident(*ident);
let body = Box::new(self.lower_delim_args(body));
let body = body.clone();
let def_id = self.curr_owner.owner.def_id;
let def_kind = self.tcx.def_kind(def_id);
let DefKind::Macro(macro_kinds) = def_kind else {
Expand Down Expand Up @@ -730,7 +680,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
}
}

fn lower_foreign_item(&mut self, i: &ForeignItem) -> &'hir hir::ForeignItem<'hir> {
pub(super) fn lower_foreign_item(&mut self, i: &ForeignItem) -> &'hir hir::ForeignItem<'hir> {
let owner_id = self.curr_owner.owner_id();
let hir_id: HirId = owner_id.into();
let attrs =
Expand Down Expand Up @@ -911,7 +861,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
}
}

fn lower_trait_item(&mut self, i: &AssocItem) -> &'hir hir::TraitItem<'hir> {
pub(super) fn lower_trait_item(&mut self, i: &AssocItem) -> &'hir hir::TraitItem<'hir> {
let trait_item_def_id = self.curr_owner.owner_id();
let hir_id: HirId = trait_item_def_id.into();
let attrs = self.lower_attrs(
Expand Down Expand Up @@ -1160,7 +1110,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
ident
}

fn lower_impl_item(&mut self, i: &AssocItem) -> &'hir hir::ImplItem<'hir> {
pub(super) fn lower_impl_item(&mut self, i: &AssocItem) -> &'hir hir::ImplItem<'hir> {
let owner_id = self.curr_owner.owner_id();
let hir_id: HirId = owner_id.into();
let parent_id = self.tcx.local_parent(owner_id.def_id);
Expand Down
71 changes: 44 additions & 27 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ use rustc_hir::def_id::{DefId, LOCAL_CRATE, LocalDefId, LocalDefIdMap};
use rustc_hir::definitions::PerParentDisambiguatorState;
use rustc_hir::lints::DelayedLint;
use rustc_hir::{
self as hir, AngleBrackets, ConstArg, GenericArg, HirId, ItemLocalMap, LifetimeSource,
LifetimeSyntax, MissingLifetimeKind, ParamName, Target, TraitCandidate, find_attr,
self as hir, AngleBrackets, CRATE_OWNER_ID, ConstArg, GenericArg, HirId, ItemLocalMap,
LifetimeSource, LifetimeSyntax, MissingLifetimeKind, ParamName, Target, TraitCandidate,
find_attr,
};
use rustc_index::{Idx, IndexSlice, IndexVec};
use rustc_macros::extension;
Expand Down Expand Up @@ -296,7 +297,7 @@ struct LoweringContext<'a, 'hir> {

/// Used to get the current `fn`'s def span to point to when using `await`
/// outside of an `async fn`.
current_item: Option<Span>,
current_item_span: Option<Span>,

try_block_scope: TryBlockScope,
loop_scope: Option<HirId>,
Expand Down Expand Up @@ -366,7 +367,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
is_in_dyn_type: false,
coroutine_kind: None,
task_context: None,
current_item: None,
current_item_span: None,

move_expr_bindings: Vec::new(),
lowering_move_expr_initializer: false,
Expand Down Expand Up @@ -783,15 +784,37 @@ fn lower_to_hir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::MaybeOwner<'_> {
return fallback_to_ancestor(tcx.local_parent(def_id));
};

let mut item_lowerer = item::ItemLowerer { tcx, resolver: &*resolver };
fn with_lctx<'hir>(
tcx: TyCtxt<'hir>,
resolver: &ResolverAstLowering<'hir>,
owner: NodeId,
f: impl FnOnce(&mut LoweringContext<'_, 'hir>) -> hir::OwnerNode<'hir>,
) -> hir::MaybeOwner<'hir> {
let mut lctx = LoweringContext::new(tcx, resolver, owner);
let item = f(&mut lctx);
hir::MaybeOwner::Owner(lctx.curr_owner.into_owner_info(tcx, item))
}

let item = match &node {
// The item existed in the AST.
AstOwner::Crate(c) => item_lowerer.lower_crate(&c),
AstOwner::Item(item) => item_lowerer.lower_item(&item),
AstOwner::TraitItem(item) => item_lowerer.lower_trait_item(&item),
AstOwner::ImplItem(item) => item_lowerer.lower_impl_item(&item),
AstOwner::ForeignItem(item) => item_lowerer.lower_foreign_item(&item),
AstOwner::Crate(c) => with_lctx(tcx, &*resolver, CRATE_NODE_ID, |lctx| {
debug_assert_eq!(lctx.curr_owner.owner_id(), CRATE_OWNER_ID);
let module = lctx.lower_mod(&c.items, &c.spans);
lctx.lower_attrs(hir::CRATE_HIR_ID, &c.attrs, c.spans.inner_span, Target::Crate);
hir::OwnerNode::Crate(module)
}),
AstOwner::Item(item) => {
with_lctx(tcx, &*resolver, item.id, |lctx| hir::OwnerNode::Item(lctx.lower_item(item)))
}
AstOwner::TraitItem(item) => with_lctx(tcx, &*resolver, item.id, |lctx| {
hir::OwnerNode::TraitItem(lctx.lower_trait_item(item))
}),
AstOwner::ImplItem(item) => with_lctx(tcx, &*resolver, item.id, |lctx| {
hir::OwnerNode::ImplItem(lctx.lower_impl_item(item))
}),
AstOwner::ForeignItem(item) => with_lctx(tcx, &*resolver, item.id, |lctx| {
hir::OwnerNode::ForeignItem(lctx.lower_foreign_item(item))
}),
AstOwner::NestedUseTree(owner_id) => fallback_to_ancestor(*owner_id),
// The item existed in the AST, but is not a HIR owner.
// Fetch the correct information from its parent.
Expand Down Expand Up @@ -824,7 +847,7 @@ enum GenericArgsMode {
ParenSugar,
/// Allow RTN, don't allow paren sugar.
ReturnTypeNotation,
// Error if parenthesized generics or RTN are encountered.
/// Error if parenthesized generics or RTN are encountered.
Err,
/// Silence errors when lowering generics. Only used with `Res::Err`.
Silence,
Expand Down Expand Up @@ -982,7 +1005,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
}

#[instrument(level = "trace", skip(self))]
fn lower_res(&mut self, res: Res<NodeId>) -> Res {
fn lower_res(&self, res: Res<NodeId>) -> Res {
let res: Result<Res, ()> = res.apply_id(|id| {
let owner = self.curr_owner.owner_id();
let local_id =
Expand All @@ -999,11 +1022,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
res.unwrap_or(Res::Err)
}

fn expect_full_res(&mut self, id: NodeId) -> Res<NodeId> {
fn expect_full_res(&self, id: NodeId) -> Res<NodeId> {
self.get_partial_res(id).map_or(Res::Err, |pr| pr.expect_full_res())
}

fn lower_import_res(&mut self, id: NodeId, span: Span) -> PerNS<Option<Res>> {
fn lower_import_res(&self, id: NodeId, span: Span) -> PerNS<Option<Res>> {
debug_assert_eq!(id, self.curr_owner.owner.id);
let per_ns = self.curr_owner.owner.import_res.map(|res| res.map(|res| self.lower_res(res)));
if per_ns.is_empty() {
Expand Down Expand Up @@ -1154,8 +1177,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
}

fn with_new_scopes<T>(&mut self, scope_span: Span, f: impl FnOnce(&mut Self) -> T) -> T {
let current_item = self.current_item;
self.current_item = Some(scope_span);
let current_item_span = self.current_item_span;
self.current_item_span = Some(scope_span);

let was_in_loop_condition = self.is_in_loop_condition;
self.is_in_loop_condition = false;
Expand All @@ -1172,7 +1195,7 @@ impl<'hir> LoweringContext<'_, 'hir> {

self.is_in_loop_condition = was_in_loop_condition;

self.current_item = current_item;
self.current_item_span = current_item_span;

ret
}
Expand Down Expand Up @@ -1261,10 +1284,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
}
}

fn lower_delim_args(&self, args: &DelimArgs) -> DelimArgs {
args.clone()
}

/// Lower an associated item constraint.
#[instrument(level = "debug", skip_all)]
fn lower_assoc_item_constraint(
Expand Down Expand Up @@ -1647,8 +1666,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
self.lower_array_length_to_const_arg(length),
),
TyKind::TraitObject(bounds, kind) => {
let mut lifetime_bound = None;
let (bounds, lifetime_bound) = self.with_dyn_type_scope(true, |this| {
let mut lifetime_bound = None;
let bounds =
this.arena.alloc_from_iter(bounds.iter().filter_map(|bound| match bound {
// We can safely ignore constness here since AST validation
Expand Down Expand Up @@ -1681,9 +1700,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
None
}
}));
let lifetime_bound =
lifetime_bound.unwrap_or_else(|| this.elided_dyn_bound(t.span));
(bounds, lifetime_bound)
(bounds, lifetime_bound.unwrap_or_else(|| this.elided_dyn_bound(t.span)))
});
hir::TyKind::TraitObject(bounds, TaggedRef::new(lifetime_bound, *kind))
}
Expand Down Expand Up @@ -3058,15 +3075,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
}))
}

fn lower_unsafe_source(&mut self, u: UnsafeSource) -> hir::UnsafeSource {
fn lower_unsafe_source(&self, u: UnsafeSource) -> hir::UnsafeSource {
match u {
CompilerGenerated => hir::UnsafeSource::CompilerGenerated,
UserProvided => hir::UnsafeSource::UserProvided,
}
}

fn lower_trait_bound_modifiers(
&mut self,
&self,
modifiers: TraitBoundModifiers,
) -> hir::TraitBoundModifiers {
let constness = match modifiers.constness {
Expand Down
10 changes: 0 additions & 10 deletions compiler/rustc_borrowck/src/region_infer/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,16 +409,6 @@ impl<'tcx, N: Idx> RegionValues<'tcx, N> {
}
}

/// For debugging purposes, returns a pretty-printed string of the given points.
pub(crate) fn pretty_print_points(
location_map: &DenseLocationMap,
points: impl IntoIterator<Item = PointIndex>,
) -> String {
pretty_print_region_elements(
points.into_iter().map(|p| location_map.to_location(p)).map(RegionElement::Location),
)
}

/// For debugging purposes, returns a pretty-printed string of the given region elements.
fn pretty_print_region_elements<'tcx>(
elements: impl IntoIterator<Item = RegionElement<'tcx>>,
Expand Down
20 changes: 19 additions & 1 deletion compiler/rustc_borrowck/src/type_check/liveness/mod.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
use itertools::{Either, Itertools};
use rustc_data_structures::fx::FxHashSet;
use rustc_index::interval::IntervalSet;
use rustc_middle::mir::visit::{TyContext, Visitor};
use rustc_middle::mir::{Body, Local, Location, SourceInfo};
use rustc_middle::ty::relate::Relate;
use rustc_middle::ty::{GenericArgsRef, Region, RegionVid, Ty, TyCtxt, TypeVisitable};
use rustc_mir_dataflow::move_paths::MoveData;
use rustc_mir_dataflow::points::DenseLocationMap;
use rustc_mir_dataflow::points::{DenseLocationMap, PointIndex};
use rustc_span::span_bug;
use rustc_trait_selection::traits::outlives_for_liveness::FreeRegionsVisitor;
use tracing::debug;

use super::TypeChecker;
use crate::BorrowckInferCtxt;
use crate::constraints::OutlivesConstraintSet;
use crate::polonius::{PoloniusContext, record_live_region_variance};
use crate::region_infer::values::LivenessValues;
Expand Down Expand Up @@ -229,3 +232,18 @@ impl<'a, 'tcx> LiveVariablesVisitor<'a, 'tcx> {
}
}
}

pub(crate) fn make_all_regions_live<'tcx>(
infcx: &BorrowckInferCtxt<'tcx>,
universal_regions: &UniversalRegions<'tcx>,
liveness: &mut LivenessValues,
value: impl TypeVisitable<TyCtxt<'tcx>>,
live_at: &IntervalSet<PointIndex>,
) {
debug!("make_all_regions_live(value={value:?})");
value.visit_with(&mut FreeRegionsVisitor {
tcx: infcx.tcx,
param_env: infcx.param_env,
op: |r| liveness.add_points(universal_regions.to_region_vid(r), live_at),
});
}
Loading
Loading