35723 Commits

Author SHA1 Message Date
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
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
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
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
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
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
bors
f8cdf873f1 Auto merge of #145146 - fee1-dead-contrib:push-zmqrkurlzrxy, r=nnethercote
remove `P`

Previous work: rust-lang/rust#141603
MCP: https://github.com/rust-lang/compiler-team/issues/878

cc `@nnethercote`
2025-08-09 23:27:55 +00:00
jackh726
9418a3f2df Implement next trait solver 2025-08-09 16:08:58 +00:00
Lukas Wirth
44bdfdf768
Merge pull request #20412 from Hmikihiro/fix_generate_function_generate_by_indent_token
fix: generate function by indet token
2025-08-09 09:42:12 +00:00
Deadbeef
302dc74564 remove P 2025-08-09 15:47:01 +08:00
Hmikihiro
cfd41034e2 fix: generate function by indet token 2025-08-09 15:48:10 +09:00
Laurențiu Nicola
5248c8950a
Merge pull request #20411 from BenjaminBrienen/duplicate-field
remove duplicate field in Debug impl of ProjectWorkspace
2025-08-09 04:28:22 +00:00
BenjaminBrienen
98322abfd7 remove duplicate field in Debug 2025-08-08 23:46:28 +02:00
A4-Tacks
d5afd99903
Add write! and writeln! to minicore 2025-08-09 00:09:56 +08:00
bors
b60057ef93 Auto merge of #143807 - rperier:rustc_llvm_werror, r=cuviper
Pass -Werror when building the LLVM wrapper

cc rust-lang/rust#109712
2025-08-07 23:29:58 +00:00
bors
fcc23b9068 Auto merge of #145056 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`

Cargo.lock update due to clippy version bump
2025-08-07 17:29:24 +00:00
bors
dd7bc0dd5f Auto merge of #145043 - Zalathar:rollup-3dbvdrm, r=Zalathar
Rollup of 19 pull requests

Successful merges:

 - rust-lang/rust#137831 (Tweak auto trait errors)
 - rust-lang/rust#138689 (add nvptx_target_feature)
 - rust-lang/rust#140267 (implement continue_ok and break_ok for ControlFlow)
 - rust-lang/rust#143028 (emit `StorageLive` and schedule `StorageDead` for `let`-`else`'s bindings after matching)
 - rust-lang/rust#143764 (lower pattern bindings in the order they're written and base drop order on primary bindings' order)
 - rust-lang/rust#143808 (Port `#[should_panic]` to the new attribute parsing infrastructure )
 - rust-lang/rust#143906 (Miri: non-deterministic floating point operations in `foreign_items`)
 - rust-lang/rust#143929 (Mark all deprecation lints in name resolution as deny-by-default and report-in-deps)
 - rust-lang/rust#144133 (Stabilize const TypeId::of)
 - rust-lang/rust#144369 (Upgrade semicolon_in_expressions_from_macros from warn to deny)
 - rust-lang/rust#144439 (Introduce ModernIdent type to unify macro 2.0 hygiene handling)
 - rust-lang/rust#144473 (Address libunwind.a inconsistency issues in the bootstrap program)
 - rust-lang/rust#144601 (Allow `cargo fix` to partially apply `mismatched_lifetime_syntaxes`)
 - rust-lang/rust#144650 (Additional tce tests)
 - rust-lang/rust#144659 (bootstrap: refactor mingw dist and fix gnullvm)
 - rust-lang/rust#144682 (Stabilize `strict_overflow_ops`)
 - rust-lang/rust#145026 (Update books)
 - rust-lang/rust#145033 (Reimplement `print_region` in `type_name.rs`.)
 - rust-lang/rust#145040 (rustc-dev-guide subtree update)

Failed merges:

 - rust-lang/rust#143857 (Port #[macro_export] to the new attribute parsing infrastructure)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-07 14:01:43 +00:00
Lukas Wirth
caef0f46fd
Merge pull request #20400 from rust-lang/veykril/push-ksxzmxqymsto
Disable error log for position clamping, its too noisy due to ease of triggering
2025-08-07 13:25:13 +00:00
Lukas Wirth
5022fb6343 Disable error log for position clamping, its too noisy due to ease of triggering 2025-08-07 15:14:22 +02:00
Stuart Cook
a75fd4984b
Rollup merge of #145040 - tshepang:rdg-sync, r=Kobzol
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to 1beca6333e.

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

r? `@ghost`
2025-08-07 20:49:49 +10:00
Stuart Cook
9fc3f7fe1b
Rollup merge of #145033 - nnethercote:fix-144994, r=fmease
Reimplement `print_region` in `type_name.rs`.

Broken by rust-lang/rust#144776; this is reachable after all.

Fixes rust-lang/rust#144994.

The commit also adds a lot more cases to the `type-name-basic.rs`, because it's currently very anaemic. This includes some cases where region omission does very badly; these are marked with FIXME.

r? `@fmease`
2025-08-07 20:49:48 +10:00
Stuart Cook
882dbdd075
Rollup merge of #145026 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

5 commits in b2d1a0821e12a676b496d61891b8e3d374a8e832..3e9dc46aa563ca0c53ec826c41b05f10c5915925
2025-08-02 01:33:29 UTC to 2025-07-14 21:23:38 UTC

