Files
rust/tests/ui/coroutine
Esteban Küber e478abb612 Point at 'static obligations from an fn being called
Add this note to lifetime errors:

```text
error[E0521]: borrowed data escapes outside of function
  --> $DIR/static-impl-obligation.rs:163:9
   |
LL |     fn bar<'a>(x: &'a &'a u32) {
   |            --  - `x` is a reference that is only valid in the function body
   |            |
   |            lifetime `'a` defined here
LL |         let y: &dyn Foo = x;
LL |         y.hello();
   |         ^^^^^^^^^
   |         |
   |         `x` escapes the function body here
   |         argument requires that `'a` must outlive `'static`
   |
note: `'static` requirement for `<(dyn o::Foo + 'static)>::hello` introduced here
  --> $DIR/static-impl-obligation.rs:158:40
   |
LL |     impl dyn Foo + 'static where Self: 'static {
   |                                        ^^^^^^^ `'static` requirement introduced here
LL |         fn hello(&'static self) where Self: 'static {}
   |                                             ^^^^^^^ `'static` requirement introduced here
```

This currently only accounts for explicit bounds, other obligations like those arising from `Self` in a `impl dyn Trait {}` or from the receiver in `fn foo(&'static self)` are not accounted for.
2026-09-21 16:44:19 +00:00
..
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-11-27 11:19:00 -05:00
2025-04-23 15:09:25 +00:00
2025-06-03 10:52:32 -07:00
2025-06-03 10:52:32 -07:00
2025-09-24 15:02:41 +02:00
2025-11-27 14:13:58 -05:00
2025-11-27 14:13:58 -05:00
2026-02-12 15:12:29 +08:00
2025-08-14 18:18:42 +02:00
2025-04-15 11:14:23 +02:00
…
2026-02-09 15:09:43 +08:00
2026-03-04 08:06:45 +08:00