diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2025-09-30 22:25:16 +1000 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-30 22:25:16 +1000 | 
| commit | 1aa426b335ba4b7414deea34e6ecf628469fd98f (patch) | |
| tree | 3943729aaafd5ef3f2a8c13d2d208d741fe60b14 /compiler/rustc_resolve/src/ident.rs | |
| parent | 97e2d3c5797d251700da8cd793124c5920fef8e5 (diff) | |
| parent | c5313fed76a99942edb4c7f94607fa3d2d6da21c (diff) | |
| download | rust-1aa426b335ba4b7414deea34e6ecf628469fd98f.tar.gz rust-1aa426b335ba4b7414deea34e6ecf628469fd98f.zip | |
Rollup merge of #146011 - estebank:lifetime-obligation-span, r=lcnr
Point at fn bound that introduced lifetime obligation
The last note is new
```
error[E0597]: `c` does not live long enough
  --> $DIR/without-precise-captures-we-are-powerless.rs:19:20
   |
LL | fn simple<'a>(x: &'a i32) {
   |           -- lifetime `'a` defined here
...
LL |     let c = async move || { println!("{}", *x); };
   |         - binding `c` declared here
LL |     outlives::<'a>(c());
   |     ---------------^---
   |     |              |
   |     |              borrowed value does not live long enough
   |     argument requires that `c` is borrowed for `'a`
LL |     outlives::<'a>(call_once(c));
LL | }
   | - `c` dropped here while still borrowed
   |
note: requirement that `c` is borrowed for `'a` introduced here
  --> $DIR/without-precise-captures-we-are-powerless.rs:7:33
   |
LL | fn outlives<'a>(_: impl Sized + 'a) {}
   |                                 ^^
```
When encountering a `ConstraintCategory::Predicate` in a funtion call, point at the `Span` for that `Predicate` to explain where the lifetime obligation originates from.
CC rust-lang/rust#55307.
Diffstat (limited to 'compiler/rustc_resolve/src/ident.rs')
0 files changed, 0 insertions, 0 deletions
