These are chat archives for rust-lang/rust

Jun 2017
Edouard Menayde
Jun 05 2017 20:15

Hi there,
I'm pretty new with rust and got this code :
I get this error :

error[E0477]: the type `[closure@src/ 114:4 application:&'a Application]` does not fulfill the required lifetime
   --> src/
104 |   scale.connect_change_value(move |scale, _, value| {
    |         ^^^^^^^^^^^^^^^^^^^^
    = note: type must outlive the static lifetime

error: aborting due to previous error

error: Could not compile `keyboard-controller`.

My understanding is that the compiler thinks the referene will die before the closure ends and thus big problem will arise. But the fact is that gtk::main() calls an endless loop and closure where application is passed are gonna die before gtk::main does.