Commit Graph

21219 Commits

Author SHA1 Message Date
Matthias Krüger
f6caa5f68f Rollup merge of #147469 - Jamesbarford:fix/crate-error-message, r=GuillaumeGomez
Add rustdoc crate name in error

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

I'm not entirely sure if what I am doing with the span is correct
2025-10-08 15:39:28 +02:00
Matthias Krüger
193a28d9b4 Rollup merge of #144006 - dianne:match-ergonomics-jargon, r=Nadrieril
clarify wording of match ergonomics diagnostics (`rust_2024_incompatible_pat` lint and error)

Partially addresses rust-lang/rust#143557:
- Uses different wording than the Edition Guide chapter, to hopefully stand alone a bit better. Instead of referring to the "default binding mode", it now talks about what can't be written "within elided reference patterns". I ended up going with "elided" instead of "implicit" in hope that it reads bit less like it should behave the same as an explicit reference pattern, but I'm not totally happy with that wording.
- The explanatory note still points to where the default binding mode was introduced, but only refers to its effect, not what we call it. How that relates to the rest of the diagnostic may still be a bit of a puzzle, but hopefully it isn't too much of one? It also doesn't make sense anymore for the case of `&` written under a by-ref binding mode, so I've left the note out in that case (but kept the label). It's more cramped, but talking about binding modes would feel like a non-sequitur for the error about `&` patterns without further explanation.
- Links to the stable version of the Edition Guide instead of the nightly version. It looks like almost every link to the Edition Guide in diagnostics is to the nightly version, presumably for the same reason as here: the diagnostics were added before the new Edition was stabilized, then never updated. I'll make a separate PR to clean up the others.

This only changes the diagnostic messages, not the code suggestion or the Edition Guide.

r? `@Nadrieril` or reassign
2025-10-08 15:39:25 +02:00
James Barford-Evans
2c1e796ed0 Improve missing create level error message 2025-10-08 11:35:20 +01:00
dianne
ec99e3eca2 clarify wording of match ergonomics diagnostics 2025-10-08 02:12:24 -07:00
Jana Dönszelmann
cf63f1578c Rollup merge of #147451 - RalfJung:extra-const-ice, r=chenyukang
fix panic with extra-const-ub-checks

Fixes https://github.com/rust-lang/rust/issues/147306
2025-10-08 10:06:58 +02:00
Jana Dönszelmann
4f24b61c33 Rollup merge of #147445 - jdonszelmann:sort-targets, r=JonathanBrouwer
sort attribute targets for more consistent error messages

In this PR I noticed that we don't sort attribute targets, so a rather trivial change to the source changed the ordering in an error message even though its meaning stayed the same.

See: https://github.com/rust-lang/rust/pull/147418#discussion_r2410852750

I think sorting might be a good thing to do in general. I also prefer it when reading error messages. Quite a few tests changed, but not in meaning, only sorting order obviously.

r? `@jieyouxu`
2025-10-08 10:06:56 +02:00
Jana Dönszelmann
27b3881df8 Rollup merge of #147390 - ZuseZ4:autodiff-dbg, r=jieyouxu
Use globals instead of metadata for std::autodiff

LLVM's Metadata is quite fragile. In debug builds we use incremental compilation, which caused the metadata to be dropped. With this change we use named globals instead of metadata to instruct Enzyme how to differentiate functions.
Globals are proper llvm values and thus can't be dropped. Also added an incremental/dbg test which now passes, to unblock the EnzymeAD CI which wants to run Rust autodiff tests.

r? compiler
2025-10-08 10:06:55 +02:00
Jana Dönszelmann
291e12937b Rollup merge of #146385 - notriddle:no-anim, r=GuillaumeGomez
rustdoc-search: redesign throbber to be less distracting

Preview: https://notriddle.com/rustdoc-html-demo-12/throbber/std/index.html

<img width="1920" height="182" alt="image" src="https://github.com/user-attachments/assets/da838ee0-3f7a-4b10-ba92-f9ac52e9f723" />

<img width="1920" height="182" alt="image" src="https://github.com/user-attachments/assets/b5a59fc0-5d07-4981-b1dd-0b60556a0dd5" />

<img width="1920" height="182" alt="image" src="https://github.com/user-attachments/assets/bb587660-7b6c-40e1-a7ae-2270d530dcd4" />

Complaints about it being distracting, and causing people to wait until all of the results are loaded instead of using the incremental results as they come in, make me think it was a bad idea to put it in the tab.