- Appendix B and Appendix D from tech review (rust-lang/book#4466)
- Chapter 21 from tech review (rust-lang/book#4464)
- Chapter 20 from tech review (rust-lang/book#4460)
- Chapter 19 from tech review (rust-lang/book#4446)
- Chapter 18 from tech review (rust-lang/book#4445)

## rust-lang/reference

12 commits in 1f45bd41fa6c17b7c048ed6bfe5f168c4311206a..1be151c051a082b542548c62cafbcb055fa8944f
2025-08-05 19:51:40 UTC to 2025-07-14 19:49:01 UTC

- Fix build output directory in README (rust-lang/reference#1950)
- Update `link_name` to use the attribute template (rust-lang/reference#1896)
- Update `no_link` to use the attribute template (rust-lang/reference#1898)
- Update `proc_macro_derive` to use the attribute template (rust-lang/reference#1888)
- Update `automatically_derived` to use the attribute template (rust-lang/reference#1884)
- Update `derive` to use the attribute template (rust-lang/reference#1883)
- Fix and clarify CR LF normalization and CR in string literals (rust-lang/reference#1944)
- glossary.md: tweak description of "dispatch" (rust-lang/reference#1938)
- add missing id, r[asm.operand-type.supported-operands.const] (rust-lang/reference#1939)
- &str and &[u8] have the same layout (rust-lang/reference#1848)
- Rename and rewrite the "question mark operator" (rust-lang/reference#1931)
- Change "allocated object" to "allocation". (rust-lang/reference#1930)

## rust-lang/rust-by-example

3 commits in e386be5f44af711854207c11fdd61bb576270b04..bd1279cdc9865bfff605e741fb76a0b2f07314a7
2025-08-04 13:41:04 UTC to 2025-08-02 15:41:59 UTC

- Improve the activity instructions in `print_display` (rust-lang/rust-by-example#1948)
- Minor fixes (whitespace, typo, i32->u32) (rust-lang/rust-by-example#1947)
- Document drawbacks of alternatives to match binding (rust-lang/rust-by-example#1946)
2025-08-07 20:49:47 +10:00
Stuart Cook
bc3327c665
Rollup merge of #144682 - nxsaken:strict_overflow_ops, r=Mark-Simulacrum
Stabilize `strict_overflow_ops`

Closes rust-lang/rust#118260
2025-08-07 20:49:47 +10:00
Stuart Cook
51691edf0f
Rollup merge of #144659 - mati865:gnullvm-vendor-libunwind, r=Kobzol
bootstrap: refactor mingw dist and fix gnullvm

Fixes https://github.com/rust-lang/rust/issues/144533

The first two commits are NFC and only clean up the code, paving the way for the third commit. That said, I think they are worthwhile even without that fix - reusing the same function for two different outcomes was confusing.

The third commit is the fix for https://github.com/rust-lang/rust/issues/144533, but due to the cross-compilation dance it requires a workaround to find the DLL since that logic really was meant only for Windows builders. That workaround is short-lived and will be removed as soon as gnullvm bootstraps itself.
2025-08-07 20:49:46 +10:00
Stuart Cook
610ba90bea
Rollup merge of #144650 - Borgerr:additional-tce-tests, r=WaffleLapkin,tgross35
Additional tce tests

r? `@oli-obk`

Adds known-bug tests for LLVM emissions regarding indirect operands for TCE. Also includes a test, `indexer.rs`, referring to function_table behavior described by the RFC.

Depends on rust-lang/rust#144232

Closes rust-lang/rust#144293
2025-08-07 20:49:45 +10:00
Stuart Cook
f6cb7ab8e8
Rollup merge of #144601 - kornelski:cargo-fix-mismatched_lifetime_syntaxes, r=petrochenkov
Allow `cargo fix` to partially apply `mismatched_lifetime_syntaxes`

Workaround for https://github.com/rust-lang/rust/issues/144588#issuecomment-3128445308

Not all suggestions have to be hidden from `cargo fix`, only redundant ones. The redundant ones are already hidden from the user, so the same `tool_only` flag can be used to hide them from `cargo fix`. This way `cargo fix` will be able to correctly apply the fixes, and will apply only the fix that the compiler visibly suggests to the user.
2025-08-07 20:49:45 +10:00
Stuart Cook
ba783b5fda
Rollup merge of #144473 - zeroomega:rustc_inconsistency, r=Mark-Simulacrum
Address libunwind.a inconsistency issues in the bootstrap program

We noticed when building rustc multiple time in a roll, some files will not be consistent across the build despite the fact that they are built from same source under the same environment. This patch addresses the inconsistency issue we found on libunwind.a, by sorting the order of the files passed to the linker.
2025-08-07 20:49:44 +10:00
Stuart Cook
4304bc3171
Rollup merge of #144369 - joshtriplett:mbe-expr-semi-deny-by-default, r=petrochenkov
Upgrade semicolon_in_expressions_from_macros from warn to deny

This is already warn-by-default, and a future compatibility warning (FCW) that warns in dependencies. Upgrade it to deny-by-default, as the next step towards hard error.

Per https://github.com/rust-lang/rust/issues/79813#issuecomment-3109105631
2025-08-07 20:49:43 +10:00