dimforge / ncollide

2 and 3-dimensional collision detection library in Rust.
https://ncollide.org
Apache License 2.0
921 stars 105 forks source link

hacd.rs → add_triangle_edges implements FnMut not Fn #289

Closed Natim closed 5 years ago

Natim commented 5 years ago
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnMut`
   --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/ncollide3d-0.18.1/src/transformation/hacd.rs:745:47
    |
745 |         let mut add_triangle_edges = Box::new(|i: usize, t: &Point3<u32>| {
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^ this closure implements `FnMut`, not `Fn`
...
749 |                 let other = match prim_edges.entry(*e) {
    |                                   ---------- closure is `FnMut` because it mutates the variable `prim_edges` here
...
765 |                     add_triangle_edges(i, t)
    |                     ------------------------ the requirement to implement `Fn` derives from here

error: aborting due to previous error
sebcrozet commented 5 years ago

Hi! This is a duplicate of #266. This is already fixed in the latest version of ncollide.

Natim commented 5 years ago

Indeed thanks !