33812 Commits

Author SHA1 Message Date
David Barsky
394374e769 internal(config): use FxIndexMap for default completion snippets 2025-03-10 12:55:46 -04:00
Lukas Wirth
7368212405
Merge pull request #19305 from davidbarsky/davidbarsky/vendor-query-group-macro
internal: vendor `query-group-macro` in rust-analyzer
2025-03-10 14:29:45 +00:00
David Barsky
7a7ff470ca internal: vendor query-group-macro 2025-03-10 10:12:52 -04:00
Lukas Wirth
89092c786d
Merge pull request #19334 from Veykril/push-oynrurllmwtk
internal: Remove generated md book files
2025-03-10 13:12:43 +00:00
Lukas Wirth
b949820aff Remove generated md book files 2025-03-10 13:57:26 +01:00
Lukas Wirth
5a742d3da9
Merge pull request #19326 from Veykril/push-vovuxzkzrowp
Add missing name-ref parents to syntactic highlighting
2025-03-10 11:47:15 +00:00
Lukas Wirth
3a02514725
Merge pull request #19294 from alibektas/better_build_script_err_msgs
minor: Show build scripts errors in server status
2025-03-10 11:35:07 +00:00
Lukas Wirth
7ae98626fc Add missing name-ref parents to syntactic highlighting 2025-03-10 12:31:38 +01:00
Lukas Wirth
f81fcabdf9
Merge pull request #19332 from Veykril/push-trvznlqsvtyq
Make change annotations per text-edit
2025-03-10 11:25:13 +00:00
Lukas Wirth
d76b785ff5
Merge pull request #19333 from alexkirsz/alexkirsz/fix-diagnostics
fix: Fix diagnostics being cleared right after being received
2025-03-10 11:12:00 +00:00
Lukas Wirth
70066399f0 Make change annotations per text-edit 2025-03-10 12:08:42 +01:00
Alex Kirszenberg
6845fb8a0a Fix diagnostics being cleared right after being received 2025-03-10 11:56:50 +01:00
Laurențiu Nicola
be48993351
Merge pull request #19331 from lnicola/sync-from-rust
minor: Sync from downstream
2025-03-10 09:52:17 +00:00
Laurențiu Nicola
25e4bd1f90 Format code 2025-03-10 11:37:21 +02:00
Lukas Wirth
95a67f2650
Merge pull request #19328 from Veykril/push-umwykvoskvyp
internal: Run proc-macro server tests as separate CI job
2025-03-10 09:30:22 +00:00
Laurențiu Nicola
1afcab1725 Fix simd layout test 2025-03-10 11:21:03 +02:00
Laurențiu Nicola
bc178ff75e Bump rustc crates 2025-03-10 11:20:56 +02:00
Lukas Wirth
88ab330c77 Run proc-macro server tests are separate CI job
Touch tt
2025-03-10 10:16:32 +01:00
Lukas Wirth
27a5b1ba0c
Merge pull request #19330 from ChayimFriedman2/normalize-projection
fix: Normalize projections in evaluated const display and layout calculation
2025-03-10 09:15:35 +00:00
Lukas Wirth
cf255a61d5
Merge pull request #19079 from ChayimFriedman2/rename-conflict
feat: Warn the user when a rename will change the meaning of the program
2025-03-10 08:59:43 +00:00
Lukas Wirth
5249b8bf7e
Merge pull request #19327 from Veykril/push-qyyvkulltzpz
Fix `path` macro hygiene
2025-03-10 08:45:04 +00:00
Laurențiu Nicola
363590b450 Merge from rust-lang/rust 2025-03-10 10:41:53 +02:00
Laurențiu Nicola
ae1a648915 Preparing for merge from rust-lang/rust 2025-03-10 10:41:28 +02:00
Lukas Wirth
af7f89cc9d Fix path macro hygiene 2025-03-10 09:29:27 +01:00
Lukas Wirth
430d7c6b0d
Merge pull request #19311 from aibaars/log-build-script-error
Log build script error output in `load_cargo::load_workspace_at`
2025-03-10 08:16:10 +00:00
Lukas Wirth
476a0cb740
Merge pull request #19314 from snprajwal/variantdef-impl
fix(hir): `VariantDef` is `impl HasSource`
2025-03-10 08:13:24 +00:00
Lukas Wirth
34e352ab84
Merge pull request #19316 from snprajwal/git-commit-ec
fix: do not apply editorconfig to git commit msg
2025-03-10 08:11:48 +00:00
Lukas Wirth
90e18005eb
Merge pull request #19252 from flodiebold/fix-fixup-delimiters
Fix syntax fixup producing invalid punctuation
2025-03-10 08:11:27 +00:00
Lukas Wirth
66c40fd90d
Merge pull request #19232 from ShoyuVanilla/issue-19196
Bump chalk for built-in supports of async closures
2025-03-10 08:11:23 +00:00
Lukas Wirth
d90ac01dc2
Merge pull request #19325 from Veykril/push-sxyvwwsmtxrr
Rank ADT constructors as constructors for completion scoring
2025-03-10 05:59:23 +00:00
bors
5785c1d066 Auto merge of #137695 - nnethercote:always-inline-query_get_at, r=saethlin
Always inline `query_get_at`.

