Commit graph

166576 commits

Author SHA1 Message Date
Shoyu Vanilla (Flint)
f1e67f5418
Merge pull request #20729 from A4-Tacks/const-param-kwd
Add const parameter keyword completion
2025-09-26 07:00:52 +00:00
Shoyu Vanilla (Flint)
c491a330f3
Merge pull request #20731 from A4-Tacks/expand-rest-pat-in-tuple-slice-pat
Fix expand rest pattern in tuple and slice pattern
2025-09-26 06:54:30 +00:00
A4-Tacks
38284d10dc
Fix expand rest pattern in tuple and slice pattern
Assist: expand_tuple_rest_pattern

Fills fields by replacing rest pattern in tuple patterns.

Example
---
```
fn foo(bar: (char, i32, i32)) {
    let (ch, ..$0) = bar;
}
```
->
```
fn foo(bar: (char, i32, i32)) {
    let (ch, _1, _2) = bar;
}
```

---

Assist: expand_slice_rest_pattern

Fills fields by replacing rest pattern in slice patterns.

Example
---
```
fn foo(bar: [i32; 3]) {
    let [first, ..$0] = bar;
}
```
->
```
fn foo(bar: [i32; 3]) {
    let [first, _1, _2] = bar;
}
```
2025-09-26 14:44:05 +08:00
Shoyu Vanilla (Flint)
acd320f7b3
Merge pull request #20598 from A4-Tacks/let-chain-sup-conv-to-guarded-ret
Add let-chain support for convert_to_guarded_return
2025-09-26 06:42:10 +00:00
Shoyu Vanilla (Flint)
35f76dfcd9
Merge pull request #20736 from A4-Tacks/fix-invert-if-let-chain
Fix applicable on if-let-chain for invert_if
2025-09-26 05:36:52 +00:00
Shoyu Vanilla (Flint)
79b0a927b9
Merge pull request #20742 from A4-Tacks/unused-raw-var
Fix fixes for unused raw variables
2025-09-26 05:25:09 +00:00
A4-Tacks
11c35cd0bc
Add applicable in closure for convert_to_guarded_return
Example
---
```rust
fn main() {
    let _f = || {
        bar();
        if$0 true {
            foo();

            // comment
            bar();
        }
    }
}
```
->
```rust
fn main() {
    let _f = || {
        bar();
        if false {
            return;
        }
        foo();

        // comment
        bar();
    }
}
```
2025-09-25 22:04:53 +08:00
A4-Tacks
1947949f3d
Fix not applicable for if-expr in let-stmt
Example
---
```rust
fn main() {
    let _x = loop {
        if$0 let Ok(x) = Err(92) {
            foo(x);
        }
    };
}
```

**Before**:

Assist not applicable

**After**:

```rust
fn main() {
    let _x = loop {
        let Ok(x) = Err(92) else { continue };
        foo(x);
    };
}
```
2025-09-25 22:00:56 +08:00
A4-Tacks
c1cd1da668
Add let-chain support for convert_to_guarded_return
- And add early expression `None` in function `Option` return

Example
---
```rust
fn main() {
    if$0 let Ok(x) = Err(92)
        && x < 30
        && let Some(y) = Some(8)
    {
        foo(x, y);
    }
}
```
->
```rust
fn main() {
    let Ok(x) = Err(92) else { return };
    if x >= 30 {
        return;
    }
    let Some(y) = Some(8) else { return };
    foo(x, y);
}
```
2025-09-25 21:04:48 +08:00
A4-Tacks
a9637efa27
Fix fixes for unused raw variables
Example
---
```
fn main() {
    let $0r#type = 2;
}
```

**Before this PR**:

```rust
fn main() {
    let _r#type = 2;
}
```

**After this PR**:

```rust
fn main() {
    let _type = 2;
}
```
2025-09-25 19:58:45 +08:00
Shoyu Vanilla (Flint)
70d56dde8f
Merge pull request #20738 from jackh726/next-trait-solver-next4
Remove non-ns version of impl_self_ty and impl_trait
2025-09-25 10:30:54 +00:00
Shoyu Vanilla (Flint)
6fdf6b53eb
Merge pull request #20735 from itsjunetime/fix_scip_salsa
fix SCIP panicking due to salsa not attaching
2025-09-25 10:30:12 +00:00
Laurențiu Nicola
13d512f2d5 Install cargo for proc-macro-srv tests 2025-09-25 10:54:58 +03:00
Laurențiu Nicola
61792afab9 Also install rustfmt on stable 2025-09-25 10:19:23 +03:00
The rustc-josh-sync Cronjob Bot
ff7e731983 Merge ref 'caccb4d036' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: caccb4d036
Filtered ref: 0f345ed05d559bbfb754f1403b16199366cda2e0
Upstream diff: 21a19c297d...caccb4d036

