Closed
Description
#![crate_type = "lib"]
use std::collections::HashSet;
pub struct T {}
fn f(map: HashSet<usize>, v: *const T) {
map.contains(v as usize);
}
The current error message is:
|
8 | map.contains(v as usize);
| ^^^^^^^^^^ expected &usize, found usize
|
= note: expected type `&usize`
found type `usize`
= help: try with `&v as usize`
It should suggest trying &(v as usize)
: at the moment, if the user tries the current suggestion, they'll be told to try &&v as usize
, and so on.
Playground link