Repository navigation
Rollup of 9 pull requests - #164212
Closed
JonathanBrouwer wants to merge 211 commits into
Closed
Rollup of 9 pull requests#164212JonathanBrouwer wants to merge 211 commits into
JonathanBrouwer wants to merge 211 commits into
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
…moval, r=RalfJung,Urgau [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 Fixes rust-lang#164145. Fixes one missed case in rust-lang#161868: the `IndividualTestOptions` should have been created directly into the `DynTestFn` closure so its temporary directory is removed right after it's done running. r? @RalfJung
fn_addr_eq: we actually can guarantee basically nothing Fixes rust-lang#160202. See that issue for context and discussion.
…uVanilla Fix transmutability type mismatch bug Fixes rust-lang#161251 r? @ShoyuVanilla The change was done as instructed by @ShoyuVanilla and @lcnr on Zulip. There are some leftover questions I'll add as comments (self review). But the original examples are both fixed.
…hods-on-infctxt, r=lcnr Copy over some methods from At to InferCtxt Replaces rust-lang#163448. @lcnr wants the `At` struct removed, this is the first step in doing that. This change naively copies over some of the methods from `At` onto `InferCtxt` without removing any calls to `InferCtxt::at` or the `At` methods themselves.
…ars, r=khyperia -Zassumptions-on-binders: replace region vars with bound vars when handling alias outlives' r? @khyperia See added test. Previously when rewriting `<T as Trait<'?x>>::Assoc: 'b` we would just get `ambiguity`, we now produce `for<'x> <T as Trait<'x>>::Assoc: 'b` in the same way that we do when handling too-large-universe placeholders in alias outlives constraints
…egion_vars, r=BoxyUwU trait solver: Resolve region vars before eager placeholder handling Region vars can already have known values in the unification table while the stored constraint still contains the vars. `max_universe` looks through the table, but `PlaceholderReplacer` sees the stored terms. In Boxy's nested binder case, that leaves an alias constraint ambiguous even after equating its regions. I used `deeply_resolve_via_unification_table` at the start of eager handling for each universe. That leaves only the current universe's placeholder to bind and lets the result match the actual assumption on the outer binder. Unknown vars stay unknown. The test DSL needed a small equality operation, `'a2 = 'a`, to reach this state. The paired outlives constraints in the original example go straight into solver storage and don't populate the table on current main. I kept that example as an ambiguity control and added the version with real table equalities, plus a chained-var case. Both adjusted cases fail when the resolution call is removed and pass with it. I think keeping this separate makes rust-lang#157984 easier to review. The broader equality and subtyping work stays there.
Member
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Oct 12, 2026
Rollup of 9 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
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
PR #164103, which is a member of this rollup, was unapproved. This rollup was thus unapproved. |
Contributor
|
💔 Test for f13b93c failed: CI. Failed jobs:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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