mitchmindtree / rose_tree-rs

An implementation of the "rose tree" data structure for Rust.
Apache License 2.0
24 stars 6 forks source link

Build issues #3

Closed FintanH closed 4 years ago

FintanH commented 4 years ago

Hey :wave: I'm looking to use your crate to model an issue tracker and I'm pretty sure rose trees are exactly what I need :grin:

Unfortunately, when I try to build the project I'm getting an error:

[nix-shell:~/Developer/rose_tree-rs]$ cargo build
    Updating crates.io index
   Compiling fixedbitset v0.1.9
   Compiling petgraph v0.1.18
error[E0034]: multiple applicable items in scope
   --> /home/haptop/.cargo/registry/src/github.com-1ecc6299db9ec823/petgraph-0.1.18/src/graph.rs:404:17
    |
404 |         assert!(Ix::max().index() == !0 || NodeIndex::end() != node_idx);
    |                 ^^^^^^^ multiple `max` found
    |
note: candidate #1 is defined in the trait `graph::IndexType`
   --> /home/haptop/.cargo/registry/src/github.com-1ecc6299db9ec823/petgraph-0.1.18/src/graph.rs:28:5
    |
28  |     fn max() -> Self;
    |     ^^^^^^^^^^^^^^^^^
    = help: to disambiguate the method call, write `graph::IndexType::max(...)` instead
note: candidate #2 is defined in the trait `std::cmp::Ord`
    = help: to disambiguate the method call, write `std::cmp::Ord::max(...)` instead

error[E0034]: multiple applicable items in scope
   --> /home/haptop/.cargo/registry/src/github.com-1ecc6299db9ec823/petgraph-0.1.18/src/graph.rs:438:17
    |
438 |         assert!(Ix::max().index() == !0 || EdgeIndex::end() != edge_idx);
    |                 ^^^^^^^ multiple `max` found
    |
note: candidate #1 is defined in the trait `graph::IndexType`
   --> /home/haptop/.cargo/registry/src/github.com-1ecc6299db9ec823/petgraph-0.1.18/src/graph.rs:28:5
    |
28  |     fn max() -> Self;
    |     ^^^^^^^^^^^^^^^^^
    = help: to disambiguate the method call, write `graph::IndexType::max(...)` instead
note: candidate #2 is defined in the trait `std::cmp::Ord`
    = help: to disambiguate the method call, write `std::cmp::Ord::max(...)` instead

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0034`.
error: could not compile `petgraph`.

To learn more, run the command again with --verbose.

My rustc version:

[nix-shell:~/Developer/rose_tree-rs]$ rustc --version
rustc 1.40.0 (73528e339 2019-12-16)

I'm going to keep digging, but wanted to post this as a first heads up :ok_hand:

FintanH commented 4 years ago

Ah, so I think this is to do with introducing max into Ord. Updating petgraph to 0.2 works. I've also noticed that petgraph is now at 0.5 but it's removed and changed some things around so would need some work to upgrade.

I'm happy to help if you think this would be helpful :)