This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-25 04:16:26 +00:00
The rustc-josh-sync Cronjob Bot
3280c210dd Prepare for merging from rust-lang/rust
This updates the rust-version file to caccb4d036.
2025-09-25 04:11:22 +00:00
itsjunetime
16460273e0
fix SCIP panicking due to salsa not attaching 2025-09-24 18:47:36 -05:00
Matthias Krüger
ec378dc773
Rollup merge of #146969 - RalfJung:maybe-null-errors, r=oli-obk
const-eval: better wording for errors involving maybe-null pointers

Fixes https://github.com/rust-lang/rust/issues/146748
r? ``@oli-obk``
2025-09-24 20:34:31 +02:00
Matthias Krüger
4300cd64df
Rollup merge of #146932 - ShoyuVanilla:ra-in-tree-hack, r=lcnr
Switch next-solver related rustc dependencies of r-a to crates.io ones

r? ``@ghost``

cc ``@lnicola`` ``@lcnr``
2025-09-24 20:34:25 +02:00
Matthias Krüger
4e225ee72d
Rollup merge of #146897 - lolbinarycat:rustdoc-invalid_html_tags-ice-146890, r=GuillaumeGomez
fix ICE in rustdoc::invalid_html_tags

fixes https://github.com/rust-lang/rust/issues/146890

r? ```@GuillaumeGomez```
2025-09-24 20:34:21 +02:00
Chayim Refael Friedman
a3840d9592 Implement fallback properly
fallback.rs was ported straight from rustc (minus the lint parts).

This fixes the `!` regressions.
2025-09-24 20:42:06 +03:00
Chayim Refael Friedman
871261ac14
Merge pull request #20683 from regexident/inference-result-types-iter
Expose iterators over an inference result's types
2025-09-24 17:12:33 +00:00
bors
15283f6fe9 Auto merge of #146338 - CrooseGit:dev/reucru01/AArch64-enable-GCS, r=Urgau,davidtwco
Extends AArch64 branch protection support to include GCS

