Closed
Description
I tried this code:
fn compare(a: fn(usize) -> u32, b: fn(u64) -> u32) {
if a as usize == b as usize {
println!("a == b: {} & {}", a as usize, b as usize);
} else {
println!("a != b: {} & {}", a as usize, b as usize);
}
}
fn foo<T>(_: T) -> u32 {
0
}
fn main() {
compare(foo::<usize>, foo::<u64>);
}
I expected to see this happen:
Either it would say a == b
and provide equal addresses, or print a != b
and provide different addresses.
Instead, this happened:
The playground prints this on December the 6th 2020:
a != b: 94588183998880 & 94588183998880
Meta
This bug also seems to occur on the beta channel available on the playground and the nightly available there too.