Part of https://github.com/rust-lang/rust/issues/146048
2025-10-08 10:06:54 +02:00
Jana Dönszelmann
1dbe831e47 sort attribute targets for more consistent error messages 2025-10-08 08:32:03 +02:00
Manuel Drehwald
218fa60795 update ui test since the new frontend is a bit more lenient 2025-10-07 20:13:59 -04:00
Manuel Drehwald
dcc36a8642 add incremental/debug test for autodiff 2025-10-07 20:13:56 -04:00
bors
4fd3181552 Auto merge of #147111 - BoxyUwU:rename_obligation_processing_apis, r=lcnr
rename `select_where_possible` and `select_all_or_error`

r? `@lcnr`

I find that people get confused by what these methods do. The verb "select" is not really that helpful and is just a reference to somewhat of an implementation detail of the trait solvers that doesn't even apply to most obligation kinds.

I went with `try_evaluate_obligations` and  `evaluate_obligations_error_on_ambiguity`. This maintains consistency with the new solvers `evalute_goal` entry point. it's unfortunate that we say obligations rather than goals but this maintains consistency with `register_obligation` functions which I think is a good thing. In the long term possibly we rename `Obligation` or `Goal` 🤷‍♀️
2025-10-07 23:57:38 +00:00
Boxy Uwu
8e9b0c4ca9 rename select_where_possible and select_all_or_error 2025-10-07 23:02:23 +01:00
bors
f6aa851dba Auto merge of #147453 - matthiaskrgr:rollup-z3db8zi, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#146865 (kcfi: only reify trait methods when dyn-compatible)
 - rust-lang/rust#147205 (Add a new `wasm32-wasip3` target to Rust)
 - rust-lang/rust#147322 (cg_llvm: Consistently import `llvm::Type` and `llvm::Value`)
 - rust-lang/rust#147398 (Fix; correct placement of type inference error for method calls)
 - rust-lang/rust#147410 (Update `S-waiting-on-team` refs to new `S-waiting-on-{team}` labels)
 - rust-lang/rust#147422 (collect-license-metadata: Print a diff of the expected output)
 - rust-lang/rust#147431 (compiletest: Read the whole test file before parsing directives)
 - rust-lang/rust#147433 (Fix doc comment)

Failed merges:

 - rust-lang/rust#147390 (Use globals instead of metadata for std::autodiff)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-07 20:47:13 +00:00
Michael Howell
c9293bfdae rustdoc-search: add test case for throbber 2025-10-07 12:59:58 -07:00
Matthias Krüger
0174900c5d Rollup merge of #147398 - Jamesbarford:fix/method-call-type-inference-error, r=chenyukang
Fix; correct placement of type inference error for method calls

Addresses a FIXME for displaying errors on method calls;

Before;
```
error[E0282]: type annotations needed
  --> /<location>/src/main.rs:48:15
   |
## |             e.is_conversion_error();
   |               ^^^^^^^^^^^^^^^^^^^ cannot infer type
```

After;

```
error[E0282]: type annotations needed
  --> /<location>/src/main.rs:48:15
   |
## |             e.is_conversion_error();
   |             ^ cannot infer type
```
2025-10-07 19:39:08 +02:00
Matthias Krüger
60bbb533df Rollup merge of #147205 - alexcrichton:wasip3, r=davidtwco
Add a new `wasm32-wasip3` target to Rust

This commit adds a new tier 3 target to rustc, `wasm32-wasip3`. This follows in the footsteps of the previous `wasm32-wasip2` target and is used to represent binding to the WASIp3 set of APIs managed by the WASI subgroup to the WebAssembly Community Group.

As of now the WASIp3 set of APIs are not finalized nor standardized. They're in the process of doing so and the current trajectory is to have the APIs published in December of this year. The goal here is to get the wheels turning in Rust to have the target in a
more-ready-than-nonexistent state by the time this happens in December.

For now the `wasm32-wasip3` target looks exactly the same as `wasm32-wasip2` except that `target_env = "p3"` is specified. This indicates to crates in the ecosystem that WASIp3 APIs should be used, such as the [`wasip3` crate]. Over time this target will evolve as implementation in guest toolchains progress, notably:

* The standard library will use WASIp3 APIs natively once they're finalized in the WASI subgroup.
* Support through `wasi-libc` will be updated to use WASIp3 natively which Rust will then transitively use.
* Longer-term, features such as cooperative multithreading will be added to the WASIp3-track of targets to enable using `std::thread`, for example, on this target.

These changes are all expected to be non-breaking changes for users of this target. Runtimes supporting WASIp3, currently Wasmtime and Jco, support WASIp2 APIs as well and will work with components whether or not they import WASIp2, both WASIp2 and WASIp3, or just WASIp3 APIs. This means that changing the internal implementation details of libstd over time is expected to be a non-breaking change.

