#Trait bound not satisfied

16 messages · Page 1 of 1 (latest)

shut mauve
#

-errors

slow stirrupBOT
#

If you're getting large or confusing errors please post the full error message from cargo check in a code block instead of the errors in your IDE so that we can understand your problem better:

```rust
// error from cargo check here
```

shut mauve
#

you need to constrain <A as App>::Message to be Message

#
where
  A: App<Message = Message>
#

don't assign closures to variables

#

?play ```rs
let x = |x: &_| x;
x(&42);

vale furnaceBOT
#
error: lifetime may not live long enough
 --> src/main.rs:2:17
  |
2 | let x = |x: &_| x;
  |             - - ^ returning this value requires that `'1` must outlive `'2`
  |             | |
  |             | return type of closure is &'2 i32
  |             let's call the lifetime of this reference `'1````
shut mauve
#

the lifetimes aren't inferred as you may expect

#

what is the signature of header_bar and set_header?

#

its the impl Widget<Message> + 'static

#

the 'static in particular

#

fn header_bar(&self) -> impl Widget<Self::Message>; needs it then also

#

fn header_bar(&self) -> impl Widget<Self::Message> + 'static;

#

whats the error?

#

this is part of a trait right? (header_bar)

#

you need to add the + 'static to every impl