Repository navigation
Rollup of 8 pull requests - #164216
Rollup of 8 pull requests#164216
Conversation
This also closes gaps we had, e.g. now `check_impl()` will include field defaults. The only changes to tests are some ordering changes due to sorting by the root expr's location now instead of the full item's location, and removal of trait functions without bodies, since they don't have a root expr. As their inference is meaningless (only the parameter types, unless you have anon consts in the parameters' patterns which we don't have in our tests), I felt safe to ignore that.
Instead store `Option`s for the self-referential parts.
…n_args_for_alias()` It's not an optimization yet, but in the in-tree solver this function reuses the `GenericArgs` if the assoc has no args of its own.
And since `Projection::project()` does not require `DbInterner`, also remove this requirement from any slice's `new_from_iter()`, which is probably better anyway.
Again for the intent of making `AnonConst` a tracked struct (as well as for perf). We still have one problematic query: `resolve_type_param_assoc_type_shorthand()`. It is problematic and I need to think what to do with it.
E.g.:
```rust
trait Trait
where
Self::Assoc: OtherTrait,
{
type Assoc;
}
```
Is equivalent to:
```rust
trait Trait {
type Assoc: OtherTrait;
}
```
The code was copied from rustc and adapted.
Signed-off-by: 0xull <mrikehchukwuka@gmail.com>
fix: cache macro-expanded roots when climbing ancestors
…-refactor internal: Refactor `SyntaxContext` to not reimplement Salsa macros
If the discover command failed, log which directory we tried to run it in. This is really helpful when users have a bunch of worktrees.
This package is deprecated (producing npm warnings) and its GitHub repository has been archived. We can just use eslint Config types directly these days, so do that instead. AI disclosure: Code partly written by GPT-5.6 Sol, commit message and review by me.
…ine-config internal: Remove deprecated eslint-define-config dependency
fix: Include working directory when discover command fails
Example
---
```rust
trait Trait { fn method(); }
impl Trait for Foo { fn method() {} }
struct Foo;
fn main() {
Foo::$0method()
}
```
**Before this PR**
```rust
fn method()
```
**After this PR**
```rust
impl Trait for Foo
fn method()
```
rust-analyzer would panic when the trait solver called itself, which can happen during const evaluation. rustc has the same function, but doesn't panic, so just copy the rustc implementation: https://github.com/rust-lang/rust/blob/5392d2f545c6836dc79f209bcc14ac7179dbc4f2/compiler/rustc_middle/src/ty/context/impl_interner.rs#L155 This caused SCIP crashes on the dudykr/stc, renegade-fi/renegade, and tikv/tikv GitHub repositories, so would presumably cause LSP crashes too. The linked trait-system-refactor-initiative issue has a repro, but for reference I minimised a repro independently: trait Tr { const N: usize; } struct A<const N: usize>; impl<const N: usize> Tr for A<N> { const N: usize = N; } const fn k<T: Tr>() -> usize { T::N } struct B<const N: usize>; impl<const N: usize> Tr for B<N> where A<{ k::<A<3>>() }>: Tr { const N: usize = 0; } fn need<T: Tr>() {} fn f() { need::<B<1>>(); } Since this is strictly removing a panic and copying rustc, I haven't added a unit test with this. AI disclosure: Triaged and minimised with help by an LLM, but commit message and final code by me.
fix: Panic when trait solver re-enters itself
…binary_op_error fix: return an error early for unsupported string binary operations
When an enum variant discriminant initializer references another variant via a cast, e.g. `B = Foo::A as isize + 1` the previous implementation would lower `Foo::A` as a place and then extract its discriminant via `Rvalue::Discriminant`. This caused infinite recursion during consteval because evaluating the discriminant of one variant requires evaluating another. # Conflicts: # crates/hir-ty/src/mir/lower.rs
…r#18281 `isValidExecutable` was synchronous until rust-lang/rust-analyzer#18281 made it `async` without updating its only caller. `!isValidExecutable(...)` has negated a Promise ever since, which is never false, so the check has silently done nothing for about 2 years. A bad `rust-analyzer.server.path` therefore failed with Cannot activate rust-analyzer extension: undefined naming neither the binary nor the setting, because vscode-languageclient rejects with a string rather than an Error. The probe command still runs and still logs a warning with the real reason. Also fixed some string messages that were hidden by the dead check: - missing space after `--version.`, plus a run of indentation pulled in by a line continuation inside the template literal - the bootstrap notification and the `trace.extension` deprecation message both pointed at `OUTPUT > Rust Analyzer Client`, which is now called `rust-analyzer Extension` This restores the behaviour from before that change, which I think is desirable. However, there are two (somewhat uncommon, IMO) things that can start failing _again_ as a result of restoring this behavior: - a `server.path` that does not exit 0 on `--version`, even if it speaks LSP fine. Yesterday that would log the warning and continue, and would work fine. Now it will give an error, which is probably what was originally intended there. - a relative `server.path`, since the probe runs in the extension host's working directory while the server is launched in the workspace folder.
…ecutable fix: restore the server binary check broken by rust-lang#18281
vfs-notify registered one recursive `watch()` per directory in the workspace walk. On macOS, notify's fsevent backend rebuilds the entire FSEventStream on every `watch()` call, so watching N directories cost O(N^2) realpath/getattrlist syscalls. This translates to minutes of startup in a large workspace. Fortunately, the per-directory recursive watches became redundant when rust-lang/rust-analyzer#21771 switched the watch to `RecursiveMode::Recursive`, so we can remove most of them. However, symlinked directories are still watched explicitly because macOS fsevent framework does not follow symlinks on its own. Result: LSP indexing time for https://github.com/delta-io/delta-kernel-rs on my macOS laptop dropped from ~11 minutes to ~45 seconds.
fix: watch include roots recursively once, not every directory
This comment has been minimized.
This comment has been minimized.
Rollup of 8 pull requests try-job: dist-various-1 try-job: test-various try-job: test-x86_64-gnu-aux try-job: test-x86_64-msvc-1 try-job: test-aarch64-apple-1 try-job: test-aarch64-apple-2 try-job: test-x86_64-mingw-1 try-job: test-i686-msvc try-job: test-armhf-gnu try-job: test-x86_64-gnu-llvm-22-3
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 0093837 (parent) -> d64de46 (this PR) Test differencesShow 376 test diffsStage 0
Stage 1
Stage 2
(and 196 additional test diffs) Additionally, 80 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard d64de46d0aab619b69efe68a99d43d11434b6924 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (d64de46): comparison URL. Overall result: ❌ regressions - please read:Our benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 6.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis perf run didn't have relevant results for this metric. Binary sizeResults (primary -0.1%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 488.816s -> 490.869s (0.42%) |
|
📌 Perf builds for each rolled up PR:
parent commit: 0093837afd In the case of a perf regression, run the following command with the SHAs of each PR you suspect might be the cause: |
|
@rust-timer triage all |
Running triage with 19 benchmarksTriage only executes the benchmarks on rollup members, that were changed significantly on the rollup.
#164196 dd8a2e6
|
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-2.6% | [-2.6%, -2.6%] | 1 |
| All ❌✅ (primary) | - | - | 0 |
Cycles
This perf run didn't have relevant results for this metric.
Binary size
Results (secondary 0.0%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
0.0% | [0.0%, 0.0%] | 3 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
- | - | 0 |
| All ❌✅ (primary) | - | - | 0 |
#164037 c644166 Restrict application of optimization attributes from instance
This perf run didn't have relevant results for the `instruction count` metric.
Instruction count
This perf run didn't have relevant results for this metric.
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
Results (secondary 2.4%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
2.4% | [2.4%, 2.4%] | 1 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
- | - | 0 |
| All ❌✅ (primary) | - | - | 0 |
Binary size
Results (secondary 0.0%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
0.0% | [0.0%, 0.0%] | 3 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
- | - | 0 |
| All ❌✅ (primary) | - | - | 0 |
#164201 32ccc87 Improve --bless output for tests/debuginfo
This perf run didn't have relevant results for the `instruction count` metric.
Instruction count
This perf run didn't have relevant results for this metric.
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
Results (primary -0.0%, secondary -0.1%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
-0.0% | [-0.0%, -0.0%] | 4 |
| Improvements ✅ (secondary) |
-0.1% | [-0.1%, -0.1%] | 3 |
| All ❌✅ (primary) | -0.0% | [-0.0%, -0.0%] | 4 |
#164202 7e6c6cb [rustdoc] Move the creation of IndividualTestOptions into the test runner closure to ensure the temporary folder is removed right after the test is done running
This perf run didn't have relevant results for the `instruction count` metric.
Instruction count
This perf run didn't have relevant results for this metric.
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
Results (secondary 4.6%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
4.6% | [4.6%, 4.6%] | 1 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
- | - | 0 |
| All ❌✅ (primary) | - | - | 0 |
Binary size
Results (secondary 0.0%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
0.0% | [0.0%, 0.0%] | 3 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
- | - | 0 |
| All ❌✅ (primary) | - | - | 0 |
#162140 7b53055 fn_addr_eq: we actually can guarantee basically nothing
This perf run didn't have relevant results for the `instruction count` metric.
Instruction count
This perf run didn't have relevant results for this metric.
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
Results (secondary 0.0%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
0.0% | [0.0%, 0.0%] | 3 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
- | - | 0 |
| All ❌✅ (primary) | - | - | 0 |
#163946 e0ea861 Fix transmutability type mismatch bug
This perf run didn't have relevant results for the `instruction count` metric.
Instruction count
This perf run didn't have relevant results for this metric.
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
Results (primary -0.0%, secondary -0.1%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
-0.0% | [-0.0%, -0.0%] | 4 |
| Improvements ✅ (secondary) |
-0.1% | [-0.1%, -0.1%] | 3 |
| All ❌✅ (primary) | -0.0% | [-0.0%, -0.0%] | 4 |
#163978 d33aa67 Copy over some methods from At to InferCtxt
This perf run didn't have relevant results for the `instruction count` metric.
Instruction count
This perf run didn't have relevant results for this metric.
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
Results (secondary 0.0%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
0.0% | [0.0%, 0.0%] | 3 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
- | - | 0 |
| All ❌✅ (primary) | - | - | 0 |
#164045 2cbb8f3 -Zassumptions-on-binders: replace region vars with bound vars when handling alias outlives'
This perf run didn't have relevant results for the `instruction count` metric.
Instruction count
This perf run didn't have relevant results for this metric.
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
Results (secondary 2.9%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
2.9% | [2.9%, 2.9%] | 1 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
- | - | 0 |
| All ❌✅ (primary) | - | - | 0 |
Binary size
Results (secondary 0.0%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
0.0% | [0.0%, 0.0%] | 3 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
- | - | 0 |
| All ❌✅ (primary) | - | - | 0 |
Successful merges:
rust-analyzersubtree update #164196 (rust-analyzersubtree update)--blessoutput fortests/debuginfo#164201 (Improve--blessoutput fortests/debuginfo)IndividualTestOptionsinto the test runner closure to ensure the temporary folder is removed right after the test is done running #164202 ([rustdoc] Move the creation ofIndividualTestOptionsinto the test runner closure to ensure the temporary folder is removed right after the test is done running)r? @ghost
Create a similar rollup