1 error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
2 --> $DIR/region-borrow-params-issue-29793-big.rs:71:26
4 LL | WrapB::new().set(|t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`)
5 | ^^^^^^^^^ - `x` is borrowed here
7 | may outlive borrowed value `x`
9 note: closure is returned here
10 --> $DIR/region-borrow-params-issue-29793-big.rs:71:9
12 LL | WrapB::new().set(|t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`)
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
16 LL | WrapB::new().set(move |t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`)
19 error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
20 --> $DIR/region-borrow-params-issue-29793-big.rs:71:26
22 LL | WrapB::new().set(|t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`)
23 | ^^^^^^^^^ - `y` is borrowed here
25 | may outlive borrowed value `y`
27 note: closure is returned here
28 --> $DIR/region-borrow-params-issue-29793-big.rs:71:9
30 LL | WrapB::new().set(|t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`)
31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32 help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
34 LL | WrapB::new().set(move |t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`)
37 error: aborting due to 2 previous errors
39 For more information about this error, try `rustc --explain E0373`.