35474 Commits

Author SHA1 Message Date
Shoyu Vanilla (Flint)
eede8f1f4e
Merge pull request #20212 from ChayimFriedman2/dyn-hint
fix: Fixes for `dyn` inlay hint
2025-07-10 04:57:57 +00:00
Shoyu Vanilla (Flint)
df1c3e03df
Merge pull request #20218 from Hmikihiro/migrate_convert_match_to_let_else
Migrate `convert_match_to_let_else` assist to use `SyntaxEditor`
2025-07-10 04:32:40 +00:00
Hayashi Mikihiro
be609a57bf Migrate convert_match_to_let_else assist to use SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-10 11:22:32 +09:00
Chayim Refael Friedman
ad708fdbd1 Put the expression stuff in the expression store behind an Option<Box>
And leave only the type stuff without it.

This is because most expression stores don't have anything but types (e.g. generics, fields, signatures) so this saves a lot of memory.

This saves 58mb on `analysis-stats .`.
2025-07-10 05:18:43 +03:00
bors
816b4a6b52 Auto merge of #143405 - tgross35:update-builtins, r=tgross35
Update the `compiler-builtins` subtree

Update the Josh subtree to https://github.com/rust-lang/compiler-builtins/commit/8aba4c899ee8.

r? `@ghost`
2025-07-09 22:42:11 +00:00
Ed Page
f4d9018a48 feat(lexer): Allow including frontmatter with 'tokenize' 2025-07-09 16:42:27 -05:00
bors
57b64a7d1a Auto merge of #143538 - compiler-errors:instantiate-auto-trait, r=lcnr
Instantiate auto trait/`Copy`/`Clone`/`Sized` before computing constituent types binder

This makes the binder logic w.r.t. coroutines a bit simpler.

r? lcnr
2025-07-09 19:38:39 +00:00
Chayim Refael Friedman
f8e2fa0e80 Make AsmExpr have AstId
We need it because `global_asm!()` is an item. It's unfortunate that such thing can slip in and I see no way to automatically catch that, but thankfully analysis-stats on self has caught that.
2025-07-09 21:43:20 +03:00
Chayim Refael Friedman
6e3abe164b
Merge pull request #20214 from rust-lang/update-msrv
Update MSRV to 1.88.0
2025-07-09 18:41:33 +00:00
Laurențiu Nicola
05ca3f16b3
Merge pull request #20211 from Hmikihiro/migrate-convert_named_struct
Migrate `convert_named_struct_to_tuple_struct` assist to use 'SyntaxEditor'
2025-07-09 18:35:28 +00:00
Chayim Refael Friedman
a059c0b182
Update MSRV to 1.88.0 2025-07-09 21:30:22 +03:00
bors
d64ef7403c Auto merge of #143502 - scottmcm:aggregate-simd, r=oli-obk
Let `rvalue_creates_operand` return true for *all* `Rvalue::Aggregate`s

~~Draft for now because it's built on Ralf's rust-lang/rust#143291~~

Inspired by https://github.com/rust-lang/rust/pull/138759#discussion_r2156375342 where I noticed that we were nearly at this point, plus the comments I was writing in rust-lang/rust#143410 that reminded me a type-dependent `true` is fine.

This PR splits the `OperandRef::builder` logic out to a separate type, with the updates needed to handle SIMD as well.  In doing so, that makes the existing `Aggregate` path in `codegen_rvalue_operand` capable of handing SIMD values just fine.