[`wasip3` crate]: https://crates.io/crates/wasip3
2025-10-07 19:39:07 +02:00
Matthias Krüger
ffba05ee29 Rollup merge of #146865 - folkertdev:kcfi-only-reify-dyn-compatible, r=rcvalle
kcfi: only reify trait methods when dyn-compatible

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

Only generate a `ReifyShim` for trait method calls if the trait is dyn-compatible.

Until now kcfi would generate a `ReifyShim` whenever a trait method was cast to a function pointer. But technically the shim is only needed for dyn-compatible traits (where the method might end up in a vtable).

Up to this point that was only slightly inefficient, but in combination with c-variadic trait methods it is wrong. For c-variadic trait methods the generated shim is incorrect, and that is why c-variadic methods make a trait no longer dyn-compatible: we should simply never generate a `ReifyShim` that is c-variadic.

With this change the documentation on `ReifyReason` is now actually correct:

>  If KCFI is enabled, creating a function pointer from a method on a dyn-compatible trait. This includes the case of converting `::call`-like methods on closure-likes to function pointers.

cc ```@maurer``` ```@workingjubilee```

r? ```@rcvalle```
2025-10-07 19:39:06 +02:00
bors
d62f33a7c6 Auto merge of #147449 - matthiaskrgr:rollup-njyi5yr, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#145943 (stdlib docs: document lifetime extension for `format_args!`'s arguments)
 - rust-lang/rust#147243 (cmse: disallow `impl Trait` in `cmse-nonsecure-entry` return types)
 - rust-lang/rust#147402 ([rustdoc] Don't serialize & deserialize data that doesn't go OTW)
 - rust-lang/rust#147418 (Fix target list of `link_section`)
 - rust-lang/rust#147429 (Print tip for human error format in runtest)
 - rust-lang/rust#147441 (Fix comments error for Provenance impls)
 - rust-lang/rust#147442 (c-variadic: fix thir-print for `...` without a pattern)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-07 17:37:56 +00:00
Ralf Jung
8171174715 fix panic with extra-const-ub-checks 2025-10-07 19:16:58 +02:00
Matthias Krüger
5f03328084 Rollup merge of #147442 - folkertdev:thir-print-c-variadic, r=fmease
c-variadic: fix thir-print for `...` without a pattern

tracking issue: https://github.com/rust-lang/rust/issues/44930
fixes https://github.com/rust-lang/rust/issues/147409

r? `@fmease`
2025-10-07 17:42:15 +02:00
Matthias Krüger
0072d0cd1c Rollup merge of #147418 - JonathanBrouwer:link_section_targets, r=jdonszelmann
Fix target list of `link_section`

Fixes https://github.com/rust-lang/rust/issues/147411#event-20124673569

r? `@jdonszelmann`
`@rustbot` beta-nominate T-compiler
2025-10-07 17:42:13 +02:00
Matthias Krüger
7ab1fd1816 Rollup merge of #147243 - folkertdev:cmse-bail-impl-trait, r=davidtwco
cmse: disallow `impl Trait` in `cmse-nonsecure-entry` return types

tracking issue: https://github.com/rust-lang/rust/issues/75835
fixes https://github.com/rust-lang/rust/issues/147242

Refactors some logic to be more robust in the future, and then disallows `impl Trait` as a return type for the cmse ABIs.

The `is_valid_cmse_output_layout` function disallows `union` values like before. That is not entirely correct, but preserves the current behavior. Some additional logic is needed for `union` values (and any types where parts may be uninitialized) that I'll tackle in a later PR.

can be reviewed commit-by-commit.

r? types
2025-10-07 17:42:11 +02:00
Folkert de Vries
fbdc685ed0 cmse: disallow impl Trait in cmse-nonsecure-entry return types 2025-10-07 17:31:08 +02:00
bors
fed46ffd50 Auto merge of #145608 - Darksonn:derefmut-pin-fix, r=lcnr
Prevent downstream `impl DerefMut for Pin<LocalType>`

