35998 Commits

Author SHA1 Message Date
Shoyu Vanilla (Flint)
4d7b9044c3
Merge pull request #20455 from A4-Tacks/fix-indent-conv-match-to-let-else
Fix indent for convert_match_to_let_else
2025-08-14 08:23:48 +00:00
Shoyu Vanilla (Flint)
83b852353a
Merge pull request #20456 from A4-Tacks/match-with-if-let-guard
Add guard to let-chain for replace_match_with_if_let
2025-08-14 08:22:05 +00:00
A4-Tacks
8399a88e99
Add guard to let-chain for replace_match_with_if_let
```rust
fn main() {
    match$0 Some(0) {
        Some(n) if n % 2 == 0 && n != 6 => (),
        _ => code(),
    }
}
```
->
```rust
fn main() {
    if let Some(n) = Some(0) && n % 2 == 0 && n != 6 {
        ()
    } else {
        code()
    }
}
2025-08-14 10:07:25 +08:00
A4-Tacks
e797f81f2a
Fix indent for convert_match_to_let_else
Example
---
```
//- minicore: option
fn f() {
    let x$0 = match Some(()) {
        Some(it) => it,
        None => {//comment
            println!("nope");
            return
        },
    };
}
```

**Old output**:

```rust
fn f() {
    let Some(x) = Some(()) else {//comment
            println!("nope");
            return
        };
}
```

**This PR output**:

```rust
fn f() {
    let Some(x) = Some(()) else {//comment
        println!("nope");
        return
    };
}
```
2025-08-14 08:34:31 +08:00
jackh726
fb53fdc1e4 Shift vars when mapping Dyn 2025-08-13 19:50:15 +00:00
jackh726
65d12c4bab Don't panic if unable to identify host in metrics 2025-08-13 19:49:59 +00:00
Chayim Refael Friedman
b06ce60086
Merge pull request #20390 from A4-Tacks/if-else-comp-in-args-or-let
Add if..else completions in LetStmt and ArgList
2025-08-13 16:44:39 +00:00
Chayim Refael Friedman
c4e73f7bac
Merge pull request #20448 from donni-h/patch-2
Fix dead link to Cargo.toml in documentation
2025-08-13 16:42:15 +00:00
Laurențiu Nicola
812cd91b9f
Merge pull request #20450 from Wilfred/update_vsce
[internal] Update to the latest @vscode/vsce for extension build
2025-08-13 14:47:20 +00:00
Wilfred Hughes
5c262a6f05 [internal] Update to the latest @vscode/vsce for extension build
This isn't a logic change, but it fixes an npm warning during the
build. vsce itself hasn't had any major changes between 3.2.2 and 3.6.

* https://github.com/microsoft/vscode-vsce/releases/tag/v3.3.0
* https://github.com/microsoft/vscode-vsce/releases/tag/v3.4.0
* https://github.com/microsoft/vscode-vsce/releases/tag/v3.5.0
* https://github.com/microsoft/vscode-vsce/releases/tag/v3.6.0
2025-08-13 15:25:34 +01:00
donni-h
53b27f2ab2
Fix dead link to Cargo.toml in documentation
../../Cargo.toml resolves to https://rust-analyzer.github.io/Cargo.toml, which is an invalid link
2025-08-13 13:03:52 +02:00
Lukas Wirth
7af2dd9704
Merge pull request #20446 from lcnr/kinda-unhelpful-3
next-solver fun time
2025-08-13 10:17:53 +00:00
lcnr
164d42ceab manually normalize alias 2025-08-13 11:00:00 +02:00
lcnr
425d68fc02 layout_of uses PostAnalysis 2025-08-13 10:57:45 +02:00
lcnr
70ec05eed7 implement type_of_opaque 2025-08-13 10:57:45 +02:00
Lukas Wirth
ac9d0f8049
Merge pull request #20376 from fee1-dead/traitalias
Merge Trait and TraitAlias handling
2025-08-13 08:27:54 +00:00
Lukas Wirth
2cc7bb371d
Merge pull request #20445 from rust-lang/veykril/push-twmmuyzwtxno
fix: Attach db for inlay hint compute
2025-08-13 08:01:19 +00:00
lcnr
f228c58776 update a few fixmes, and one trivial improvement 2025-08-13 10:01:17 +02:00
Lukas Wirth
96e6e3a83c
Merge pull request #20444 from rust-lang/veykril/push-snuuupqnrqzx
minor: Print fields of interned IDs in hir-ty instead of just the ID
2025-08-13 07:50:15 +00:00
Lukas Wirth
90647a195f fix: Attach db for inlay hint compute 2025-08-13 09:42:50 +02:00
Deadbeef
d9f67325ab fix errors after rebase 2025-08-13 15:33:08 +08:00
Lukas Wirth
216a986614 Fix metrics checking out repos into toplevel folder instead of target 2025-08-13 09:31:03 +02:00
Lukas Wirth
f8ef356226 Print fields of interned IDs in hir-ty instead of just the ID 2025-08-13 09:29:04 +02:00
Deadbeef
9deb3e440e add test for trait alias projections 2025-08-13 15:28:08 +08:00
Deadbeef
82f174fbd9 Merge Trait and TraitAlias handling 2025-08-13 15:28:08 +08:00
Lukas Wirth
a9450ebba3
Merge pull request #20329 from jackh726/next-trait-solver-querify
Switch from Chalk to the next trait solver
2025-08-13 06:10:45 +00:00
Chayim Refael Friedman
8c1c689977 Only import the item in "Unqualify method call" if needed 2025-08-13 05:23:58 +03:00
Chayim Refael Friedman
b2a58b8c6e
Merge pull request #20432 from sgasho/fix/20215_implement_default_member_to_resolve_ident_pat
Fix "Implement default members" to resolve IdentPat
2025-08-12 13:18:36 +00:00
sgasho
8ab683759e fix: Implement default member to resolve IdentPat 2025-08-12 21:53:50 +09:00
Shoyu Vanilla (Flint)
9db05508ed
Merge pull request #20434 from ShoyuVanilla/diag-fix-again
fix: Panic while trying to clear old diagnostics while there's nothing
2025-08-11
2025-08-11 15:35:38 +00:00
Shoyu Vanilla
8af9607d28 fix: Panic while trying to clear old diagnostics while there's nothing 2025-08-12 00:24:44 +09:00
Shoyu Vanilla
635b536f11 Make import sorting order follow 2024 edition style 2025-08-12 00:01:46 +09:00
Chayim Refael Friedman
7b65a451d3
Merge pull request #20420 from iorizu/doc-symbols-filter
feat: Add Config Option to Exclude Locals from Document Symbol Search
2025-08-11 14:46:18 +00:00
Lukas Wirth
3d2c40d705
Merge pull request #20429 from ShoyuVanilla/master
hotfix: Update flycheck diagnostics generation
2025-08-11 09:31:31 +00:00
Shoyu Vanilla (Flint)
0a72e9f88a
hotfix: Update flycheck diagnostics generation 2025-08-11 18:18:55 +09:00
Laurențiu Nicola
16ef2a44f1
Merge pull request #20424 from rust-lang/rustc-pull
Rustc pull update
2025-08-11 06:58:04 +00:00
The rustc-josh-sync Cronjob Bot
966e694105 Merge ref '21a19c297d4f' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 21a19c297d4f5a03501d92ca251bd7a17073c08a
Filtered ref: 9a5c1fb93028e1a29a7598ce782efb0c5d7be534

This merge was created using https://github.com/rust-lang/josh-sync.
2025-08-11 04:30:34 +00:00
The rustc-josh-sync Cronjob Bot
4446404782 Prepare for merging from rust-lang/rust
This updates the rust-version file to 21a19c297d4f5a03501d92ca251bd7a17073c08a.
2025-08-11 04:25:52 +00:00
Ifeanyi Orizu
0a4d7dcdda Fix minor things 2025-08-10 17:48:17 -05:00
Ifeanyi Orizu
dc6e6d2b86 Add config option to exclude locals from doc search 2025-08-10 17:48:17 -05:00
Shoyu Vanilla (Flint)
4e147e7879
Merge pull request #20419 from ShoyuVanilla/flyck-gen
internal: Make flycheck generational
2025-08-10 14:00:52 +00:00
Shoyu Vanilla
fc2190f1da internal: Make flycheck generational 2025-08-10 22:10:55 +09:00
bors
9a5c1fb930 Auto merge of #145144 - scottmcm:unsigned_overflow_intr, r=nikic
Stop using uadd.with.overflow

As discussed in [#t-compiler/llvm > `uadd.with.overflow` (again) @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/187780-t-compiler.2Fllvm/topic/.60uadd.2Ewith.2Eoverflow.60.20.28again.29/near/533041085), stop emitting `uadd.with.overflow` in favour of `add`+`icmp` instead.

r? nikic
2025-08-10 09:24:56 +00:00
Chayim Refael Friedman
d307bc614e
Merge pull request #20418 from A4-Tacks/fix-extract-expr-from-fmtstr-on-write
Fix extract_expressions_from_format_string on write!
2025-08-10 07:10:10 +00:00
Chayim Refael Friedman
29cb5d4375
Merge pull request #20417 from npmccallum/syntax
parser: fix parsing of trait bound polarity and for-binders
2025-08-10 06:58:27 +00:00
A4-Tacks
62508aaca1
Fix extract_expressions_from_format_string on write!
**Input**:

```rust
fn main() {
    write!(f, "{2+3}$0")
}
```

**Old output**:

```rust
fn main() {
    write!("{}"$0, 2+3)
}
```

**This PR output**:

```rust
fn main() {
    write!(f, "{}"$0, 2+3)
}
```
2025-08-10 14:45:54 +08:00
Nathaniel McCallum
943b42f743 parser: fix parsing of trait bound polarity and for-binders
The rustc AST allows both `for<>` binders and `?` polarity
modifiers in trait bounds, but they are parsed in a specific
order and validated for correctness:

  1. `for<>` binder is parsed first.
  2. Polarity modifiers (`?`, `!`) are parsed second.
  3. The parser validates that binders and polarity modifiers
     do not conflict:

```rust
if let Some(binder_span) = binder_span {
    match modifiers.polarity {
        BoundPolarity::Maybe(polarity_span) => {
            // Error: "for<...> binder not allowed with ? polarity"
        }
    }
}
```

This implies:

- `for<> ?Sized` → Valid syntax. Invalid semantics.
- `?for<> Sized` → Invalid syntax.

However, rust-analyzer incorrectly had special-case logic that
allowed `?for<>` as valid syntax. This fix removes that incorrect
special case, making rust-analyzer reject `?for<> Sized` as a
syntax error, matching rustc behavior.

This has caused confusion in other crates (such as syn) which
rely on these files to implement correct syntax evaluation.
2025-08-10 02:21:11 -04:00
bors
7bbb3a6b5c Auto merge of #144873 - cjgillot:implications, r=lqd
Implement `stability_implications` without a visitor.

Since https://github.com/rust-lang/rust/pull/143845, the `Annotator` visitor was a no-op when the crate is not staged_api. This PR avoids using a visitor altogether, making `stability_implications` truly a no-op in most cases.
2025-08-10 05:44:53 +00:00
bors
2bad3184ed Auto merge of #144787 - Kobzol:codegen-backend-restructure, r=jieyouxu
Refactor codegen backends in bootstrap

This PR refactors the codegen backend steps, in preparation to make more progress on the integration of the GCC codegen backend in bootstrap. It does several things:

1) Splits the `CodegenBackend` step into two, one for clif and another one for gcc. Even though their code is mostly similar, that's IMO mostly fake similarity, and they do (or will) ultimately require different handling. This was already visible in the requirement of building GCC for cg_gcc, of course.
2) It is now possible to build both backends (and dist cranelift) even if they are not specified in `rust.codegen-backends`. It was quite weird that it wasn't possible to even invoke the corresponding codegen backend if the backend wasn't specified in that array, as that array should ideally only change defaults (see later below).
3) Changes the path specification of these steps to an alias. In other words, instead of `compiler/rustc_codegen_cranelift`, the step is now built only using `rustc_codegen_cranelift` or `cg_clif`. This is done to avoid an annoying clash with `x build compiler`, which would otherwise build both codegen backends after the 2) change.
4) Made the copying of codegen backend artifacts more explicit, in particular in the `Assemble` step.
5) Codifies the semantics of `rust.codegen-backends`, which now only affects the defaults of whether a codegen backend will be included in rustc's sysroot and whether it will be disted in `x dist` by default. We can change the behavior later, e.g. to dist cranelift by default in `x dist` once it becomes stabilized. Currently I left the existing behavior that we use on CI, I just tried to document it better.

I don't think that this requires a change tracker entry, because the defaults should work the same as before. It is just now possible to do `x build/dist rustc_codegen_cranelift` even if CLIF is not in the `codegen-backends` array. It is no longer possible to do `./x build compiler/rustc_codegen_cranelift` though, not sure if that requires a change tracker entry.

There is one thing that I didn't touch yet, and that is the fact that `rust.codegen-backends` not only affects the default behavior of `x dist` w.r.t. Cranelift, but also of `x test`. In other words, `x test rustc_codegen_cranelift` still does not hing if cranelift isn't in `rust.codegen-backends`. I plan to take a look at this once I get to refactoring the test steps.

r? `@jieyouxu`
2025-08-10 02:32:41 +00:00
Chayim Refael Friedman
31db5b5be9
Merge pull request #20409 from A4-Tacks/minicore-write
Add write! and writeln! to minicore
2025-08-10 01:39:58 +00:00