As a result, we no longer need to do layout calculations for aggregate result types when running the analysis to determine which things can be SSA in codegen.
2025-07-09 16:37:20 +00:00
Chayim Refael Friedman
a8e67dffca Put dyn inlay hints in their correct place in presence of parentheses 2025-07-09 19:33:47 +03:00
Chayim Refael Friedman
5e30dab65c Disable the diagnostics_dont_block_typing test on CI
It's failing to much. We need to fix it, but my changes are unlikely to be the cause.
2025-07-09 19:29:11 +03:00
Chayim Refael Friedman
3931afa624 Don't show dyn hint in a HRTB bound 2025-07-09 19:19:51 +03:00
Hayashi Mikihiro
5a410c3215 migrate convert_named_struct_to_tuple_struct assist to use 'SyntaxEditor'
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-10 01:01:47 +09:00
Chayim Refael Friedman
95c04c4503 Make global_asm!() work
Because apparently, we were not accepting inline asm in item position, completely breaking it.
2025-07-09 18:55:27 +03:00
Shoyu Vanilla (Flint)
64551a5696
Merge pull request #20109 from Hmikihiro/generate_new_tuple_field
feat: Generate `new` for tuple struct
2025-07-09 15:22:47 +00:00
Chayim Refael Friedman
bd8087e86e Differentiate between asm!(), global_asm!() and naked_asm!(), and make only asm!() unsafe 2025-07-09 17:37:27 +03:00
Chayim Refael Friedman
edb804a100 Don't hash the SyntaxKind in the ast id
There is no need to, it's already stored in the `kind`.
2025-07-09 17:21:45 +03:00
bors
3a5e13a8b3 Auto merge of #143472 - dianne:deref-pat-column-check, r=Nadrieril
`rustc_pattern_analysis`: always check that deref patterns don't match on the same place as normal constructors

In rust-lang/rust#140106, deref pattern validation was tied to the `deref_patterns` feature to temporarily avoid affecting perf. However:
- As of rust-lang/rust#143414, box patterns are represented as deref patterns in `rustc_pattern_analysis`. Since they can be used by enabling `box_patterns` instead of `deref_patterns`, it was possible for them to skip validation, resulting in an ICE. This fixes that and adds a regression test.
- External tooling (e.g. rust-analyzer) will also need to validate matches containing deref patterns, which was not possible. This fixes that by making `compute_match_usefulness` validate deref patterns by default.

In order to avoid doing an extra pass for anything with patterns, the second commit makes `RustcPatCtxt` keep track of whether it encounters a deref pattern, so that it only does the check if so. This is purely for performance. If the perf impact of the first commit is negligible and the complexity cost introduced by the second commit is significant, it may be worth dropping the latter.

r? `@Nadrieril`
2025-07-09 09:45:36 +00:00
bors
d0188bdb3d Auto merge of #142707 - ashivaram23:drop_wildcard, r=dianqk
Apply effects to `otherwise` edge in dataflow analysis

This allows `ElaborateDrops` to remove drops when a `match` wildcard arm covers multiple no-Drop enum variants. It modifies dataflow analysis to update the `MaybeUninitializedPlaces` and `MaybeInitializedPlaces` data for a block reached through an `otherwise` edge.

Fixes rust-lang/rust#142705.
2025-07-09 03:42:01 +00:00
Shoyu Vanilla (Flint)
e429bac879
Merge pull request #20200 from rust-lang/revert-20157-push-nxrvpywtvoys
Revert "Re-enable fixpoint iteration for variance computation"
2025-07-09
2025-07-09 02:30:26 +00:00
Shoyu Vanilla (Flint)
66e248c661
Merge pull request #20198 from Hmikihiro/migrate_pull_asignment_up
Migrate `pull_assignment_up` assist to use`SyntaxEditor`
2025-07-09 01:51:48 +00:00
Chayim Refael Friedman
43644ca4fe
Revert "Re-enable fixpoint iteration for variance computation" 2025-07-08 23:41:22 +03:00
Hayashi Mikihiro
c6ce2abd47 Migrate pull_assignment_up assist to SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-09 00:58:58 +09:00
Amanieu d'Antras
6e66342f5b
Merge pull request #1853 from Kobzol/pull-fixed
Perform the first rustc pull.. for the second time
2025-07-08 15:10:51 +00:00
Jakub Beránek
ecb76fa9ed
Merge ref '040e2f8b9ff2' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 040e2f8b9ff2d76fbe2146d6003e297ed4532088
Filtered ref: cf4d00a666607e356e410a820ae07eeba28a9b53

This merge was created using https://github.com/rust-lang/josh-sync.
2025-07-08 16:18:56 +02:00
bors
82c8efd2c8 Auto merge of #134628 - estebank:const-default, r=oli-obk
Make `Default` const and add some `const Default` impls

