Commit graph

34695 commits

Author SHA1 Message Date
bors
73c6f1d0c7 Auto merge of #138489 - tmiasko:call-tmps-lifetime, r=workingjubilee
Describe lifetime of call argument temporaries passed indirectly

Fixes #132014.
2025-05-26 01:16:52 +00:00
bors
86349e79a1 Auto merge of #141086 - a1phyr:spec_advance_by, r=jhpratt
Implement `advance_by` via `try_fold` for `Sized` iterators

When `try_fold` is overriden, it is usually easier for compilers to optimize.

Example difference: https://iter.godbolt.org/z/z8cEfnKro
2025-05-25 11:34:43 +00:00
bors
dcbbc5e4c5 Auto merge of #141372 - khuey:ir_call_dbg_loc, r=jieyouxu
Use the fn_span when emitting function calls for better debug info.

This especially improves the developer experience for long chains of function calls that span multiple lines, which is common with builder patterns, chains of iterator/future combinators, etc.

try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc-1
try-job: arm-android

r? `@jieyouxu`
2025-05-24 17:48:21 +00:00
bors
93c200ae97 Auto merge of #141062 - ChaiTRex:ide_fmt_2024, r=Mark-Simulacrum
Update IDEs to use rustfmt 2024, fix Zed settings

Update IDEs to use rustfmt 2024, fix Zed settings

- Update IDE `rust-analyzer` settings to use 2024 rather than 2021.
- Fix Zed settings by removing `${workspaceFolder}/` from paths.
2025-05-23 11:15:24 +00:00
bors
55bcf3ab63 Auto merge of #141135 - compiler-errors:fast-path-2, r=lcnr
Fast path for processing some obligations in the new solver

Fast path applies to:
- Dyn compatibility predicates
- Region and type outlives predicates
- Trivially sized predicates
2025-05-22 11:39:10 +00:00
bors
9db5a01db4 Auto merge of #140527 - GuillaumeGomez:doctest-main-fn, r=notriddle
Emit a warning if the doctest `main` function will not be run

Fixes #140310.

I think we could try to go much further like adding a "link" (ie UI annotations) on the `main` function in the doctest. However that will require some more computation, not sure if it's worth it or not. Can still be done in a follow-up if we want it.

