Skip to content

Commit

Permalink
FIX: Fix future compat warning with raw pointer casts
Browse files Browse the repository at this point in the history
```
warning: the type of this value must be known in this context
   --> src/graphmap.rs:765:11
    |
765 |         a.cmp(&b)
    |           ^^^
    |
    = note: #[warn(tyvar_behind_raw_pointer)] on by default
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #46906 <rust-lang/rust#46906>
```
  • Loading branch information
bluss committed Jan 7, 2018
1 parent ea95d87 commit d86623a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/graphmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,8 @@ impl<'b, T> Ord for Ptr<'b, T>
{
/// Ptr is ordered by pointer value, i.e. an arbitrary but stable and total order.
fn cmp(&self, other: &Ptr<'b, T>) -> Ordering {
let a = self.0 as *const _;
let b = other.0 as *const _;
let a: *const T = self.0;
let b: *const T = other.0;
a.cmp(&b)
}
}
Expand Down

0 comments on commit d86623a

Please sign in to comment.