1 error[E0621]: explicit lifetime required in the type of `x`
2 --> $DIR/must_outlive_least_region_or_bound.rs:13:35
4 LL | fn elided(x: &i32) -> impl Copy { x }
5 | ---- ^ lifetime `'static` required
7 | help: add explicit lifetime `'static` to the type of `x`: `&'static i32`
9 error: unsatisfied lifetime constraints
10 --> $DIR/must_outlive_least_region_or_bound.rs:16:44
12 LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
13 | -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static`
14 help: to allow this impl Trait to capture borrowed data with lifetime `'a`, add `'a` as a constraint
16 LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
19 error: unsatisfied lifetime constraints
20 --> $DIR/must_outlive_least_region_or_bound.rs:22:69
22 LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
23 | -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static`
25 = help: consider replacing `'a` with `'static`
27 error: unsatisfied lifetime constraints
28 --> $DIR/must_outlive_least_region_or_bound.rs:29:5
30 LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) {
31 | -- -- lifetime `'b` defined here
33 | lifetime `'a` defined here
34 LL | //~^ ERROR lifetime mismatch
35 LL | move |_| println!("{}", y)
36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
38 error[E0310]: the parameter type `T` may not live long enough
39 --> $DIR/must_outlive_least_region_or_bound.rs:32:51
41 LL | fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static {
42 | ^^^^^^^^^^^^^^^^^^^^
44 = help: consider adding an explicit lifetime bound `T: 'static`...
46 error: aborting due to 5 previous errors
48 Some errors occurred: E0310, E0621.
49 For more information about an error, try `rustc --explain E0310`.