dpc / rhex

ASCII terminal hexagonal map roguelike written in Rust
154 stars 18 forks source link

Build broken due to hex2d-dpcext dependency #43

Open tpetazzoni opened 2 years ago

tpetazzoni commented 2 years ago

Recent commit 7ae336f295f0bc19d4f3bb505e1fd3b8c842f0c3 seems to have broken the build. It updated the hex2d-dpcext dependency, but this seems to cause the following build issue:

$ cargo build
    Updating crates.io index
error: failed to select a version for the requirement `hex2d-dpcext = "^0.1.1"`
candidate versions found which didn't match: 0.1.0, 0.0.9, 0.0.8, ...
location searched: crates.io index
required by package `rhex v0.1.1 (/home/thomas/projets/rhex)`
tpetazzoni commented 2 years ago

After downgrading this dependency on hex2d-dpcext to 0.1.0 which is the latest version available on crates.io, the build fails with:

error[E0277]: expected a `Fn<(hex2d::Coordinate<_>,)>` closure, found `F`
  --> src/ai.rs:47:39
   |
40 |     let mut bfs = bfs::Traverser::new(|pos| {
   |                   ------------------- required by a bound introduced by this call
...
47 |                                       start);
   |                                       ^^^^^ expected an `Fn<(hex2d::Coordinate<_>,)>` closure, found `F`
   |
note: required by `Traverser::<FCanPass, FIsDest, I>::new`
  --> /home/thomas/.cargo/registry/src/github.com-1ecc6299db9ec823/hex2d-dpcext-0.1.0/src/algo.rs:44:9
   |
44 |         pub fn new(can_pass : FCanPass, is_dest : FIsDest, start: Coordinate<I>) -> Traverser<FCanPass, FIsDest, I> {
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
  --> src/ai.rs:47:39
   |
47 | ...                   start);
   |                       ^^^^^ expected struct `hex2d::Coordinate`, found struct `Coordinate`
   |
   = note: expected struct `hex2d::Coordinate<_>`
              found struct `Coordinate`
   = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
  --> src/ai.rs:41:50
   |
41 | ...                   pos == start ||
   |                              ^^^^^ expected struct `hex2d::Coordinate`, found struct `Coordinate`
   |
   = note: expected struct `hex2d::Coordinate<_>`
              found struct `Coordinate`
   = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
  --> src/ai.rs:42:54
   |
42 | ...                   (gstate.at(pos).tile().is_passable() &&
   |                                  ^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
   |
   = note: expected struct `Coordinate`
              found struct `hex2d::Coordinate<_>`
   = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
  --> src/ai.rs:43:57
   |
43 | ...                   pos.distance(start) < max_distance &&
   |                                    ^^^^^ expected struct `hex2d::Coordinate`, found struct `Coordinate`
   |
   = note: expected struct `hex2d::Coordinate<_>`
              found struct `Coordinate`
   = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
  --> src/ai.rs:44:55
   |
44 | ...                   !gstate.at(pos).is_occupied())
   |                                  ^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
   |
   = note: expected struct `Coordinate`
              found struct `hex2d::Coordinate<_>`
   = note: perhaps two different versions of crate `hex2d` are being used?

error[E0277]: expected a `Fn<(hex2d::Coordinate<_>,)>` closure, found `F`
  --> src/ai.rs:40:19
   |
40 |       let mut bfs = bfs::Traverser::new(|pos| {
   |  ___________________^
41 | |                                           pos == start ||
42 | |                                           (gstate.at(pos).tile().is_passable() &&
43 | |                                            pos.distance(start) < max_distance &&
...  |
46 | |                                       cond,
47 | |                                       start);
   | |____________________________________________^ expected an `Fn<(hex2d::Coordinate<_>,)>` closure, found `F`
   |
note: required by a bound in `Traverser`
  --> /home/thomas/.cargo/registry/src/github.com-1ecc6299db9ec823/hex2d-dpcext-0.1.0/src/algo.rs:27:19
   |
27 |         FIsDest : Fn(Coordinate<I>) -> bool
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Traverser`

error[E0599]: the method `find` exists for struct `Traverser<[closure@src/ai.rs:40:39: 45:40], F, _>`, but its trait bounds were not satisfied
  --> src/ai.rs:48:9
   |
48 |     bfs.find().map(|pos| (pos, bfs.backtrace_last(pos).unwrap()))
   |         ^^^^ method cannot be called on `Traverser<[closure@src/ai.rs:40:39: 45:40], F, _>` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `<F as FnOnce<(hex2d::Coordinate<_>,)>>::Output = bool`
           `F: Fn<(hex2d::Coordinate<_>,)>`

error[E0599]: the method `backtrace_last` exists for struct `Traverser<[closure@src/ai.rs:40:39: 45:40], F, _>`, but its trait bounds were not satisfied
  --> src/ai.rs:48:36
   |
48 |     bfs.find().map(|pos| (pos, bfs.backtrace_last(pos).unwrap()))
   |                                    ^^^^^^^^^^^^^^ method cannot be called on `Traverser<[closure@src/ai.rs:40:39: 45:40], F, _>` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `<F as FnOnce<(hex2d::Coordinate<_>,)>>::Output = bool`
           `F: Fn<(hex2d::Coordinate<_>,)>`

error[E0308]: mismatched types
   --> src/curses/ui.rs:355:43
    |
355 | ...                   start);
    |                       ^^^^^ expected struct `hex2d::Coordinate`, found struct `Coordinate`
    |
    = note: expected struct `hex2d::Coordinate<_>`
               found struct `Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/curses/ui.rs:347:52
    |
347 | ...                   c == start ||
    |                            ^^^^^ expected struct `hex2d::Coordinate`, found struct `Coordinate`
    |
    = note: expected struct `hex2d::Coordinate<_>`
               found struct `Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/curses/ui.rs:348:59
    |
348 | ...                   (cur_loc.at(c).tile().is_passable() &&
    |                                   ^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/curses/ui.rs:349:61
    |
349 | ...                   player.knows(c))
    |                                    ^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/curses/ui.rs:352:58
    |
352 | ...                   cur_loc.at(c).tile().feature ==
    |                                  ^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/curses/ui.rs:360:70
    |
360 |                 if let Some(ndir) = player.pos.coord.direction_to_cw(neigh) {
    |                                                                      ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/curses/ui.rs:362:39
    |
362 |                         if cur_loc.at(neigh).is_occupied() {
    |                                       ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/curses/ui.rs:389:43
    |
389 | ...                   start);
    |                       ^^^^^ expected struct `hex2d::Coordinate`, found struct `Coordinate`
    |
    = note: expected struct `hex2d::Coordinate<_>`
               found struct `Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/curses/ui.rs:387:52
    |
387 |         let mut bfs = bfs::Traverser::new(|c| c == start || cur_loc.at(c).tile().is_passable(),
    |                                                    ^^^^^ expected struct `hex2d::Coordinate`, found struct `Coordinate`
    |
    = note: expected struct `hex2d::Coordinate<_>`
               found struct `Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/curses/ui.rs:387:72
    |
387 |         let mut bfs = bfs::Traverser::new(|c| c == start || cur_loc.at(c).tile().is_passable(),
    |                                                                        ^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/curses/ui.rs:388:61
    |
388 | ...                   |c| !player.knows(c),
    |                                         ^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/curses/ui.rs:394:61
    |
394 |                 let ndir = player.pos.coord.direction_to_cw(neigh).expect("bfs gave me trash");
    |                                                             ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/curses/ui.rs:396:35
    |
396 |                     if cur_loc.at(neigh).is_occupied() {
    |                                   ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/actor.rs:685:41
    |
685 |         algo::los2::los(&|coord| loc.at(coord).tile().opaqueness(),
    |                                         ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/actor.rs:687:63
    |
687 | ...                   let _ = self.temporary_los.insert(coord);
    |                                                         ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/actor.rs:690:25
    |
690 |                         pos.coord,
    |                         ^^^^^^^^^ expected struct `hex2d::Coordinate`, found struct `Coordinate`
    |
    = note: expected struct `hex2d::Coordinate`
               found struct `Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/actor.rs:691:27
    |
691 |                         &[pos.dir]);
    |                           ^^^^^^^ expected enum `hex2d::Direction`, found enum `Direction`
    |
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:101:48
    |
101 | ...                   if coord == *pos {
    |                                   ^^^^ expected struct `hex2d::Coordinate`, found struct `Coordinate`
    |
    = note: expected struct `hex2d::Coordinate<_>`
               found struct `Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:104:48
    |
104 | ...                   self.at(coord).tile().opaqueness()
    |                               ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:108:49
    |
108 | ...                   if light_map[coord] < light as u32 {
    |                                    ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:109:50
    |
109 | ...                   light_map[coord] = light as u32;
    |                                 ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:113:32
    |
113 | ...                   *pos,
    |                       ^^^^ expected struct `hex2d::Coordinate`, found struct `Coordinate`
    |
    = note: expected struct `hex2d::Coordinate`
               found struct `Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:114:32
    |
114 | ...                   Direction::all());
    |                       ^^^^^^^^^^^^^^^^ expected slice, found array of 6 elements
    |
    = note: expected reference `&[hex2d::Direction]`
               found reference `&'static [Direction; 6]`

error[E0308]: mismatched types
   --> src/game/location.rs:123:48
    |
123 | ...                   if coord == pos {
    |                                   ^^^ expected struct `hex2d::Coordinate`, found struct `Coordinate`
    |
    = note: expected struct `hex2d::Coordinate<_>`
               found struct `Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:126:48
    |
126 | ...                   self.at(coord).tile().opaqueness()
    |                               ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:130:49
    |
130 | ...                   if light_map[coord] < light as u32 {
    |                                    ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:131:50
    |
131 | ...                   light_map[coord] = light as u32;
    |                                 ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:135:32
    |
135 | ...                   pos,
    |                       ^^^ expected struct `hex2d::Coordinate`, found struct `Coordinate`
    |
    = note: expected struct `hex2d::Coordinate`
               found struct `Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:136:32
    |
136 | ...                   Direction::all());
    |                       ^^^^^^^^^^^^^^^^ expected slice, found array of 6 elements
    |
    = note: expected reference `&[hex2d::Direction]`
               found reference `&'static [Direction; 6]`

error[E0308]: mismatched types
   --> src/game/location.rs:357:53
    |
357 | ...                   self.coord);
    |                       ^^^^^^^^^^ expected struct `hex2d::Coordinate`, found struct `Coordinate`
    |
    = note: expected struct `hex2d::Coordinate<_>`
               found struct `Coordinate`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:351:71
    |
351 | ...                   self.state.at(coord).tile().is_passable()
    |                                     ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:354:71
    |
354 | ...                   self.state.at(coord).tile().is_passable() &&
    |                                     ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:355:78
    |
355 | ...                   self.state.items.get(&coord).is_none()
    |                                            ^^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected reference `&Coordinate`
               found reference `&hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

error[E0308]: mismatched types
   --> src/game/location.rs:367:41
    |
367 |                 self.state.items.insert(coord, item);
    |                                         ^^^^^ expected struct `Coordinate`, found struct `hex2d::Coordinate`
    |
    = note: expected struct `Coordinate`
               found struct `hex2d::Coordinate<_>`
    = note: perhaps two different versions of crate `hex2d` are being used?

Some errors have detailed explanations: E0277, E0308, E0599.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `rhex` due to 43 previous errors
ryanfantus commented 2 years ago

I'm also stuck here - would love to build this, thanks!

dpc commented 2 years ago

Sorry, but this project is abandoned as they come. :D