Skip to content

[CI] Rollup of 35 pull requests v2#158363

Draft
JonathanBrouwer wants to merge 194 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-zybcDOf
Draft

[CI] Rollup of 35 pull requests v2#158363
JonathanBrouwer wants to merge 194 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-zybcDOf

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

No description provided.

Voultapher and others added 30 commits April 24, 2026 14:59
Implement a rust-analyzer VS Code command for creating new Cargo
projects from the editor. Add command registration, UI entry points,
configuration for post-create behavior, focused validation, and tests for
the command flow.

AI tools were used to research comparable editor behaviors and help
refine the implementation plan; the resulting changes were reviewed
before submission.
When an index expression with an ambiguous type (e.g. `arr[idx.into()]`)
appears inside a cast or binary operation, the type inference error was
incorrectly attributed to the outer expression instead of the `.into()`
call. Resolve the index sub-expression type first so the error points at
the actual ambiguous site.
Point the new project failure flow at the extension logs and make the
log-opening command available when the language server is not running.
Also add tests for the env-aware cargo path resolution path introduced
for project creation.
Run the VS Code formatter to fix the remaining Prettier issue in the
launch config test before updating rust-lang/rust-analyzer#22103.

AI-assisted: OpenAI Codex was used to identify and apply this change.
Handle Windows executable suffixes when the VS Code extension probes
for cargo through PATH or CARGO_HOME, and preserve case-insensitive
environment variable lookup for supplied env objects so copied Windows
`Path` entries still resolve cargo.

Normalize and document the Windows CARGO_HOME test comparison as well,
because VS Code path resolution can lowercase the drive letter in
`fsPath` without changing which executable was found.

This keeps the extension-side lookup aligned with the Rust-side
toolchain helper behavior and avoids breaking create-project on common
Windows setups.

AI-assisted: OpenAI Codex was used to identify and apply this change.
fix: rename schema subItems with sub_items
…as_adt_def

Make assist `inline_type_alias` work on ADT definitions
Example
---
```json
{
    "rust-analyzer.completion.autoimport.exclude": [
        {"path": "xxx_crate::Foo", "type": "variants"},
    ]
}
```

```rust
enum Foo {
    Variant1,
    Variant2,
}
fn main() {
    V$0
}
```

**Before this PR**

```
ev TupleV(…)                 TupleV(u32)
ev Variant1 (use Foo::Variant1) Variant1
ev Variant2 (use Foo::Variant2) Variant2
bt u32                               u32
```

**After this PR**

```
ev TupleV(…)                 TupleV(u32)
bt u32                               u32
```
feat: support flyimport exclude variants
Example
---
```rust
macro_rules! m { ($i:expr) => { $i } }
fn f() {
    let xyz = 0;
    m!(xyz$0);
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
macro_rules! m { ($i:expr) => { $i } }
fn f() {
    m!(0);
}
```
Example
---
```rust
macro_rules! i { ($($t:tt)*) => { $($t)* } }
fn f() {
    i!(let xyz = 0;);
    _ = xyz$0;
    _ = xyz;
}
```

**Before this PR**

```
request handler panicked: can't resolve SyntaxNodePtr { kind: LET_STMT, range: 0..9 } with SOURCE_FILE@0..108
```

**After this PR**

```rust
macro_rules! i { ($($t:tt)*) => { $($t)* } }
fn f() {
    i!(let xyz = 0;);
    _ = 0;
    _ = xyz;
}
```
…lysis-bench-removed

Remove docs about removed `analysis-bench` command
internal: git ignore .vim/coc-settings.json
In c0f428d55b425c8ba18039a3687cdcdc47e111d1 this
code was adjusted to handle a change in
`load_workspace`.

The change assumed that the `ra-rustc-test` folder
existed in the `std::env::temp_dir`, but this
assumption is not always correct.
This updates the rust-version file to 485ec3f.
…ate-dir-for-cargo-xtask-metrics-rustc_tests

Create directory for `cargo xtask metrics rustc_tests`
…ypqwmmp

Fix destructuring assignments not introducing moves
The region-constraint machinery for `-Zassumptions-on-binders` is
region-outlives-only. A non-lifetime binder (`for<T>`) introduces a
placeholder type in the binder's universe `u`. The rewrite that pulls
constraints out of `u` only folds regions (`PlaceholderReplacer` just
implements `fold_region`), so an alias-outlives constraint such as
`<!T as Trait>::Assoc: 'r` reaches
`pull_region_outlives_constraints_out_of_universe` still in `u` and
trips `assert!(max_universe < u)`.

