mitchmindtree/daggy

Petgraph Compile Error

Closed this issue · 4 comments

Hi, I'm getting errors when trying to compile Petgraph. I was told upgrading to 0.4.5 would fix the issue but daggy is already specifying 0.4.5. The following is my error message:

error[E0034]: multiple applicable items in scope
   --> /home/onix/.cargo/registry/src/github.com-1ecc6299db9ec823/petgraph-0.2.9/src/graph.rs:421:17
    |
421 |         assert!(Ix::max().index() == !0 || NodeIndex::end() != node_idx);
    |                 ^^^^^^^ multiple `max` found
    |
note: candidate #1 is defined in the trait `graph::IndexType`
   --> /home/onix/.cargo/registry/src/github.com-1ecc6299db9ec823/petgraph-0.2.9/src/graph.rs:31:5
    |
31  |     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/onix/.cargo/registry/src/github.com-1ecc6299db9ec823/petgraph-0.2.9/src/graph.rs:458:17
    |
458 |         assert!(Ix::max().index() == !0 || EdgeIndex::end() != edge_idx);
    |                 ^^^^^^^ multiple `max` found
    |
note: candidate #1 is defined in the trait `graph::IndexType`
   --> /home/onix/.cargo/registry/src/github.com-1ecc6299db9ec823/petgraph-0.2.9/src/graph.rs:31:5
    |
31  |     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

error: Could not compile `petgraph`.
warning: build failed, waiting for other jobs to finish...
error: build failed

Hey @AlexCreamer, the compile errors seem to be pointing to a 0.2.9 build of petgraph - perhaps you need to run cargo update?

tried that.. didn't work. I get errors saying I can't override one of my packages

bluss commented

The error indicates petgraph-0.2.9 is being used, so the crate that is using that version (or something like "0.2") needs to be found and updated. (= Update its Cargo.toml)

I guess this can be closed?