Commit Graph

307210 Commits

Author SHA1 Message Date
Urgau 659575bfbe Add t- prefix to S-waiting-on-{team} labels 2025-10-07 18:15:02 +02:00
Urgau e0c20a0476 Update S-waiting-on-team refs to new S-waiting-on-{team} labels 2025-10-06 19:25:40 +02:00
bors 8111a2d6da Auto merge of #147397 - Zalathar:rollup-mioe9m4, r=Zalathar
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#146027 (support link modifier `as-needed` for raw-dylib-elf)
 - rust-lang/rust#146874 (compiler: Hint at multiple crate versions if trait impl is for wrong ADT )
 - rust-lang/rust#147237 ([rustdoc] Cleanup "highlight::end_expansion")

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-06 12:20:14 +00:00
Stuart Cook c8113a70df Rollup merge of #147237 - yotamofek:pr/rustdoc/highlight/optimize-end_expansion, r=GuillaumeGomez
[rustdoc] Cleanup "highlight::end_expansion"

~Looks like a ~5% improvement on the highlight benchmark.
Obviously, highlighting is only a small part of rustdoc's runtime, so improvement won't be as large on rustc-perf (if there's even an improvement), but holding fingers for a nice gain.~

Perf seems neutral, but IMHO this is a nice small cleanup regardless.

r? `@GuillaumeGomez` (& perf run please!)
2025-10-06 21:20:09 +11:00
Stuart Cook c3b51b3182 Rollup merge of #146874 - Enselic:multiple-adt-versions, r=jieyouxu
compiler: Hint at multiple crate versions if trait impl is for wrong ADT

If a user does e.g.

    impl From<Bar> for foo::Foo

and get a compilation error about that `From<Bar>` is not implemented for `Foo`, check if multiple versions of the crate with `Foo` is present in the dependency graph. If so, give a hint about it.

Note that a test is added as a separate commit so it is easy to see what effect the fix has on the emitted error message.

This can be seen as a continuation of rust-lang/rust#124944.

I think this closes RUST-71693 but I haven't checked since it lacks a minimal reproducer. If this gets merged I'll ask that reporter if this fix works for them.

## Real world example

I encountered this case in the wild and didn't realize I had multiple versions of a crate in my dependency graph. So I was a bit confused at first. For reference, here is what that looked like.

<details>
<summary>Click to expand</summary>

### Before fix

```
error[E0277]: the trait bound `lambda_http::lambda_runtime::Diagnostic: From<Error>` is not satisfied
   --> src/main.rs:73:5
    |
73  |     lambda_http::run(service_fn(handle_event)).await
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<Error>` is not implemented for `lambda_http::lambda_runtime::Diagnostic`
    |
    = help: the following other types implement trait `From<T>`:
              `lambda_http::lambda_runtime::Diagnostic` implements `From<&str>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError + Send + Sync>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Infallible>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<lambda_runtime::deserializer::DeserializeError>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::io::Error>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::string::String>`
    = note: required for `Error` to implement `Into<lambda_http::lambda_runtime::Diagnostic>`
note: required by a bound in `lambda_http::run`
   --> /home/martin/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lambda_http-0.17.0/src/lib.rs:199:26
    |
194 | pub async fn run<'a, R, S, E>(handler: S) -> Result<(), Error>
    |              --- required by a bound in this function
...
199 |     E: std::fmt::Debug + Into<Diagnostic>,
    |                          ^^^^^^^^^^^^^^^^ required by this bound in `run`

error[E0277]: the trait bound `lambda_http::lambda_runtime::Diagnostic: From<Error>` is not satisfied
   --> src/main.rs:73:48
    |
73  |     lambda_http::run(service_fn(handle_event)).await
    |                                                ^^^^^ the trait `From<Error>` is not implemented for `lambda_http::lambda_runtime::Diagnostic`
    |
    = help: the following other types implement trait `From<T>`:
              `lambda_http::lambda_runtime::Diagnostic` implements `From<&str>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError + Send + Sync>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Infallible>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<lambda_runtime::deserializer::DeserializeError>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::io::Error>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::string::String>`
    = note: required for `Error` to implement `Into<lambda_http::lambda_runtime::Diagnostic>`
note: required by a bound in `lambda_http::run`
   --> /home/martin/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lambda_http-0.17.0/src/lib.rs:199:26
    |
194 | pub async fn run<'a, R, S, E>(handler: S) -> Result<(), Error>
    |              --- required by a bound in this function
...
199 |     E: std::fmt::Debug + Into<Diagnostic>,
    |                          ^^^^^^^^^^^^^^^^ required by this bound in `run`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `auto-merge-dependabot-pull-requests-webhook` (bin "auto-merge-dependabot-pull-requests-webhook") due to 2 previous errors
```

### After fix

```
   Compiling auto-merge-dependabot-pull-requests-webhook v0.1.0 (/home/martin/src/auto-merge-dependabot-prs/rust-webhook)
error[E0277]: the trait bound `lambda_http::lambda_runtime::Diagnostic: From<Error>` is not satisfied
   --> src/main.rs:73:5
    |
 73 |     lambda_http::run(service_fn(handle_event)).await
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<Error>` is not implemented for `lambda_http::lambda_runtime::Diagnostic`
    |
help: item with same name found
   --> /home/martin/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lambda_runtime-0.13.0/src/diagnostic.rs:43:1
    |
 43 | pub struct Diagnostic {
    | ^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `lambda_runtime` are being used?
    = help: the following other types implement trait `From<T>`:
              `lambda_http::lambda_runtime::Diagnostic` implements `From<&str>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError + Send + Sync>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Infallible>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<lambda_runtime::deserializer::DeserializeError>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::io::Error>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::string::String>`
    = note: required for `Error` to implement `Into<lambda_http::lambda_runtime::Diagnostic>`
note: required by a bound in `lambda_http::run`
   --> /home/martin/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lambda_http-0.17.0/src/lib.rs:199:26
    |
194 | pub async fn run<'a, R, S, E>(handler: S) -> Result<(), Error>
    |              --- required by a bound in this function
...
199 |     E: std::fmt::Debug + Into<Diagnostic>,
    |                          ^^^^^^^^^^^^^^^^ required by this bound in `run`

error[E0277]: the trait bound `lambda_http::lambda_runtime::Diagnostic: From<Error>` is not satisfied
   --> src/main.rs:73:48
    |
 73 |     lambda_http::run(service_fn(handle_event)).await
    |                                                ^^^^^ the trait `From<Error>` is not implemented for `lambda_http::lambda_runtime::Diagnostic`
    |
help: item with same name found
   --> /home/martin/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lambda_runtime-0.13.0/src/diagnostic.rs:43:1
    |
 43 | pub struct Diagnostic {
    | ^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `lambda_runtime` are being used?
    = help: the following other types implement trait `From<T>`:
              `lambda_http::lambda_runtime::Diagnostic` implements `From<&str>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError + Send + Sync>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Infallible>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<lambda_runtime::deserializer::DeserializeError>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::io::Error>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::string::String>`
    = note: required for `Error` to implement `Into<lambda_http::lambda_runtime::Diagnostic>`
note: required by a bound in `lambda_http::run`
   --> /home/martin/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lambda_http-0.17.0/src/lib.rs:199:26
    |
194 | pub async fn run<'a, R, S, E>(handler: S) -> Result<(), Error>
    |              --- required by a bound in this function
...
199 |     E: std::fmt::Debug + Into<Diagnostic>,
    |                          ^^^^^^^^^^^^^^^^ required by this bound in `run`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `auto-merge-dependabot-pull-requests-webhook` (bin "auto-merge-dependabot-pull-requests-webhook") due to 2 previous errors
```

</details>

try-job: dist-various-1
try-job: aarch64-msvc-1
2025-10-06 21:20:08 +11:00
Stuart Cook 036c8e1d1a Rollup merge of #146027 - usamoi:raw-dylib-elf-as-needed, r=bjorn3
support link modifier `as-needed` for raw-dylib-elf

This pull request:

* emits `-Wl,--as-needed` instead of `-Wl,--no-as-needed` for `raw-dylib-elf`, keeping it consistent with `dylib`
* allows combination of link kind `raw-dylib` and link modifier `as-needed`, thus allowing free choice of behavior

r? `@bjorn3`

cc https://github.com/rust-lang/rust/issues/135694
cc https://github.com/rust-lang/rust/issues/99424
2025-10-06 21:20:08 +11:00
bors d2acb427e4 Auto merge of #147392 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to https://github.com/rust-lang/rustc-dev-guide/commit/5270b840dd7055e5e2717586527ffabc95ecd44e.

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

r? `@ghost`
2025-10-06 09:07:21 +00:00
Tshepang Mbambo ce3928b355 Merge pull request #2605 from rust-lang/tshepang/edition-directive
some fixes
2025-10-06 07:13:39 +02:00
Tshepang Mbambo 2d6f590af1 overlong 2025-10-06 07:13:01 +02:00
Tshepang Mbambo 98afeb8645 fix text describing edition range testing 2025-10-06 07:06:27 +02:00
Tshepang Mbambo 73c8bfa3f0 Merge pull request #2604 from rust-lang/rustc-pull
Rustc pull update
2025-10-06 06:53:24 +02:00
bors 1a3cdd3462 Auto merge of #147377 - karolzwolak:dont-create-empty-ident-issue-147365, r=nnethercote
don't make empty ident when printing `'` ident from `extern "'"`

Fixes rust-lang/rust#147365.
r? `@nnethercote`
2025-10-06 04:34:57 +00:00
Martin Nordholts eeb7cb1b8a compiler: Hint at multiple crate versions if trait impl is for wrong ADT
If a user does e.g.

    impl From<Bar> for foo::Foo

and get a compilation error about that `From<Bar>` is not implemented
for `Foo`, check if multiple versions of the crate with `Foo` is present
in the dependency graph. If so, give a hint about it.

I encountered this case in the wild and didn't realize I had multiple
versions of a crate in my dependency graph. So I was a bit confused at
first. This fix will make life easier for others.
2025-10-06 06:21:45 +02:00
The rustc-josh-sync Cronjob Bot cbee1ab175 Merge ref '4fa824bb7831' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 4fa824bb78
Filtered ref: b8d3c3cc8b2048bd34d7611095d36d82259331af
Upstream diff: https://github.com/rust-lang/rust/compare/9f32ccf35fb877270bc44a86a126440f04d676d0...4fa824bb78318a3cba8c7339d5754b4909922547

This merge was created using https://github.com/rust-lang/josh-sync.
2025-10-06 04:19:25 +00:00
The rustc-josh-sync Cronjob Bot f54139aa31 Prepare for merging from rust-lang/rust
This updates the rust-version file to 4fa824bb78.
2025-10-06 04:13:15 +00:00
bors 828c2a9afc Auto merge of #147360 - chenyukang:yukang-fix-assoc-eq-missing-term, r=nnethercote
Remove extra space for missing associated type term suggestion

r? `@nnethercote`
2025-10-06 01:24:16 +00:00
usamoi 21dd997aec support link modifier as-needed for raw-dylib-elf 2025-10-06 08:56:40 +08:00
bors 4fa824bb78 Auto merge of #147375 - folkertdev:power-align-union, r=RalfJung
ignore power alignment rule on unions

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

The power alignment rule only applies to the non-first field of a struct, and so should not apply to unions at all.

The current code also does not consider enums (whose fields might be, morally, structs). Given that C does not actually have ADTs like this it's probably fine from a compatibility perspective, but I'll leave that to the powerpc folks.

cc `@daltenty` `@gilamn5tr`
r? compiler
2025-10-05 22:14:55 +00:00
bors 839222065a Auto merge of #147384 - workingjubilee:rollup-2qqqfn4, r=workingjubilee
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#147327 (cg_llvm: Remove inherent methods from several LLVM FFI types)
 - rust-lang/rust#147332 (Set opt-level flag for installing tool only on CI)
 - rust-lang/rust#147374 (bootstrap: don't build book redirect pages during dry-run/test)
 - rust-lang/rust#147376 (bootstrap: relax `compiler-rt` root assertion)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-05 19:03:28 +00:00
Jubilee 0d3e4d1c2c Rollup merge of #147376 - jieyouxu:bootstrap-compiler-rt-self-test, r=Kobzol
bootstrap: relax `compiler-rt` root assertion

Not needed during tests. This would otherwise require `src/llvm-project` submodule to be initialized and `compiler-rt/` subdirectory to be present.

I need this and rust-lang/rust#147374 to get bootstrap self-tests to pass with no git submodules checked out locally.

r? `@Kobzol` (or bootstrap)
2025-10-05 11:59:24 -07:00
Jubilee aa37ad40d5 Rollup merge of #147374 - jieyouxu:bootstrap-redirect-pages, r=Kobzol
bootstrap: don't build book redirect pages during dry-run/test

Currently, `./x test bootstrap` does not automatically transitively checkout submodules needed to pass all involved test steps. Apparently one place where bootstrap's self-test can choke on locally is trying to build book redirect pages without the book submodules checked out.

This change is orthogonal to making bootstrap checking out required submodules for self-tests, and IMO is beneficial regardless since IMO we should not be building these redirect pages during test/dry-run _anyway_.

This was blocking me trying to rebless bootstrap self-tests for rust-lang/rust#147372. cf. [#t-infra/bootstrap > Bootstrap self-tests @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Bootstrap.20self-tests/near/543157194).

r? `@Kobzol` (or bootstrap)
2025-10-05 11:59:24 -07:00
Jubilee 23d1cc7c52 Rollup merge of #147332 - Shunpoco:fast-spellcheck, r=Kobzol
Set opt-level flag for installing tool only on CI

## Context
ensure_version_or_cargo_install uses -Copt-level=0 for quicker installation. However, the flag affects the tool's performance. For example, typos-cli with opt-level=0 takes 15 seconds for checking /compiler on my local, but the tool with default opt-level only takes less than 1 sec.

It fixes rust-lang/rust#147331

## Changes
This PR enables the option only when the test tidy is run on CI.
We've discussed that opt-level=1 should be enough, so I also change the level from 0 to 1.
2025-10-05 11:59:23 -07:00
Jubilee d8fc465bbb Rollup merge of #147327 - Zalathar:inherent, r=workingjubilee
cg_llvm: Remove inherent methods from several LLVM FFI types

This is mainly motivated by rust-lang/rust#142897, which proposes to move the LLVM FFI bindings out of `rustc_codegen_llvm` and into `rustc_llvm`, which is arguably the more correct place for them from a linking perspective.

---

In order to perform that migration, all of the types used in FFI signatures also need to be moved. However, several of those types have inherent methods that convert from backend-independent types to LLVM FFI types.

Moving the inherent methods as-is would require adding a lot of otherwise-unnecessary dependencies to `rustc_llvm`. And we can't leave them behind as-is, because inherent methods can't be defined in another crate.

Therefore, this PR replaces several of those inherent methods with either extension trait methods or free functions.
2025-10-05 11:59:23 -07:00
Shunpoco 8a31837054 Set opt-level for installing tool only on CI
ensure_version_or_cargo_install uses -Copt-level=0 for quicker installation.
However, the flag affects the tool's performance. For example, typos-cli with opt-level=0 takes 15 seconds for checking ./compiler, but the tool with default opt-level only takes less than 1 sec.
This commit enables the option only when the test tidy is run on CI.
2025-10-05 16:57:51 +01:00
bors 981353ca16 Auto merge of #147345 - Kivooeo:tidy-flt-fix, r=Kobzol
Tidy: revert `flt` to `ftl`

As was explained here https://github.com/rust-lang/rust/pull/147191#issuecomment-3353801210, this reverting this change because `flt` is incorrect format

Also maybe there is existed PR for that? I didn't found one

Follow up https://github.com/rust-lang/rust/pull/147191

cc `@GuillaumeGomez`
2025-10-05 15:55:18 +00:00
bors bcbbdcb852 Auto merge of #147371 - Zalathar:rollup-897uitw, r=Zalathar
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#144908 (Fix doctest output json)
 - rust-lang/rust#147262 (Make #[link="dl"] an FCW rather than an error)
 - rust-lang/rust#147364 (update autodiff testcases)
 - rust-lang/rust#147367 (Trivial code cleanup in resolve)
 - rust-lang/rust#147369 (Fill out AVR target metadata)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-05 12:43:00 +00:00
Jieyou Xu a8b9a57674 bootstrap: relax compiler-rt root assertion
Not needed during tests.
2025-10-05 20:30:52 +08:00
Karol Zwolak 5234d36597 add test 2025-10-05 14:27:31 +02:00
Jieyou Xu 7ed476f51f bootstrap: don't build redirect pages during dry-run/test 2025-10-05 20:18:38 +08:00
Folkert de Vries 5a0ea3bfba power align: ignore repr(C) unions and enums 2025-10-05 14:18:17 +02:00
Folkert de Vries 87e8ec8114 power align: format test file 2025-10-05 14:15:40 +02:00
Karol Zwolak a316f5b72e don't make empty ident when printing ' ident from extern "'" 2025-10-05 14:08:42 +02:00
Stuart Cook 21b5d6bd86 Rollup merge of #147369 - Noratrieb:avr-metadata, r=jieyouxu
Fill out AVR target metadata

This will make `-Zbuild-std` automatically build the right crates, notably not building `std` by default, which will both be useful for users and also fix the build for https://does-it-build.noratrieb.dev, which currently tries to build std: http://localhost:3000/build?nightly=2025-07-12&target=avr-none&mode=std.

cc `@Patryk27` but I don't think this necessarily needs your approval
2025-10-05 22:15:08 +11:00
Stuart Cook 94e04993a1 Rollup merge of #147367 - chenyukang:yukang-trivial-cleanup, r=jieyouxu
Trivial code cleanup in resolve

r? `@jieyouxu`
2025-10-05 22:15:07 +11:00
Stuart Cook c8407194f9 Rollup merge of #147364 - ZuseZ4:update-autodiff-tests, r=jieyouxu
update autodiff testcases

unblock https://github.com/EnzymeAD/Enzyme/pull/2430 (again).
Just as I landed a fix for the last test, this one broke. The test should now be fine if the name mangling hash changes again.

Also removed an outdated fixme that's not needed since moving autodiff to an intrinsic. The test currently just checks that it compiles, I'll add more precise checks once we actually run this in CI.

r? compiler
2025-10-05 22:15:06 +11:00
Stuart Cook d97e346ac7 Rollup merge of #147262 - JonathanBrouwer:fix-link, r=jieyouxu
Make #[link="dl"] an FCW rather than an error

Fixes https://github.com/rust-lang/rust/issues/147254
I forgot to implement the T-lang decision in https://github.com/rust-lang/rust/pull/143193#issuecomment-3138479942, this implements that decision

r? ``@jdonszelmann``
Can be reviewed commit-by-commit
This needs a beta backport
2025-10-05 22:15:06 +11:00
Stuart Cook cc1a80629f Rollup merge of #144908 - GuillaumeGomez:fix-doctest-output-json, r=fmease
Fix doctest output json

Fixes rust-lang/rust#144798.

Hopefully it will work with the new changes in `libtest` without needing to do both at once.

This PR moves the `rustdoc` merged doctest extra information directly into `libtest` to ensure they share the same rendering to prevent the bug uncovered in rust-lang/rust#144798.

cc `@lolbinary` (as you reviewed the first PR)

And since we're making changes to `libtest`:

r? `@Amanieu`
2025-10-05 22:15:05 +11:00
nora 9ccaf080cb Fill out AVR target metadata
This will make `-Zbuild-std` automatically build the right crates, notably not building `std` by default, which will both be useful for users and also fix the build for https://does-it-build.noratrieb.dev.
2025-10-05 12:01:23 +02:00
yukang 95445f9b96 Trivial code cleanup in resolve 2025-10-05 17:27:45 +08:00
Guillaume Gomez 99c7959bb7 Add regression test for rustdoc output format 2025-10-05 11:13:05 +02:00
Manuel Drehwald 7c8fe29fd6 solve autodiffv2.rs FIXME and make identical_fnc test more robust 2025-10-05 03:07:51 -04:00
Manuel Drehwald bd975777a2 Merge pull request #2603 from rust-lang/autodiff-updates
update libEnzyme file name, and add missing strict-aliasing flag
2025-10-05 01:40:12 -04:00
Manuel Drehwald 765e2fe6ee Add potential instability warning 2025-10-05 01:38:29 -04:00
bors e2c96cc06b Auto merge of #147363 - Zalathar:rollup-d9kd06g, r=Zalathar
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#147288 (compiletest: Make `DirectiveLine` responsible for name/value splitting)
 - rust-lang/rust#147309 (Add documentation about unwinding to wasm targets)
 - rust-lang/rust#147310 (Mark `PatternTypo` suggestion as maybe incorrect)
 - rust-lang/rust#147320 (Avoid to suggest pattern match on the similarly named in fn signature)
 - rust-lang/rust#147328 (Implement non-poisoning `Mutex::with_mut`, `RwLock::with` and `RwLock::with_mut`)
 - rust-lang/rust#147337 (Make `fmt::Write` a diagnostic item)
 - rust-lang/rust#147349 (Improve the advice given by panic_immediate_abort)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-05 04:36:49 +00:00
Stuart Cook a0a4905723 Rollup merge of #147349 - saethlin:panic-immediate-advice, r=Noratrieb
Improve the advice given by panic_immediate_abort

Now that https://github.com/rust-lang/rust/pull/147338 is merged, users should consider using the Cargo support for immediate-aborting panics.
2025-10-05 15:35:05 +11:00
Stuart Cook 80759350c7 Rollup merge of #147337 - ada4a:write-diag-item, r=fmease
Make `fmt::Write` a diagnostic item

I'm working on an enhancement to [`clippy::format_push_string`](https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string), which would suggest an autofix to replace `push_str`/`+=` with `write!`. But that could require importing `std::fmt::Write`, and so I need this diagnostic item to check if it's already in scope.

The reason I called it `FmtWrite` and not just `Write` is that there's already an `IoWrite` defined.
2025-10-05 15:35:04 +11:00
Stuart Cook 56c96aebfc Rollup merge of #147328 - EFanZh:lock-with, r=joboet
Implement non-poisoning `Mutex::with_mut`, `RwLock::with` and `RwLock::with_mut`

ACP: https://github.com/rust-lang/libs-team/issues/497.
2025-10-05 15:35:04 +11:00
Stuart Cook cae84c695a Rollup merge of #147320 - chenyukang:yukang-fix-147303-fn-arg, r=jieyouxu
Avoid to suggest pattern match on the similarly named in fn signature

Fixes rust-lang/rust#147303
2025-10-05 15:35:03 +11:00
Stuart Cook 620ffe6595 Rollup merge of #147310 - Jules-Bertholet:maybe-incorrect-pattern-typo, r=chenyukang
Mark `PatternTypo` suggestion as maybe incorrect

Partial fix for https://github.com/rust-lang/rust/issues/147303.

`@rustbot` label A-diagnostics A-suggestion-diagnostics D-invalid-suggestion
2025-10-05 15:35:03 +11:00
Stuart Cook ff86a7db83 Rollup merge of #147309 - alexcrichton:wasm-unwinding-docs, r=jieyouxu
Add documentation about unwinding to wasm targets

This commit adds some documentation about the state of `-Cpanic=unwind` for the following wasm targets:

* `wasm32-unknown-unknown`
* `wasm32-wasip1`
* `wasm32-wasip2`
* `wasm32v1-none`

Notably it's possible to use `-Cpanic=unwind` with `-Zbuild-std` and it's also mentioned that there are no concrete proposals at this time to adding a new set of targets which support unwinding. My hunch is that in a few years' time it would make sense to enable it by default on these targets (except for `wasm32v1-none`) but that's a problem for future folks to debate. For now this is an attempt to document the status quo.
2025-10-05 15:35:02 +11:00