diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2025-08-29 19:35:22 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2025-09-28 20:55:34 +0000 |
| commit | c3e0b29e79f347edf7e0ae559bfec2d3cdf353d8 (patch) | |
| tree | 17602e01520f280c7c076e8a996dccbc902cacd3 /compiler/rustc_parse/src | |
| parent | 8d72d3e1e96f58ca10059a6bb6e8aecba4a0e9cd (diff) | |
| download | rust-c3e0b29e79f347edf7e0ae559bfec2d3cdf353d8.tar.gz rust-c3e0b29e79f347edf7e0ae559bfec2d3cdf353d8.zip | |
Point at fn bound that introduced lifetime obligation
```
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.
Diffstat (limited to 'compiler/rustc_parse/src')
0 files changed, 0 insertions, 0 deletions
