Open
Description
Consider the following code (play):
type T = ();
struct S<X>(X);
impl Clone for S<T> { fn clone(&self) -> Self { S(()) } }
fn main() {
let s = S(());
drop(s.clone());
}
Today this emits the following warning diagnostic:
warning: type alias is never used: `T`
--> src/main.rs:1:1
|
1 | type T = ();
| ^^^^^^^^^^^^
|
= note: #[warn(dead_code)] on by default
But that type alias is not dead code. It is used in the impl Clone for S<T> { ... }
, as one can see by trying to recompile the code after commenting out the type alias.