The safety requirements for [`PinCoerceUnsized`](https://doc.rust-lang.org/stable/std/pin/trait.PinCoerceUnsized.html) are essentially that the type does not have a malicious `Deref` or `DerefMut` impl. However, the `Pin` type is fundamental, so the end-user can provide their own implementation of `DerefMut` for `Pin<&SomeLocalType>`, so it's possible for `Pin` to have a malicious `DerefMut` impl. This unsoundness is known as rust-lang/rust#85099.

Unfortunately, this means that the implementation of `PinCoerceUnsized` for `Pin` is currently unsound. To fix that, modify the impl so that it becomes impossible for downstream crates to provide their own implementation of `DerefMut` for `Pin` by abusing a hidden struct that is not fundamental.

This PR is a breaking change, but it fixes rust-lang/rust#85099. The PR supersedes rust-lang/rust#144896.

r? lcnr
2025-10-07 14:26:48 +00:00
Folkert de Vries
0a3f1d5b98 c-variadic: fix thir-print for ... without a pattern 2025-10-07 16:00:39 +02:00
James Barford-Evans
43f7eaa0ba Fix; correct placement of type inference error for method calls 2025-10-07 09:51:16 +01:00
Jonathan Brouwer
1589c6c12d Add regression test for link_section targets 2025-10-07 09:40:27 +02:00
Matthias Krüger
21bf6db483 Rollup merge of #147413 - karolzwolak:extern-multiple-quotes, r=fmease
don't panic on extern with just multiple quotes in the name

Continues rust-lang/rust#147377.
That PR fixed ICE when the extern name was a single quote `"'"`, but multiple quotes like `"''"` cause the same problem.
I had a random revelation that the trimming can remove more than one quote.
r? ``@nnethercote``
2025-10-07 07:04:20 +02:00
Matthias Krüger
6332a76b3d Rollup merge of #147395 - reddevilmidzy:refact-error-msg, r=Kivooeo,jackh726
Improve diagnostics: update note and add help message

I moved the content from the note to a help message, as it seemed more appropriate there, and then added new information to the note(`Modules are usually placed outside of blocks, at the top level of the file`)!

resolve: rust-lang/rust#147314
2025-10-07 07:04:18 +02:00
Matthias Krüger
f64703ce7a Rollup merge of #147354 - chenyukang:yukang-fix-147070-wrong-highlight-span, r=estebank
Fix wrong span for hightlight for duplicated diff lines

Fixes rust-lang/rust#147070

From comments: https://github.com/rust-lang/rust/issues/147070#issuecomment-3368593144
The lightlight row for diff must at least 2.

r? `@estebank`
2025-10-07 07:04:17 +02:00
Matthias Krüger
4209a4661a Rollup merge of #147165 - Muscraft:subtract-code-offset, r=davidtwco
test: Subtract code_offset from width for ui_testing

`annotate-snippets` does not have a "UI test" mode like `rustc`, [where the code offset is not subtracted from the column width](f34ba774c7/compiler/rustc_errors/src/emitter.rs (L1985-L1987)). This makes it so `annotate-snippets` will shift the output for some very long tests 5 - 7 columns to the left. As part of my work to have `rustc` use `annotate-snippets`, and to reduce the test differences between the two, I figured it would be best if `rustc` started subtracting the code offset from the width as well.

The first commit exists to keep the test output changes of adding a new line to a test separate from adding the `--diagnostic-width` flag in the second commit. This makes it easier to verify that adding the flag does not affect the test's output.

[Zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/147480-t-compiler.2Fdiagnostics/topic/annotate-snippets.20hurdles)
2025-10-07 07:04:17 +02:00
Matthias Krüger
0bf117f481 Rollup merge of #145495 - fee1-dead-contrib:push-tynlnktvrmrx, r=Zalathar
Use declarative macro for `#[derive(TryFromU32)]`

cc ``@Zalathar``
2025-10-07 07:04:16 +02:00
yukang
231c39545e Fix wrong span for hightlight for duplicated diff lines 2025-10-07 02:45:11 +00:00
Jonathan Brouwer
4787834eda Fix target list of link_section
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-10-06 23:04:09 +02:00
Karol Zwolak
cb06d91cd0 don't panic on extern with just multiple quotes in the name 2025-10-06 22:12:51 +02:00
Camille Gillot
96c3978eaa Repurpose defunct test. 2025-10-06 19:32:32 +00:00
Camille Gillot
5407eb8ca2 GVN: Support unions. 2025-10-06 19:31:40 +00:00
reddevilmidzy
02126adc1b Improve diagnostics: replace 'non-inline module' with 'file module' and update note/help messages 2025-10-07 02:53:45 +09:00
bors
3d8c1c1fc0 Auto merge of #144477 - cjgillot:gvn-index, r=dianqk
GVN: Use a VnIndex in Address projection.

The current implementation of address projections is inconsistent. Indexing semantically relies on the index' value, but the implementation uses the index' place. This PR fixes that by using `ProjectionElem<VnIndex, Ty<'tcx>>` instead of the raw `PlaceElem<'tcx>`.

This is a more principled fix than the workaround in https://github.com/rust-lang/rust/pull/145030.
2025-10-06 15:33:17 +00:00
Deadbeef
696b6ac14d use declarative macro for #[derive(TryFromU32)] 2025-10-06 14:54:38 +00: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
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
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
Alice Ryhl
76dcb39c24 Adjust error messages 2025-10-05 17:45:27 +00:00
Alice Ryhl
7e1c00dbce Prevent downstream impl DerefMut for Pin<LocalType> 2025-10-05 17:45:24 +00:00