Rollup of 17 pull requests#157541
Open
JonathanBrouwer wants to merge 341 commits into
Open
Conversation
For replace_if_let_with_match assist
Example
---
```rust
fn foo(x: Option<i32>) {
$0if let Some(x) = x && x != 4 {
println!("{}", x)
} else {
println!("none")
}
}
```
**Before this PR**
```rust
fn foo(x: Option<i32>) {
match x {
Some(x) if x != 4 => println!("{}", x),
None => println!("none"),
}
}
```
**After this PR**
```rust
fn foo(x: Option<i32>) {
match x {
Some(x) if x != 4 => println!("{}", x),
_ => println!("none"),
}
}
```
Resolves a FIXME at hir-ty/src/method_resolution.rs:151 in lookup_method_including_private that previously allowed calls like `x.cant_call()` on a `&dyn Foo` receiver to type-check without diagnostic when `cant_call(&self) where Self: Sized`, even though the `Self: Sized` predicate cannot be satisfied by the trait object. The existing predicates_require_illegal_sized_bound check in confirm.rs already correctly identifies this case (it iterates elaborated predicates and looks for `Self: Sized` clauses with a `TyKind::Dynamic` self type). Adds an InferenceDiagnostic::MethodCallIllegalSizedBound variant, plumbs the cooked diagnostic through hir, and renders it as RustcHardError E0277. Tests: trait-object call with Sized-bounded method errors; trait-object call to dyn-safe method does not; concrete-type call to a Sized-bounded method does not. Part of rust-lang/rust-analyzer#22140. Signed-off-by: Onyeka Obi <softwareengineerasaservant@isurvivable.cv>
…ound method-resolution: emit error for method calls with illegal Sized b…
Example
---
```rust
fn test(a: A) {
a.$0
}
impl core::ops::Deref for A {
type Target = B;
fn deref(&self) -> &Self::Target { loop {} }
}
trait Foo { fn foo(&self) -> u32 {} }
impl Foo for A {}
impl Foo for B {}
impl A { fn foo(&self) -> u8 {} }
impl B { fn foo(&self) -> u16 {} }
struct A {}
struct B {}
```
**Before this PR**
```text
me foo() fn(&self) -> u8
me foo() fn(&self) -> u16
me foo() (as Foo) fn(&self) -> u32
```
**After this PR**
```text
me foo() fn(&self) -> u8
me foo() (as Foo) fn(&self) -> u32
```
feat: add diagnostic for E0614
fix: Fully support pattern types
This reverts commit 3efe801fe27ae68eff3cfe9cf84fb52b7e427ae3.
…structuring assignment
…l-syntax-factory Migrate inline_call assist to SyntaxFactory
…ng-assignment feat(diagnostics): add handler for functional record update in destructuring assignment
Show `unsafe` in the signature help if applicable
Instead of failing to resolve them, which can be confusing.
`TyKind::Pat` is hit on stable through `core::num::NonZero*` types which use it internally. `TyKind::UnsafeBinder` isn't hit yet, but added for completeness, since has_drop_glue ends up being called on hover.
Handle TyKind::{Pat,UnsafeBinder} in has_drop_glue
Since they can be referenced without the enum, and this prevents autoimport of them.
So they can be autoimported for external crates.
Example
---
```rust
mod module {}
fn foo() { $0::bar }
```
**Before this PR**
```rust
mod module {}
fn foo() { module::::bar }
```
**After this PR**
```rust
mod module {}
fn foo() { module::bar }
```
Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
fix: no complete module colons before exists colons
fix: not complete same name inherent deref methods
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 6, 2026
Rollup of 17 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-2
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 6, 2026
…uwer Rollup of 17 pull requests Successful merges: - #157251 (`rust-analyzer` subtree update) - #157533 (Subtree sync for rustc_codegen_cranelift) - #154742 (Add APIs for case folding to the standard library) - #155144 (mir_build: Add an extra intermediate step in MIR building for patterns ) - #157016 (add `extern "tail"` calling convention) - #157264 (diagnostics: Fix ICE building a trait ref in method suggestions) - #157386 (Parse deprecated note links separately in rustc_resolve) - #157483 (fix windows-gnu TLS leak) - #157488 (compiletest: inject `#![windows_subsystem = "windows"]` to debuginfo tests on Windows) - #157509 (remove solaris implementation for File::lock, it has the wrong semantics) - #157521 (Rename `SyncView::{as_pin => as_pin_ref}`) - #156136 (Move tests box) - #157365 (Revert "LLVM 23: Run AssignGUIDPass in some places") - #157471 (Debug assert that parsed attributes are in the `BUILTIN_ATTRIBUTE_MAP`) - #157485 (Rename `errors.rs` file to `diagnostics.rs` (1/N)) - #157494 (Convert `QueryRegionConstraint` into a struct) - #157526 (std tests: skip a slow test on Miri) Failed merges: - #155527 (Replace printables table with `unicode_data.rs` tables)
Contributor
|
💔 Test for 179ed75 failed: CI. Failed job:
|
Contributor
Author
Contributor
|
Tree closed for PRs with priority less than 5. |
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 6, 2026
…uwer Rollup of 17 pull requests Successful merges: - #157251 (`rust-analyzer` subtree update) - #157533 (Subtree sync for rustc_codegen_cranelift) - #154742 (Add APIs for case folding to the standard library) - #155144 (mir_build: Add an extra intermediate step in MIR building for patterns ) - #157016 (add `extern "tail"` calling convention) - #157264 (diagnostics: Fix ICE building a trait ref in method suggestions) - #157386 (Parse deprecated note links separately in rustc_resolve) - #157483 (fix windows-gnu TLS leak) - #157488 (compiletest: inject `#![windows_subsystem = "windows"]` to debuginfo tests on Windows) - #157509 (remove solaris implementation for File::lock, it has the wrong semantics) - #157521 (Rename `SyncView::{as_pin => as_pin_ref}`) - #156136 (Move tests box) - #157365 (Revert "LLVM 23: Run AssignGUIDPass in some places") - #157471 (Debug assert that parsed attributes are in the `BUILTIN_ATTRIBUTE_MAP`) - #157485 (Rename `errors.rs` file to `diagnostics.rs` (1/N)) - #157494 (Convert `QueryRegionConstraint` into a struct) - #157526 (std tests: skip a slow test on Miri) Failed merges: - #155527 (Replace printables table with `unicode_data.rs` tables)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 20f0a86 failed: CI. Failed job:
|
Contributor
Author
|
@bors retry |
Contributor
|
⌛ Testing commit 52921a2 with merge 5e9b677... Workflow: https://github.com/rust-lang/rust/actions/runs/27072041695 |
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 6, 2026
…uwer Rollup of 17 pull requests Successful merges: - #157251 (`rust-analyzer` subtree update) - #157533 (Subtree sync for rustc_codegen_cranelift) - #154742 (Add APIs for case folding to the standard library) - #155144 (mir_build: Add an extra intermediate step in MIR building for patterns ) - #157016 (add `extern "tail"` calling convention) - #157264 (diagnostics: Fix ICE building a trait ref in method suggestions) - #157386 (Parse deprecated note links separately in rustc_resolve) - #157483 (fix windows-gnu TLS leak) - #157488 (compiletest: inject `#![windows_subsystem = "windows"]` to debuginfo tests on Windows) - #157509 (remove solaris implementation for File::lock, it has the wrong semantics) - #157521 (Rename `SyncView::{as_pin => as_pin_ref}`) - #156136 (Move tests box) - #157365 (Revert "LLVM 23: Run AssignGUIDPass in some places") - #157471 (Debug assert that parsed attributes are in the `BUILTIN_ATTRIBUTE_MAP`) - #157485 (Rename `errors.rs` file to `diagnostics.rs` (1/N)) - #157494 (Convert `QueryRegionConstraint` into a struct) - #157526 (std tests: skip a slow test on Miri) Failed merges: - #155527 (Replace printables table with `unicode_data.rs` tables)
Collaborator
|
A job failed! Check out the build log: (web) (plain enhanced) (plain) Click to see the possible cause of the failure (guessed by this bot) |
Contributor
Author
|
@bors treeopen |
Contributor
|
Tree is now open for merging. |
Contributor
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 #157251 (rust-analyzersubtree update)extern "tail"calling convention #157016 (addextern "tail"calling convention)#![windows_subsystem = "windows"]to debuginfo tests on Windows #157488 (compiletest: inject#![windows_subsystem = "windows"]to debuginfo tests on Windows)SyncView::{as_pin => as_pin_ref}#157521 (RenameSyncView::{as_pin => as_pin_ref})BUILTIN_ATTRIBUTE_MAP#157471 (Debug assert that parsed attributes are in theBUILTIN_ATTRIBUTE_MAP)errors.rsfile todiagnostics.rs(1/N) #157485 (Renameerrors.rsfile todiagnostics.rs(1/N))QueryRegionConstraintinto a struct #157494 (ConvertQueryRegionConstraintinto a struct)Failed merges:
unicode_data.rstables #155527 (Replace printables table withunicode_data.rstables)r? @ghost
Create a similar rollup