Report ambiguity for those constraints instead of asserting, matching
the existing `None => Ambiguity` bail-outs in this module. The goal
then surfaces as an ordinary ambiguity error rather than an ICE.
Only load the feature list once in the entire resolver

I saw that a bunch of code in ast validation and other early logic just had the features query called once and stored the result. Let's see what the resolver does with that.
…-light-chevrolet-my-mama-taught-me-wrong-from-right, r=jieyouxu

triagebot: Stop pinging myself

rust-lang/team#2523
… r=tgross35,jhpratt

slice_split_once: bounds check optimization note

Tracking issue: rust-lang#112811

~~Use unchecked sub-slicing operations for `<T>::split_once` and `<T>::rsplit_once`.~~
Note that unchecked sub-slicing operations are equivalent to the current checked sub-slicing operations.
…nathanBrouwer

Improve unknown crate_type diagnostic suggestions

I have improved the suggestions given in the unknown crate_type diagnostic.

Before (no suggestion):
```
error: invalid `crate_type` value
 --> bad_error.rs:1:17
  |
1 | #![crate_type = "binary"]
  |                 ^^^^^^^^
  |
  = note: `#[deny(unknown_crate_types)]` on by default
```

After:
```
error: invalid `crate_type` value
 --> bad_error.rs:1:17
  |
1 | #![crate_type = "binary"]
  |                 ^^^^^^^^ help: did you mean: `"bin"`
  |
  = note: `#[deny(unknown_crate_types)]` on by default
```

By increasing the allowed edit distance for the matching, as well as allowing substring matches, this now also works for mistakes like `dynamiclib`, where it will suggest `dylib`, and `cdylibrary` where it suggests `cdylib`.

r? @JonathanBrouwer
mailmap: update mu001999

Update my name and email in the mailmap.

I think self reviews are OK for this kind of change, so r? me
…per, r=GuillaumeGomez

Update `rustc-literal-escaper` version to `0.0.8`

This new version contains a minor performance improvement. More detail in the PR: rust-lang/literal-escaper#27

cc @hkBst
r? ghost
… r=jhpratt

Fix incorrect unsafe debug assertion in unchecked_div_exact

This PR fixes a bug in the `assert_unsafe_precondition!` check for the unstable `unchecked_div_exact` method in signed integers (`int_macros.rs`).

### What is the problem?
Currently, the precondition check for signed integers asserts that `rhs > 0`. This causes a panic in debug builds when performing a perfectly valid exact division with a negative divisor (e.g., `-10i32 / -2i32`).

The following code snippet will panic in debug mode, but successfully build within release mode:

```rust
#![feature(exact_div)]

fn main() {
    let lhs: i32 = -10;
    let rhs: i32 = -2;
    unsafe {
        let result = lhs.unchecked_div_exact(rhs);
    }
}
```

Furthermore, this erroneous `rhs > 0` check renders the overflow prevention logic `(lhs != <$SelfT>::MIN || rhs != -1)` completely unreachable (dead code), since `rhs` could never be `-1` if it is strictly greater than `0`.

It appears that it should be `rhs != 0`.

### What does this PR do?
- Changes `rhs > 0` to `rhs != 0` in `library/core/src/num/int_macros.rs` to allow valid negative divisors.

Tracking issue: rust-lang#139911
…-files, r=jhpratt

Add `io::ErrorKind::TooManyOpenFiles`

Adds an unstable `io::ErrorKind::TooManyOpenFiles` for the open-file-limit condition.

`EMFILE` and `ENFILE` currently decode to `ErrorKind::Uncategorized`, so stable code cannot tell that an operation failed because the process or the system ran out of file descriptors without inspecting `raw_os_error()` and a platform-specific `libc`/`windows-sys` constant.

Implements the accepted ACP rust-lang/libs-team#818, including its decision to collapse `EMFILE` and `ENFILE` into a single variant. Finer-grained handling stays available through `raw_os_error()`.

The variant maps:
- `EMFILE` / `ENFILE` on Unix and WASI
- `ERROR_TOO_MANY_OPEN_FILES` / `WSAEMFILE` on Windows
- `FR_TOO_MANY_OPEN_FILES` on VEXos

Tracking issue: rust-lang#158319

r? libs
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. labels Jun 24, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors try jobs=dist-i686-msvc

@rust-bors

rust-bors Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

⌛ Trying commit b9fad4f with merge a356183

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/28109451500

rust-bors Bot pushed a commit that referenced this pull request Jun 24, 2026
[CI] Rollup of 35 pull requests v2


try-job: dist-i686-msvc
@rust-bors

rust-bors Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

💥 Test timed out after 21600s

@rust-bors

rust-bors Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #156742) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.