Extends existing support for AArch64 branch protection to include support for [Guarded Control Stacks](https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-2022#guarded-control-stack-gcs:~:text=Extraction%20or%20tracking.-,Guarded%20Control%20Stack%20(GCS),-With%20the%202022).
2025-09-24 13:04:19 +00:00
Shoyu Vanilla
0e7cc32633 Switch next-solver related rustc dependencies of r-a to crates.io ones 2025-09-24 21:28:50 +09:00
Ralf Jung
8328c3dada const validation: better error for maybe-null references 2025-09-24 13:35:29 +02:00
bors
e9385f9eea Auto merge of #146946 - matthiaskrgr:rollup-fsmrqez, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#146818 (constify {float}::total_cmp())
 - rust-lang/rust#146896 (rustc-dev-guide subtree update)
 - rust-lang/rust#146898 (Update books)
 - rust-lang/rust#146899 (Fix a crash/mislex when more than one frontmatter closing possibility is considered)
 - rust-lang/rust#146904 (rust-lang/rust#140368 Mutex/RwLock/ReentrantLock::data_ptr to be const fn)
 - rust-lang/rust#146907 (add regression test for issue 146537)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-24 09:55:21 +00:00
A4-Tacks
6e897949a5
Fix applicable on if-let-chain for invert_if
Example
---
```rust
fn f() { i$0f x && let Some(_) = Some(1) { 1 } else { 0 } }
```

**Before this PR**:

```rust
fn f() { if !(x && let Some(_) = Some(1)) { 0 } else { 1 } }
```

**After this PR**:

Assist not applicable
2025-09-24 14:36:09 +08:00
jackh726
763ef13d3c Remove non-ns version of impl_self_ty and impl_trait 2025-09-24 05:45:12 +00:00
Shoyu Vanilla (Flint)
affd5c0df2
Merge pull request #20733 from jackh726/next-trait-solver-next3
Convert more things from chalk to next solver
2025-09-24 04:52:28 +00:00
bors
3e887f5faa Auto merge of #146953 - dianqk:update-llvm, r=cuviper
Update LLVM to 21.1.2

Fixes rust-lang/rust#146065.
2025-09-24 04:25:26 +00:00
dianqk
95ddfa102a
Update LLVM to 21.1.2 2025-09-24 07:34:22 +08:00
Matthias Krüger
7d0c283bbf
Rollup merge of #146898 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

1 commits in 3e9dc46aa563ca0c53ec826c41b05f10c5915925..33f1af40cc44dde7e3e892f7a508e6f427d2cbc6
2025-09-15 16:10:14 UTC to 2025-09-15 16:10:14 UTC

- Release trpl 0.3 (rust-lang/book#4505)

## rust-lang/reference

9 commits in b3ce60628c6f55ab8ff3dba9f3d20203df1c0dee..cc7247d8dfaef4c39000bb12c55c32ba5b5ba976
2025-09-20 10:26:26 UTC to 2025-09-08 18:07:29 UTC

- Document temporary scoping for destructuring assignments (rust-lang/reference#1992)
- Specify lifetime extension of `pin!` and `format_args!` arguments (rust-lang/reference#1980)
- update for more ABIs supporting c-variadics (rust-lang/reference#1936)
- Fix incorrect span tag (rust-lang/reference#1995)
- Remove strike attribute (rust-lang/reference#1997)
- Specify the target limits for target-specific ABIs (rust-lang/reference#2000)
- Remove tuple index carve out (rust-lang/reference#1966)
- Enable folding of chapter listing in navigation sidebar (rust-lang/reference#1988)
- Add support to grammar for single line comments (rust-lang/reference#1993)

## rust-lang/rust-by-example

1 commits in dd26bc8e726dc2e73534c8972d4dccd1bed7495f..2c9b490d70e535cf166bf17feba59e594579843f
2025-09-18 22:28:52 UTC to 2025-09-18 22:28:52 UTC

- Update unit testing output for additional test (rust-lang/rust-by-example#1958)
2025-09-23 23:40:28 +02:00
Matthias Krüger
f89d26b695
Rollup merge of #146896 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to d76c84c23c.

Created using https://github.com/rust-lang/josh-sync.

r? `````@ghost`````
2025-09-23 23:40:27 +02:00
bors
ae12bc21d8 Auto merge of #146931 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to f6466ce655.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
2025-09-23 21:37:04 +00:00
Jack Huey
94bf6b4da6 Be sure to instantiate and pass up trait refs in named_associated_type_shorthand_candidates 2025-09-23 16:27:04 -04:00
Jack Huey
8337750474 Remove all non-ns diagnostics queries, naming consistenly 2025-09-23 16:27:03 -04:00
Jack Huey
489f0179e7 Use lower_nextsolver::callable_item_signature instead of lower::callable_item_signature 2025-09-23 16:26:46 -04:00
Matthias Krüger
8e21b89135
Rollup merge of #146877 - el-ev:issue146816, r=fmease,lolbinarycat,GuillaumeGomez
prevent line number from being copied in chrome

- Closes rust-lang/rust#146816

Fix the issue where line numbers are copied along with code in Chrome
2025-09-23 18:13:57 +02:00
Matthias Krüger
35ceb3d447
Rollup merge of #146827 - foxtran:doc/linker-plugin-lto, r=nnethercote
Linker-plugin-based LTO: update list of good combinations (inc. beta + nightly)

This PR updates the list of good combinations of Rust toolchains and LLVM releases for linker-plugin-based LTO

Related to first question in https://users.rust-lang.org/t/questions-regarding-linker-plugin-based-lto/134070
2025-09-23 18:13:56 +02:00
Matthias Krüger
8f11c4dadb
Rollup merge of #146784 - dpaoliello:findmsvc, r=wesleywiser
[win] Use find-msvc-tools instead of cc to find the linker and rc on Windows

`find-msvc-tools` was factored out from `cc` to allow updating the use in `rustc_codegen_ssa` (finding the linker when running the Rust compiler) and `rustc_windows_rc` (finding the Windows Resource Compiler when running the Rust compiler) to be separate from the use in `rustc_llvm` (building LLVM as part of building the Rust compiler).
2025-09-23 18:13:53 +02:00
Matthias Krüger
ba9d057804
Rollup merge of #146731 - Muscraft:svg-test-terminal-url, r=jdonszelmann
test: Use SVG for terminal url test

I came across the test for `-Zterminal-urls` and found its output a bit hard to read. So, I decided to switch it to an SVG test, as I found it easier to differentiate the link and link text.

Note: `anstyle-svg` needed to be upgraded to at least `0.1.8` to support links in SVGs, so I went ahead and upgraded it to the latest version (`0.1.11`).
2025-09-23 18:13:52 +02:00
Reuben Cruise
08020def99 Changes some aarch64 CIs g++ install & ubuntu ver.
GCS support was added to GCC in version 15, thus the rmake test for this
patch requires GCC15
Similarly, the ubuntu version is updated so the newer clang version is
available, and/or GCC15 is the default.
2025-09-23 13:56:53 +01:00
Shoyu Vanilla (Flint)
aca434057f
Merge pull request #20543 from sgasho/fix/19443_replace_match_with_if_let
Fix "Replace match with if let" not to trigger when invalid transformations occur
2025-09-23 09:46:37 +00:00
Vincent Esche
a025cacc60 Expose iterators over an inference result's types
(This re-introduces a reduced access to a couple of previously public fields on `InferenceResult`)
2025-09-23 11:39:40 +02:00
Jack Huey
9e34268e24 Remove lower::value_ty in favor of lower_nextsolver::value_ty 2025-09-23 03:58:51 -04:00
Jack Huey
c960e9c218 Remove lower::ty in favor of lower_nextsolver::ty 2025-09-23 03:58:51 -04:00
Ralf Jung
0cd72a2f8d Merge ref 'f6092f224d' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: f6092f224d
Filtered ref: f843cd4f29bdcd8d474dbb9e5e4365eb7f263ec6

This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-23 09:28:24 +02:00
Ralf Jung
3c8d8da693 Prepare for merging from rust-lang/rust
This updates the rust-version file to f6092f224d.
2025-09-23 09:09:53 +02:00
Shoyu Vanilla (Flint)
1393e638bd
Merge pull request #20730 from A4-Tacks/migrate-expand-rest-pat
Migrate `expand_record_rest_pattern` assist to use `SyntaxEditor`
2025-09-23 07:05:22 +00:00
bors
4056082360 Auto merge of #146317 - saethlin:panic=immediate-abort, r=nnethercote
Add panic=immediate-abort

MCP: https://github.com/rust-lang/compiler-team/issues/909

This adds a new panic strategy, `-Cpanic=immediate-abort`. This panic strategy essentially just codifies use of `-Zbuild-std-features=panic_immediate_abort`. This PR is intended to just set up infrastructure, and while it will change how the compiler is invoked for users of the feature, there should be no other impacts.

In many parts of the compiler, `PanicStrategy::ImmediateAbort` behaves just like `PanicStrategy::Abort`, because actually most parts of the compiler just mean to ask "can this unwind?" so I've added a helper function so we can say `sess.panic_strategy().unwinds()`.

The panic and unwind strategies have some level of compatibility, which mostly means that we can pre-compile the sysroot with unwinding panics then the sysroot can be linked with aborting panics later. The immediate-abort strategy is all-or-nothing, enforced by `compiler/rustc_metadata/src/dependency_format.rs` and this is tested for in `tests/ui/panic-runtime/`. We could _technically_ be more compatible with the other panic strategies, but immediately-aborting panics primarily exist for users who want to eliminate all the code size responsible for the panic runtime. I'm open to other use cases if people want to present them, but not right now. This PR is already large.

`-Cpanic=immediate-abort` sets both `cfg(panic = "immediate-abort")` _and_ `cfg(panic = "abort")`. bjorn3 pointed out that people may be checking for the abort cfg to ask if panics will unwind, and also the sysroot feature this is replacing used to require `-Cpanic=abort` so this seems like a good back-compat step. At least for the moment. Unclear if this is a good idea indefinitely. I can imagine this being confusing.

The changes to the standard library attributes are purely mechanical. Apart from that, I removed an `unsafe` we haven't needed for a while since the `abort` intrinsic became safe, and I've added a helpful diagnostic for people trying to use the old feature.

To test that `-Cpanic=immediate-abort` conflicts with other panic strategies, I've beefed up the core-stubs infrastructure a bit. There is now a separate attribute to set flags on it.

I've added a test that this produces the desired codegen, called `tests/run-make-cargo/panic-immediate-abort-codegen/` and also a separate run-make-cargo test that checks that we can build a binary.
2025-09-23 06:37:03 +00:00