yewstack/yew_router

minimal example fails to build

amatuni opened this issue · 7 comments

Describe the Bug

compilation fails for the minimal example

To Reproduce

using minimal example in examples folder

Expected Behavior

Related Info

  • rustc version: 1.41.0 nightly
  • Browsers versions
  • yew version: master
  • yew-router version: master
  • cargo-web version, or other build toolchain:

rustc output

   Compiling yew-router v0.8.0 (https://github.com/yewstack/yew_router#c322c51e)
error[E0277]: the trait bound `components::Props<SW>: std::clone::Clone` is not satisfied
  --> /Users/andrei/.cargo/git/checkouts/yew_router-d74866f8084a5a4f/c322c51/src/components/router_button.rs:23:5
   |
21 | impl<SW: Switch + Clone + 'static, STATE: RouterState> Component for RouterButton<SW, STATE> {
   | -------------------------------------------------------------------------------------------- in this `impl` item
22 |     type Message = Msg;
23 |     type Properties = Props<SW>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `components::Props<SW>`

error[E0277]: the trait bound `components::Props<SW>: std::clone::Clone` is not satisfied
  --> /Users/andrei/.cargo/git/checkouts/yew_router-d74866f8084a5a4f/c322c51/src/components/router_link.rs:29:5
   |
27 | impl<SW: Switch + Clone + 'static, STATE: RouterState> Component for RouterAnchor<SW, STATE> {
   | -------------------------------------------------------------------------------------------- in this `impl` item
28 |     type Message = Msg;
29 |     type Properties = Props<SW>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `components::Props<SW>`

error[E0277]: the trait bound `components::Props<SW>: std::clone::Clone` is not satisfied
  --> /Users/andrei/.cargo/git/checkouts/yew_router-d74866f8084a5a4f/c322c51/src/components/mod.rs:18:10
   |
18 | #[derive(Properties, Default, Debug)]
   |          ^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `components::Props<SW>`
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0277`.
error: could not compile `yew-router`.

To learn more, run the command again with --verbose.
error: build failed

Hey, I can't reproduce this problem. But I could reproduce another one. I'd assume that multiple breaking changes to Yew last night are responsible.

Edit: I can reproduce this problem, but not in the minimal example. The minimal example should prevent the erroneous code from being attempted to be compiled. The router_component example produces this exact error message though.

I'll have a PR open to fix this and other problems real soon.
When that is merged, can you run cargo update and try again?

Some tertiary breaking changes within Yew are delaying progress, but work can be observed here: #217

Cool sounds good, I'll retry after those updates are merged

jetli commented

@hgzimmerman Any plan for a new release of yew_router regarding to yew 0.11 release? There are many breaking changes of yew 0.11, it's hard for me to upgrade when I'm using yew_router too.
Thanks.

Working on it tonight.

v0.8.0 has been released.

jetli commented

Hooray 🎉
Thanks.