r? `@saethlin`
2025-03-09 21:36:57 +00:00
bors
0beabc724d Auto merge of #137655 - nnethercote:split-edges-iterator, r=nnethercote
Split the `Edges` iterator.

Some nice performance wins here, mostly on the `wg-grammar` benchmark.

r? `@lcnr`
2025-03-09 15:30:47 +00:00
Lukas Wirth
7202146f65 Rank ADT constructors as constructors for completion scoring 2025-03-09 15:36:53 +01:00
bors
f87e09a35b Auto merge of #138267 - matthiaskrgr:rollup-vt76bhs, r=matthiaskrgr
Rollup of 12 pull requests

Successful merges:

 - #136127 (Allow `*const W<dyn A> -> *const dyn A` ptr cast)
 - #136968 (Turn order dependent trait objects future incompat warning into a hard error)
 - #137319 (Stabilize `const_vec_string_slice`)
 - #137885 (tidy: add triagebot checks)
 - #138040 (compiler: Use `size_of` from the prelude instead of imported)
 - #138084 (Use workspace lints for crates in `compiler/`)
 - #138158 (Move more layouting logic to `rustc_abi`)
 - #138160 (depend more on attr_data_structures and move find_attr! there)
 - #138192 (crashes: couple more tests)
 - #138216 (bootstrap: Fix stack printing when a step cycle is detected)
 - #138232 (Reduce verbosity of GCC build log)
 - #138242 (Revert "Don't test new error messages with the stage 0 compiler")

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-09 12:29:49 +00:00
Lukas Wirth
5e7dd31c80
Merge pull request #19324 from ShoyuVanilla/migrate-inline-var
fix: Prevent wrong invocations of `needs_parens_in` with non-ancestral "parent"s
2025-03-10
2025-03-09 10:58:02 +00:00
Shoyu Vanilla
5b202cb663 fix: Prevent wrong invocations of needs_parens_in with non-ancestral "parent"s 2025-03-09 18:54:22 +09:00
Matthias Krüger
5f5158cf7f
Rollup merge of #138242 - tshepang:that-stage0-has-arrived, r=jieyouxu
Revert "Don't test new error messages with the stage 0 compiler"
2025-03-09 10:34:54 +01:00
Matthias Krüger
9eb6e89c69
Rollup merge of #138232 - Kobzol:gcc-reduce-verbosity, r=GuillaumeGomez
Reduce verbosity of GCC build log

It was a bit too spammy before.

Fixes: https://github.com/rust-lang/rust/issues/138213

r? ``@GuillaumeGomez``
2025-03-09 10:34:54 +01:00
Matthias Krüger
29abf7e8b6
Rollup merge of #138216 - Zalathar:any-debug, r=onur-ozkan
bootstrap: Fix stack printing when a step cycle is detected

When bootstrap detects a step dependency cycle (which represents a bootstrap bug), it is supposed to print out the contents of the step stack as part of its panic message.

However, while investigating #138205 it was found that bootstrap was actually printing out several copies of `Any { .. }`, because that is the Debug implementation for `dyn Any`. This is sadly not very helpful.

This PR fixes that problem by introducing a `trait AnyDebug: Any + Debug` that delegates to the underlying type's Debug implementation, while still allowing downcasting via Any.

---

The fixed behaviour can be verified manually (and is tested automatically) via a new dummy command, `./x run cyclic-step`:

```
$ x run cyclic-step
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.02s

thread 'main' panicked at src/bootstrap/src/core/builder/mod.rs:1521:17:

Cycle in build detected when adding CyclicStep { n: 0 }
	CyclicStep { n: 0 }
	CyclicStep { n: 1 }
	CyclicStep { n: 2 }

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:00
```
2025-03-09 10:34:53 +01:00
Matthias Krüger
5d543d2d9f
Rollup merge of #138192 - matthiaskrgr:crashes_mar, r=jieyouxu
crashes: couple more tests

try-job: aarch64-apple
try-job: x86_64-msvc-1
try-job: x86_64-gnu
try-job: dist-i586-gnu-i586-i686-musl
2025-03-09 10:34:52 +01:00
Matthias Krüger
516b30c3a8
Rollup merge of #138160 - jdonszelmann:move-find-attr2, r=oli-obk
depend more on attr_data_structures and move find_attr! there

r?  ``@oli-obk``

This should be an easy one. It just moves some imports around. This is necessary for other changes that I'm working on not to have import cycles. However, it's an easy one to just merge on its own.
2025-03-09 10:34:52 +01:00
Matthias Krüger
22774c85c0
Rollup merge of #138158 - moulins:move-layout-to-rustc_abi, r=workingjubilee
Move more layouting logic to `rustc_abi`

