[BUG] Broken build with 0.16.3
Describe the bug
To Reproduce Create new bin and add [dependencies] cursive = "0.16.3"
error[E0310]: the parameter type F may not live long enough
-->/.cargo/registry/src/github.com-1ecc6299db9ec823/cursive_core-0.2.2/src/cursive.rs:650:19
|
645 | pub fn set_on_post_event<F, E>(&mut self, trigger: E, cb: F)
| - help: consider adding an explicit lifetime bound...: F: 'static
...
650 | self.root.set_on_event(trigger, crate::immut1!(cb));
| ^^^^^^^^^^^^ ...so that the type [closure@/.cargo/registry/src/github.com-1ecc6299db9ec823/cursive_core-0.2.2/src/utils/immutify.rs:87:9: 92:10] will meet its required lifetime bounds
Environment
- Ubuntu
- Backend used: ncurses (the default one),
- Current locale en_US
- Cursive version (from crates.io)
Hi, and thanks for the report!
I can't quite reproduce the issue on the latest branch.
- What version of rust are you using?
- Does the issue still happen with the latest git version?
Hi and thank you for the reply. Rust ver 1.57 There seems to be some problem with cursive_core 0.2.2
Compiling cursive_core v0.2.2
error[E0310]: the parameter type F may not live long enough
--> .cargo/registry/src/github.com-1ecc6299db9ec823/cursive_core-0.2.2/src/cursive.rs:650:19
|
645 | pub fn set_on_post_event<F, E>(&mut self, trigger: E, cb: F)
| - help: consider adding an explicit lifetime bound...: F: 'static
...
650 | self.root.set_on_event(trigger, crate::immut1!(cb));
| ^^^^^^^^^^^^ ...so that the type [[email protected]/registry/src/github.com-1ecc6299db9ec823/cursive_core-0.2.2/src/utils/immutify.rs:87:9: 92:10] will meet its required lifetime bounds
What is strange though that it all was working. I was working on some functionality in my app and after I manage to do it, I did cargo clean, and cargo build and from then on it shows those messages.
Update: I fixed it by: removing entries referencing cursive* in: cargo/registry/src/ and cargo/registry/cache then cargo update and cargo build. Works now. Thanks for the prompt response. Btw, it would be interesting to know why that happened.