For now, this PR does two things:
1. Pass the `DiagCtxt` to the doctest parser to emit the warning.
2. Correctly generate the `Span` to where the doctest is starting (I hope the way I did it isn't too bad either...).

cc `@fmease`
r? `@notriddle`
2025-05-22 08:40:58 +00:00
bors
5a9238e78b Auto merge of #140386 - oli-obk:match-on-lang-item-kind, r=compiler-errors
Match on lang item kind instead of using an if/else chain

Similar to how the new solver does this. Just noticed while I was adding a new entry to the chain 😆
2025-05-21 13:31:13 +00:00
bors
01e3d81489 Auto merge of #140757 - dpaoliello:llvm20, r=Kobzol
[win][ci] Update LLVM toolchain used to build LLVM to 20

While trying to get the aarch64-msvc build working correctly (#140136), I needed to update the version of LLVM used to build LLVM in Windows CI runners to 20 (as this has improved support for Arm64 and Arm64EC on Windows).

This catches Windows up to Linux which was updated to 20 by #137189

try-job: `x86_64-apple-*`
try-job: `aarch64-apple`
try-job: `x86_64-msvc-*`
try-job: `i686-msvc-*`
try-job: `x86_64-mingw-*`
2025-05-20 19:29:34 +00:00
bors
b2d7d47981 Auto merge of #140932 - onur-ozkan:llvm-tools, r=Kobzol
update llvm-tools logic for `dist` and `install` steps

First commit aligns `build_steps::compile` and `build_steps::dist` logics for copying llvm-tools, and the second commit adds the correct `should_run` condition for `LlvmTools` step as the previous one was clearly incorrect.

Fixes #140913
2025-05-20 12:44:14 +00:00
bors
a8e438f925 Auto merge of #141278 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-05-20 09:28:44 +00:00
Laurențiu Nicola
96a253112c
Merge pull request #19826 from lnicola/sync-from-rust
Some checks failed
metrics / build_metrics (push) Has been cancelled
rustdoc / rustdoc (push) Has been cancelled
metrics / other_metrics (diesel-1.4.8) (push) Has been cancelled
metrics / other_metrics (hyper-0.14.18) (push) Has been cancelled
metrics / other_metrics (ripgrep-13.0.0) (push) Has been cancelled
metrics / other_metrics (self) (push) Has been cancelled
metrics / other_metrics (webrender-2022) (push) Has been cancelled
metrics / generate_final_metrics (push) Has been cancelled
minor: Sync from downstream
2025-05-20 07:15:48 +00:00
Laurențiu Nicola
ac8c057d87 Bump rustc crates 2025-05-20 10:03:14 +03:00
Laurențiu Nicola
9e86544698 Merge from rust-lang/rust 2025-05-20 10:01:00 +03:00
Laurențiu Nicola
d7bcb5ce76 Preparing for merge from rust-lang/rust 2025-05-20 10:00:23 +03:00
Lukas Wirth
59ef84506d
Merge pull request #19822 from Veykril/push-mzzluystvwls
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
minor: Remote dangling file
2025-05-19 11:20:03 +00:00
Lukas Wirth
04f88362af Remote dangling file 2025-05-19 13:08:29 +02:00
Lukas Wirth
aae7da261e
Merge pull request #19809 from flodiebold/push-txyotwlvvkln
internal: Catch panics in inference in analysis-stats
2025-05-19 10:12:31 +00:00
Lukas Wirth
052b5b46ac
Merge pull request #19814 from Veykril/lw-sxquntxksovs
Debounce workspace fetching for workspace structure changes
2025-05-19 07:06:10 +00:00
Lukas Wirth
575d43e1ce Debounce workspace fetching for workspace structure changes 2025-05-19 08:55:38 +02:00
Lukas Wirth
3866336d41
Merge pull request #19757 from Veykril/push-zzxwtzuzqvzx
perf: Request cancellation while processing changed files
2025-05-19 06:20:31 +00:00
Lukas Wirth
e464ff8c75
Merge pull request #19687 from gohome001/highlight_unsafe
Some checks failed
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
release / publish (push) Has been cancelled
autopublish / publish (push) Has been cancelled
release / dist (aarch64-apple-darwin) (push) Has been cancelled
release / dist (x86_64-apple-darwin) (push) Has been cancelled
release / dist (aarch64-unknown-linux-gnu) (push) Has been cancelled
release / dist (arm-unknown-linux-gnueabihf) (push) Has been cancelled
release / dist (x86_64-unknown-linux-gnu) (push) Has been cancelled
release / dist (aarch64-pc-windows-msvc) (push) Has been cancelled
release / dist (x86_64-pc-windows-msvc) (push) Has been cancelled
release / dist (i686-pc-windows-msvc) (push) Has been cancelled
release / dist (x86_64-unknown-linux-musl) (push) Has been cancelled
feat: highlight unsafe operations
2025-05-18 08:44:10 +00:00
bors
a7f95719f1 Auto merge of #140856 - oli-obk:merge-queries2, r=nnethercote
Merge mir query analysis invocations

r? `@ghost`

same thing as https://github.com/rust-lang/rust/pull/140854 just a different set of queries

Doing this in general has some bad cache coherence issues because the query caches are laid out in Vec<QueryResult> lists per query where each index refers to a DefId in the same order as we're iterating. Iterating two or more lists at the same time does have cache issues, so I want to poke a bit at it to see if we can't merge just a few of them at a time.
2025-05-17 22:31:43 +00:00
Florian Diebold
dde53614ed Catch panics in inference in analysis-stats 2025-05-17 15:25:20 +02:00
bors
51acf03740 Auto merge of #140911 - rust-lang:cargo_update, r=clubby789
Weekly `cargo update`

Automation to keep dependencies in `Cargo.lock` current.

The following is the output from `cargo update`:

```txt

compiler & tools dependencies:
     Locking 40 packages to latest compatible versions
    Updating clap v4.5.37 -> v4.5.38
    Updating clap_builder v4.5.37 -> v4.5.38
    Updating ctrlc v3.4.6 -> v3.4.7
    Updating derive_setters v0.1.6 -> v0.1.7
    Updating getrandom v0.3.2 -> v0.3.3
    Updating icu_collections v1.5.0 -> v2.0.0
      Adding icu_locale_core v2.0.0
    Updating icu_normalizer v1.5.0 -> v2.0.0
    Updating icu_normalizer_data v1.5.1 -> v2.0.0
    Updating icu_properties v1.5.1 -> v2.0.0
    Updating icu_properties_data v1.5.1 -> v2.0.0
      Adding icu_provider v2.0.0
    Updating idna_adapter v1.2.0 -> v1.2.1
    Updating jiff v0.2.12 -> v0.2.13
    Updating jiff-static v0.2.12 -> v0.2.13
    Updating libffi v4.0.0 -> v4.1.0
    Updating libffi-sys v3.2.0 -> v3.3.1
    Updating libloading v0.8.6 -> v0.8.7
    Updating libm v0.2.13 -> v0.2.15
      Adding litemap v0.8.0
    Updating nix v0.29.0 -> v0.30.1
      Adding potential_utf v0.1.2
    Updating rustc-build-sysroot v0.5.4 -> v0.5.5
      Adding tinystr v0.8.1
    Updating tokio v1.44.2 -> v1.45.0
    Updating unic-langid v0.9.5 -> v0.9.6
    Updating unic-langid-impl v0.9.5 -> v0.9.6
    Updating unic-langid-macros v0.9.5 -> v0.9.6
    Updating unic-langid-macros-impl v0.9.5 -> v0.9.6
    Removing utf16_iter v1.0.5
      Adding wasm-encoder v0.230.0
      Adding wasmparser v0.230.0
    Updating wast v229.0.0 -> v230.0.0
    Updating wat v1.229.0 -> v1.230.0
    Updating winnow v0.7.9 -> v0.7.10
    Removing write16 v1.0.0
      Adding writeable v0.6.1
      Adding yoke v0.8.0
      Adding yoke-derive v0.8.0
      Adding zerotrie v0.2.2
      Adding zerovec v0.11.2
      Adding zerovec-derive v0.11.1
note: pass `--verbose` to see 36 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 3 unchanged dependencies behind latest

rustbook dependencies:
     Locking 26 packages to latest compatible versions
    Updating cc v1.2.21 -> v1.2.22
    Updating clap v4.5.37 -> v4.5.38
    Updating clap_builder v4.5.37 -> v4.5.38
    Updating clap_complete v4.5.48 -> v4.5.50
    Updating getrandom v0.3.2 -> v0.3.3
    Updating icu_collections v1.5.0 -> v2.0.0
      Adding icu_locale_core v2.0.0
    Removing icu_locid v1.5.0
    Removing icu_locid_transform v1.5.0
    Removing icu_locid_transform_data v1.5.1
    Updating icu_normalizer v1.5.0 -> v2.0.0
    Updating icu_normalizer_data v1.5.1 -> v2.0.0
    Updating icu_properties v1.5.1 -> v2.0.0
    Updating icu_properties_data v1.5.1 -> v2.0.0
    Updating icu_provider v1.5.0 -> v2.0.0
    Removing icu_provider_macros v1.5.0
    Updating idna_adapter v1.2.0 -> v1.2.1
    Updating jiff v0.2.12 -> v0.2.13
    Updating jiff-static v0.2.12 -> v0.2.13
    Updating litemap v0.7.5 -> v0.8.0
      Adding potential_utf v0.1.2
    Updating tinystr v0.7.6 -> v0.8.1
    Removing utf16_iter v1.0.5
    Updating web_atoms v0.1.1 -> v0.1.2
    Updating winnow v0.7.9 -> v0.7.10
    Removing write16 v1.0.0
    Updating writeable v0.5.5 -> v0.6.1
    Updating yoke v0.7.5 -> v0.8.0
    Updating yoke-derive v0.7.5 -> v0.8.0
      Adding zerotrie v0.2.2
    Updating zerovec v0.10.4 -> v0.11.2
    Updating zerovec-derive v0.10.3 -> v0.11.1
```
2025-05-16 19:34:19 +00:00
Lukas Wirth
5e0916c0e6
Merge pull request #19808 from Veykril/lw-ollszwnlmquw
Some checks failed
metrics / build_metrics (push) Has been cancelled
rustdoc / rustdoc (push) Has been cancelled
metrics / other_metrics (diesel-1.4.8) (push) Has been cancelled
metrics / other_metrics (hyper-0.14.18) (push) Has been cancelled
metrics / other_metrics (ripgrep-13.0.0) (push) Has been cancelled
metrics / other_metrics (self) (push) Has been cancelled
metrics / other_metrics (webrender-2022) (push) Has been cancelled
metrics / generate_final_metrics (push) Has been cancelled
ci: Run metrics on the beta channel
2025-05-16 15:00:07 +00:00
Lukas Wirth
140a319138 ci: Run metrics on the beta channel
This way we can catch regressions from upstream earlier
2025-05-16 16:49:05 +02:00
Lukas Wirth
0843d06ad2
Merge pull request #19807 from Veykril/lw-qyynkqysuyuy
fix: Don't overwrite `RUSTUP_TOOLCHAIN` if it is already set
2025-05-16 13:21:15 +00:00
bors
b0ee0088d3 Auto merge of #140959 - oli-obk:no-unsafe-children, r=davidtwco
Invoke a query only when it doesn't return immediately anyway

This should cause less query key caching and less dep graph data, hopefully resulting in some perf improvements
2025-05-16 12:54:18 +00:00
Lukas Wirth
09ecc4cbf6 fix: Don't overwrite RUSTUP_TOOLCHAIN if it is already set 2025-05-16 14:52:28 +02:00
Laurențiu Nicola
6cd9c86506
Merge pull request #19805 from lnicola/inline-format-args
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
minor: Inline some format args
2025-05-16 10:15:19 +00:00
Laurențiu Nicola
7efb73fc4a Inline some format args 2025-05-16 12:03:59 +02:00
Laurențiu Nicola
cab3b58b0e
Merge pull request #19804 from lnicola/bump-zip
minor: Bump zip to 3.0
2025-05-16 10:03:29 +00:00
Laurențiu Nicola
f3b5221cfc Bump zip to 3.0 2025-05-16 11:51:58 +02:00
Lukas Wirth
b25cef8b16
Merge pull request #19801 from ChayimFriedman2/asm-label
fix: Improve asm support
2025-05-16 08:34:47 +00:00
bors
56698f6279 Auto merge of #140557 - compiler-errors:remove-wf-hack, r=lcnr
Remove manual WF hack

We do not need this hack anymore since we fixed the candidate selection problems with `Sized` bounds. We prefer built-in sized bounds now since #138176, which fixes the only regression this hack was intended to fix.

While this theoretically is broken for some code, for example, when there a param-env bound that shadows an impl or built-in trait, we don't see it in practice and IMO it's not worth the burden of having to maintain this wart in `compare_method_predicate_entailment`.

The code that regresses is, for example:

```rust
trait Bar<'a> {}

trait Foo<'a, T> {
    fn method(&self)
    where
        Self: Bar<'a>;
}

struct W<'a, T>(&'a T)
where
    Self: Bar<'a>;

impl<'a, 'b, T> Bar<'a> for W<'b, T> {}

impl<'a, 'b, T> Foo<'a, T> for W<'b, T> {
    fn method(&self) {}
}
```

Specifically, I don't believe this is really going to be encountered in practice. For this to fail, there must be a where clause in the *trait method* that would shadow an impl or built-in (non-`Sized`) candidate in the trait, and this shadowing would need to be encountered when solving a nested WF goal from the impl self type.

See #108544 for the original regression. Crater run is clean!

r? lcnr
2025-05-16 02:34:32 +00:00
Chayim Refael Friedman
5ed11234cc Improve asm support
Including:

 - Infer `label {}` and `const` operands.
 - Correctly handle unsafe check inside `label {}`.
 - Fix an embarrassing parser typo that cause labels to never be part of the AST
2025-05-15 23:36:00 +03:00
bors
4e4f63c29f Auto merge of #136264 - GuillaumeGomez:optimize-integers-to-string, r=Amanieu
Optimize `ToString` implementation for integers

Part of https://github.com/rust-lang/rust/issues/135543.

Follow-up of https://github.com/rust-lang/rust/pull/133247 and https://github.com/rust-lang/rust/pull/128204.

The benchmark results are:

| name| 1.87.0-nightly (3ea711f17 2025-03-09) | With this PR | diff |
|-|-|-|-|
| bench_i16 | 32.06 ns/iter (+/- 0.12) | 17.62 ns/iter (+/- 0.03) | -45% |
| bench_i32 | 31.61 ns/iter (+/- 0.04) | 15.10 ns/iter (+/- 0.06) | -52% |
| bench_i64 | 31.71 ns/iter (+/- 0.07) | 15.02 ns/iter (+/- 0.20) | -52% |
| bench_i8 | 13.21 ns/iter (+/- 0.14) | 14.93 ns/iter (+/- 0.16) | +13% |
| bench_u16 | 31.20 ns/iter (+/- 0.06) | 16.14 ns/iter (+/- 0.11) | -48% |
| bench_u32 | 33.27 ns/iter (+/- 0.05) | 16.18 ns/iter (+/- 0.10) | -51% |
| bench_u64 | 31.44 ns/iter (+/- 0.06) | 16.62 ns/iter (+/- 0.21) | -47% |
| bench_u8 | 10.57 ns/iter (+/- 0.30) | 13.00 ns/iter (+/- 0.43) | +22% |

More information about it in [the original comment](https://github.com/rust-lang/rust/pull/136264#discussion_r1987542954).

r? `@workingjubilee`
2025-05-15 20:20:30 +00:00
Chayim Refael Friedman
f8e784353b
Merge pull request #19798 from rust-lang/dependabot/npm_and_yarn/editors/code/undici-6.21.3
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Bump undici from 6.21.1 to 6.21.3 in /editors/code
2025-05-15 15:45:49 +00:00
bors
5d6eea7b04 Auto merge of #136988 - compiler-errors:impossible_predicates, r=lcnr
Use the new solver in the `impossible_predicates`

The old solver is unsound for many reasons. One of which was weaponized by `@lcnr` in #140212, where the old solver was incompletely considering a dyn vtable method to be impossible and replacing its vtable entry with a null value. This null function could be called post-mono.

The new solver is expected to be less incomplete due to its correct handling of higher-ranked aliases in relate. This PR switches the `impossible_predicates` query to use the new solver, which patches this UB.

r? lcnr
2025-05-15 15:31:24 +00:00
dependabot[bot]
4ed2a5dc8e
Bump undici from 6.21.1 to 6.21.3 in /editors/code
Bumps [undici](https://github.com/nodejs/undici) from 6.21.1 to 6.21.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.21.1...v6.21.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 6.21.3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-15 15:24:19 +00:00
Lukas Wirth
dd512b7cf2
Merge pull request #19794 from ChayimFriedman2/dup-crates
fix: Don't allow duplicate crates in the all_crates list
2025-05-15 13:29:17 +00:00
Chayim Refael Friedman
15ce258799
Merge pull request #19793 from Hmikihiro/unused_import_conlict_derive
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
fix: Removing all unused imports removes used imports for imports used for Derive macros
2025-05-15 09:18:06 +00:00
Laurențiu Nicola
be67816820
Merge pull request #19796 from Berrysoft/update-cargo-lock
Update Cargo.lock
2025-05-15 07:32:51 +00:00
Berrysoft
d5b30d7109 Update Cargo.lock 2025-05-15 15:14:35 +08:00
Hayashi Mikihiro
48027bfc19 handle trait in function
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-15 15:12:31 +09:00
Hayashi Mikihiro
55dd2114ed check glob
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-15 14:01:05 +09:00
Hayashi Mikihiro
bf13549ab6 rename fn name take_path to any
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-15 13:18:30 +09:00
Chayim Refael Friedman
56fb415ba7 Don't allow duplicate crates in the all_crates list
For some reason we had them in some projects, I'm not sure why. But this caused cache priming to appear stuck - because it uses a set of crate IDs for the actual work, but for the number of crates to index it just uses `db.all_crates().len()`.
2025-05-14 21:38:40 +03:00
Hayashi Mikihiro
30fe761685 fix: Removing all unused imports removes used imports for imports used for Derive macros
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-14 23:51:23 +09:00
bors
5f12b5804a Auto merge of #140921 - Berrysoft:update-rustc-lock, r=jieyouxu
Update `ctrlc`, `libloading` and `nix` for rustc

The main purpose is to update `nix` to 0.30.1. It adds support for cygwin.
2025-05-13 13:06:57 +00:00