Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 6673b42

Browse files
committed
ices/93242-2.rs: fixed with errors
=== 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`. ==============
1 parent 53fb14d commit 6673b42

File tree

1 file changed

+0
-0
lines changed

1 file changed

+0
-0
lines changed
File renamed without changes.

0 commit comments

Comments
 (0)