cursive icon indicating copy to clipboard operation
cursive copied to clipboard

[BUG] Broken build with 0.16.3

Open smallB007 opened this issue 4 years ago • 3 comments

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)

smallB007 avatar Dec 25 '21 13:12 smallB007

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?

gyscos avatar Dec 25 '21 17:12 gyscos

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.

smallB007 avatar Dec 25 '21 18:12 smallB007

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.

smallB007 avatar Dec 25 '21 18:12 smallB007