Move all `LayoutData`-constructing code to `rustc_abi`:
- Infaillible operations get a new `LayoutData` constructor method;
- Faillible ones get a new method on `LayoutCalculator`.
2025-03-09 10:34:51 +01:00
Matthias Krüger
cff08175f7
Rollup merge of #138040 - thaliaarchi:use-prelude-size-of.compiler, r=compiler-errors
compiler: Use `size_of` from the prelude instead of imported

Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. Apply this change across the compiler.

These functions were added to all preludes in Rust 1.80.

r? ``@compiler-errors``
2025-03-09 10:34:49 +01:00
Matthias Krüger
4fe46a3b97
Rollup merge of #137885 - klensy:tidy-triagebot, r=jieyouxu
tidy: add triagebot checks

Validates triagebot.toml to have existing paths:

`[mentions."*"]` sections, i.e.
```toml
[mentions."compiler/rustc_const_eval/src/"]
```
or
```toml
[assign.owners]
"/.github/workflows" = ["infra-ci"]
```
or

```toml
trigger_files = [
 "src/librustdoc/html/static/js/search.js",
 "tests/rustdoc-js",
 "tests/rustdoc-js-std",
 ]
```
Looked at #137876 and implemented check.
2025-03-09 10:34:48 +01:00
Matthias Krüger
b41b11715f
Rollup merge of #136968 - oli-obk:bye-bye, r=compiler-errors
Turn order dependent trait objects future incompat warning into a hard error

fixes #56484

r? ``@ghost``

will FCP when we have a crater result
2025-03-09 10:34:47 +01:00
bors
482d8b4e9c Auto merge of #137563 - FractalFir:dep_graph_cap, r=nnethercote
Change TaskDeps to start preallocated with 128 capacity

This is a tiny change that makes `TaskDeps::read_set` start preallocated with capacity for 128 elements.

From local profiling, it looks like `TaskDeps::read_set`  is one of the most-often resized hash-sets in `rustc`.
2025-03-09 09:27:35 +00:00
Shoyu Vanilla
c6ea7cbafa internal: Migrate inline_local_variable to SyntaxEditor 2025-03-09 15:51:37 +09:00
bors
ee67380a5a Auto merge of #137541 - onur-ozkan:fix-cargo-clippy-bin, r=jieyouxu
add `tool::CargoClippy` and `tool::Cargofmt` binary to target sysroot

When running `x build clippy`, we expect `stage1-tool-bin/cargo-clippy` and `stage2/bin/cargo-clippy` to be the same, but they aren't. This happens because `tool::CargoClippy` doesn't place its binary in the `stage2` directory. As a result, `stage1-tool-bin/cargo-clippy` comes from `tool::CargoClippy`, while `stage2/bin/cargo-clippy` comes from `tool::Cargo`. Same applies for `tool::Cargofmt`.

This PR fixes the issue by adding `tool::CargoClippy` and ``tool::Cargofmt`` binaries to the expected sysroot and makes sure both directories share the same binary.

To test this, run `x build --stage 2 compiler clippy rustfmt`, link the stage2 sysroot with rustup, and then call `cargo +stage2 fmt` and `cargo +stage2 clippy` on any rust project (it wouldn't work without this PR).
2025-03-09 04:31:52 +00:00
Shoyu Vanilla
00bbfb3622 Bump chalk for built-in supports of async closures 2025-03-09 11:41:08 +09:00
bors
038706986f Auto merge of #137513 - scottmcm:identity-transmute, r=saethlin
Don't re-`assume` in `transmute`s that don't change niches

I noticed in nightly 2025-02-21 that `transmute` is emitting way more `assume`s than necessary for newtypes.

For example, the three transmutes in <https://rust.godbolt.org/z/fW1KaTc4o> emits
```rust
define noundef range(i32 1, 0) i32 `@repeatedly_transparent_transmute(i32` noundef range(i32 1, 0) %_1) unnamed_addr {
start:
  %0 = sub i32 %_1, 1
  %1 = icmp ule i32 %0, -2
  call void `@llvm.assume(i1` %1)
  %2 = sub i32 %_1, 1
  %3 = icmp ule i32 %2, -2
  call void `@llvm.assume(i1` %3)
  %4 = sub i32 %_1, 1
  %5 = icmp ule i32 %4, -2
  call void `@llvm.assume(i1` %5)
  %6 = sub i32 %_1, 1
  %7 = icmp ule i32 %6, -2
  call void `@llvm.assume(i1` %7)
  %8 = sub i32 %_1, 1
  %9 = icmp ule i32 %8, -2
  call void `@llvm.assume(i1` %9)
  %10 = sub i32 %_1, 1
  %11 = icmp ule i32 %10, -2
  call void `@llvm.assume(i1` %11)
  ret i32 %_1
}
```

But those are all just newtypes that don't change size or niches, so none of it's needed.

After this PR it's down to just
```rust
define noundef range(i32 1, 0) i32 `@repeatedly_transparent_transmute(i32` noundef range(i32 1, 0) %_1) unnamed_addr {
start:
  ret i32 %_1
}
```
because none of those `assume`s in the original actually did anything.

(Transmuting to something with a difference niche, though, still has the assumes -- the other tests continue to pass checking that.)
2025-03-09 01:25:48 +00:00