You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 23, 2024. It is now read-only.
=== stdout ===
=== stderr ===
error[E0373]: closure may outlive the current function, but it borrows `path`, which is owned by the current function
--> /home/runner/work/glacier/glacier/ices/93242-2.rs:2:5
|
2 | || match path {
| ^^ ---- `path` is borrowed here
| |
| may outlive borrowed value `path`
|
note: closure is returned here
--> /home/runner/work/glacier/glacier/ices/93242-2.rs:2:5
|
2 | / || match path {
3 | | [] => 0,
4 | | _ => 1,
5 | | }
| |_____^
help: to force the closure to take ownership of `path` (and any other referenced variables), use the `move` keyword
|
2 | move || match path {
| ++++
error[E0700]: hidden type for `impl Fn() -> usize` captures lifetime that does not appear in bounds
--> /home/runner/work/glacier/glacier/ices/93242-2.rs:2:5
|
1 | pub fn something(path: &[usize]) -> impl Fn() -> usize {
| -------- ------------------ opaque type defined here
| |
| hidden type `[closure@/home/runner/work/glacier/glacier/ices/93242-2.rs:2:5: 2:7]` captures the anonymous lifetime defined here
2 | / || match path {
3 | | [] => 0,
4 | | _ => 1,
5 | | }
| |_____^
|
help: to declare that `impl Fn() -> usize` captures `'_`, you can add an explicit `'_` lifetime bound
|
1 | pub fn something(path: &[usize]) -> impl Fn() -> usize + '_ {
| ++++
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0373, E0700.
For more information about an error, try `rustc --explain E0373`.
==============
0 commit comments