fork/rust
git clone https://git.julia.blue/fork/rust
f3e1a954d2e
1.41.1
1error[E0621]: explicit lifetime required in the type of `x` 2 --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:5 3 | 4LL | fn foo(x: &()) { 5 | --- help: add explicit lifetime `'static` to the type of `x`: `&'static ()` 6LL | / bar(|| { 7LL | | 8LL | | let _ = x; 9LL | | }) 10 | |______^ lifetime `'static` required 11 12error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function 13 --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:9 14 | 15LL | bar(|| { 16 | ^^ may outlive borrowed value `x` 17LL | 18LL | let _ = x; 19 | - `x` is borrowed here 20 | 21note: function requires argument type to outlive `'static` 22 --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:5:5 23 | 24LL | / bar(|| { 25LL | | 26LL | | let _ = x; 27LL | | }) 28 | |______^ 29help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword 30 | 31LL | bar(move || { 32 | ^^^^^^^ 33 34error: aborting due to 2 previous errors 35 36Some errors have detailed explanations: E0373, E0621. 37For more information about an error, try `rustc --explain E0373`.