Files
rust/tests/ui/async-await
Jonathan Brouwer 91eefd7a9e Rollup merge of #156226 - shivendra02467:fix-diagnostic-155880, r=lcnr
diagnostics: point to coroutine body on higher-ranked auto trait errors

Fixes rust-lang/rust#155880

When encountering a higher-ranked auto trait bound error involving a coroutine or async function,the trait solver previously used the span of the outermost cause (eg. `spawn(...)` or `is_send(...)`).

This PR modifies the `TraitPlaceholderMismatch` formatting logic to walk down the `ObligationCauseCode` chain.If the obligation originates from a `ty::Coroutine` or `ty::CoroutineWitness`, it extracts that specific span, providing a much more accurate underline for the user.

#### Before:
```text
error: implementation of `Send` is not general enough
  --> src/main.rs:25:5
   |
25 |     is_send(outer())
   |     ^^^^^^^^^^^^^^^^ implementation of `Send` is not general enough
```

#### After:
```text
error: implementation of `Send` is not general enough
  --> src/main.rs:13:74
   |
13 |   async fn inner<'a, T: Trait + 'a>(_: T, x: T::Assoc<'a>) -> T::Assoc<'a> {
   |  __________________________________________________________________________^
14 | |     std::future::ready(x).await
15 | | }
   | |_^ implementation of `Send` is not general enough
```
2026-06-16 22:11:06 +02:00
..
2026-06-09 11:24:07 +00:00
2025-12-10 15:15:56 +01:00
2026-06-04 08:10:27 +00:00
2025-08-20 11:10:38 +02:00
2024-12-13 00:04:56 +00:00
2024-12-13 00:04:56 +00:00
2024-10-12 06:14:46 -04:00
2024-10-12 06:14:46 -04:00
2024-12-05 14:14:17 -08:00
2024-12-05 14:14:17 -08:00
2026-02-09 15:09:43 +08:00
2026-02-09 15:09:43 +08:00
2026-02-09 15:09:43 +08:00
2026-02-09 15:09:43 +08:00
2025-08-20 11:10:38 +02:00
2025-08-20 11:10:38 +02:00
…
2025-04-03 21:41:58 +00:00