```
error[E0716]: temporary value dropped while borrowed
--> $DIR/multiple-sources-for-outlives-requirement.rs:5:38
|
LL | fn foo<'b>() {
| -- lifetime `'b` defined here
LL | outlives_indir::<'_, 'b, _>(&mut 1u32);
| ---------------------------------^^^^-- temporary value is freed at the end of this statement
| | |
| | creates a temporary value which is freed while still in use
| argument requires that borrow lasts for `'b`
|
note: requirements that the value outlives `'b` introduced here
--> $DIR/multiple-sources-for-outlives-requirement.rs:1:23
|
LL | fn outlives_indir<'a: 'b, 'b, T: 'a>(_x: T) {}
| ^^ ^^
```
11 lines
483 B
Rust
11 lines
483 B
Rust
fn outlives_indir<'a: 'b, 'b, T: 'a>(_x: T) {}
|
|
//~^ NOTE: requirements that the value outlives `'b` introduced here
|
|
|
|
fn foo<'b>() { //~ NOTE: lifetime `'b` defined here
|
|
outlives_indir::<'_, 'b, _>(&mut 1u32); //~ ERROR: temporary value dropped while borrowed
|
|
//~^ NOTE: argument requires that borrow lasts for `'b`
|
|
//~| NOTE: creates a temporary value which is freed while still in use
|
|
//~| NOTE: temporary value is freed at the end of this statement
|
|
}
|
|
|
|
fn main() {}
|