The way we currently check type parameters is inconsistent and error prone. The code below compiles and it shouldn't.
The resolve phase currently ignores these checks and leaves them up to typeck, collect and check, which as demonstrated by bugs like this one and #20302 makes this check unsound.
fn is_copy<T: ::std::marker<i32>::Copy>() {}
fn main() {}
The way we currently check type parameters is inconsistent and error prone. The code below compiles and it shouldn't.
The
resolvephase currently ignores these checks and leaves them up totypeck,collectandcheck, which as demonstrated by bugs like this one and #20302 makes this check unsound.