Closed
Description
I got a little confused by the following code:
struct Foo<T> {
value: T
}
impl<u32> Foo<u32> {
fn impl_func(&self) -> u32 {
42
}
}
rustc gives the error: 42: expected type parameter, found integral variable
.
The mistake is that I've created a type parameter named u32
. Could we warn on this case? I can't see any legitimate use case for shadowing u32
.
Metadata
Metadata
Assignees
Labels
No labels