Full list of `impl const Default` types:

- ()
- bool
- char
- std::ascii::Char
- usize
- u8
- u16
- u32
- u64
- u128
- i8
- i16
- i32
- i64
- i128
- f16
- f32
- f64
- f128
- std::marker::PhantomData<T>
- Option<T>
- std::iter::Empty<T>
- std::ptr::Alignment
- &[T]
- &mut [T]
- &str
- &mut str
- String
- Vec<T>
2025-07-08 14:04:40 +00:00
bors
bd73e9e1fb Auto merge of #143540 - yotamofek:pr/library/simplify-num-fmt, r=tgross35
Simplify num formatting helpers

Noticed `ilog10` was being open-coded when looking at this diff: 85d6768f4c..76d9775912 (diff-6be9b44b52d946ccac652ddb7c98146a01b22ea0fc5737bc10db245a24796a45)
That, and two other small cleanups 😁

(should probably go through perf just to make sure it doesn't regress formatting)
2025-07-08 10:54:22 +00:00
bors
766712c269 Auto merge of #142869 - nnethercote:join_path-mini, r=camelid
Use `join_with_double_colon` in `write_shared.rs`.

For consistency. Also, it's faster because `join_with_double_colon` does a better job estimating the allocation size than `join` from `itertools`.

r? `@camelid`
2025-07-08 06:32:37 +00:00
Lukas Wirth
9a1fc3cdb8
Merge pull request #20192 from ChayimFriedman2/link-type-panic
fix: Fix a case where the link type was `None`
2025-07-08 05:52:58 +00:00
bors
d0a4543f88 Auto merge of #143433 - oli-obk:ty_span_qry, r=compiler-errors
Add `ty_span` query

r? `@compiler-errors`

fixes diagnostic regressions from https://github.com/rust-lang/rust/pull/142030

Also uses the new query in `check_const_item`
2025-07-08 00:11:13 +00:00
bors
af15612448 Auto merge of #143601 - matthiaskrgr:rollup-9iw2sqk, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#132469 (Do not suggest borrow that is already there in fully-qualified call)
 - rust-lang/rust#143340 (awhile -> a while where appropriate)
 - rust-lang/rust#143438 (Fix the link in `rustdoc.md`)
 - rust-lang/rust#143539 (Regression tests for repr ICEs)
 - rust-lang/rust#143566 (Fix `x86_64-unknown-netbsd` platform support page)
 - rust-lang/rust#143572 (Remove unused allow attrs)
 - rust-lang/rust#143583 (`loop_match`: fix 'no terminator on block')
 - rust-lang/rust#143584 (make `Machine::load_mir` infallible)
 - rust-lang/rust#143591 (Fix missing words in future tracking issue)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-07 20:30:53 +00:00
Lukas Wirth
778e08df16
Merge pull request #20180 from ChayimFriedman2/parser-stuck
fix: Always bump in the parser in `err_and_bump()`
2025-07-07 18:42:12 +00:00
Matthias Krüger
5b0bebbdad
Rollup merge of #143591 - ehuss:future-typos, r=jieyouxu
Fix missing words in future tracking issue

Fixes some sloppy editing on my part.
2025-07-07 19:55:37 +02:00
Matthias Krüger
dbadd94323
Rollup merge of #143584 - fee1-dead-contrib:push-skswvrwsrmll, r=RalfJung
make `Machine::load_mir` infallible

it doesn't need to return an `InterpResult`.
2025-07-07 19:55:36 +02:00
Matthias Krüger
d08465b50e
Rollup merge of #143583 - folkertdev:loop-match-no-terminator-on-block, r=bjorn3
`loop_match`: fix 'no terminator on block'

tracking issue: https://github.com/rust-lang/rust/issues/132306
fixes https://github.com/rust-lang/rust/issues/143435

The argument `block` was not properly closed on an error path.

r? `@bjorn3`
2025-07-07 19:55:35 +02:00
Matthias Krüger
1693eac9a4
Rollup merge of #143572 - yotamofek:pr/unused-allow-attrs, r=fee1-dead
Remove unused allow attrs

These `#[allow]`s seem to be unused (at least according to `x check`, didn't run `x test` locally). Let's clean them up! 🧹
2025-07-07 19:55:35 +02:00
Matthias Krüger
18612f8670
Rollup merge of #143566 - jieyouxu:fix-x86_64-unknown-netbsd, r=fee1-dead
Fix `x86_64-unknown-netbsd` platform support page

`x86_64-unknown-netbsd` is Tier 2 with host tools, not Tier 3.

cc `@he32.`

r? compiler
2025-07-07 19:55:34 +02:00
Matthias Krüger
d6dc3d9825
Rollup merge of #143539 - JonathanBrouwer:ice-regression-tests, r=oli-obk
Regression tests for repr ICEs

Closes https://github.com/rust-lang/rust/issues/143522
Closes https://github.com/rust-lang/rust/issues/143479

Both issues were already (accidentally) fixed in this PR, but having the tests is nice https://github.com/rust-lang/rust/pull/143252

r? `@jdonszelmann`
2025-07-07 19:55:33 +02:00
Matthias Krüger
818b0d76e0
Rollup merge of #143438 - makai410:rustdoc-fix, r=ehuss
Fix the link in `rustdoc.md`
2025-07-07 19:55:33 +02:00
Matthias Krüger
23584a4666
Rollup merge of #143340 - nabijaczleweli:awhile, r=mati865
awhile -> a while where appropriate
2025-07-07 19:55:32 +02:00
Matthias Krüger
36929fb177
Rollup merge of #132469 - estebank:issue-132041, r=Nadrieril
Do not suggest borrow that is already there in fully-qualified call

When encountering `&str::from("value")` do not suggest `&&str::from("value")`.

Fix #132041.
2025-07-07 19:55:31 +02:00
Chayim Refael Friedman
793e1573d4 Fix a case where the link type was None
Which caused a panic.
2025-07-07 20:44:18 +03:00
bors
b00b4ea65b Auto merge of #143182 - xdoardo:more-addrspace, r=workingjubilee
Allow custom default address spaces and parse `p-` specifications in the datalayout string

Some targets, such as CHERI, use as default an address space different from the "normal" default address space `0` (in the case of CHERI, [200 is used](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-877.pdf)). Currently, `rustc` does not allow to specify custom address spaces and does not take into consideration [`p-` specifications in the datalayout string](https://llvm.org/docs/LangRef.html#langref-datalayout).

This patch tries to mitigate these problems by allowing targets to define a custom default address space (while keeping the default value to address space `0`) and adding the code to parse the `p-` specifications in `rustc_abi`. The main changes are that `TargetDataLayout` now uses functions to refer to pointer-related informations, instead of having specific fields for the size and alignment of pointers in the default address space; furthermore, the two `pointer_size` and `pointer_align` fields in `TargetDataLayout` are replaced with an `FxHashMap` that holds info for all the possible address spaces, as parsed by the `p-` specifications.

The potential performance drawbacks of not having ad-hoc fields for the default address space will be tested in this PR's CI run.

r? workingjubilee
2025-07-07 17:28:14 +00:00
David Barsky
5bae4f5c81
Merge pull request #20185 from ChayimFriedman2/variant-symbols
feat: Include enum variants in world symbols
2025-07-07 15:15:27 +00:00
bors
7d6f447a4d Auto merge of #143035 - ywxt:less-work-steal, r=oli-obk
Only work-steal in the main loop for rustc_thread_pool

This PR is a replica of <https://github.com/rust-lang/rustc-rayon/pull/12> that only retained work-steal in the main loop for rustc_thread_pool.

r? `@oli-obk`

cc `@SparrowLii` `@Zoxc` `@cuviper`

Updates rust-lang/rust#113349
2025-07-07 11:16:16 +00:00
bors
1bc1f34608 Auto merge of #143565 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-07-07 08:14:30 +00:00
Edoardo Marangoni
54507d88b4
compiler: Parse p- specs in datalayout string, allow definition of custom default data address space 2025-07-07 09:04:53 +02:00