]> git.lizzy.rs Git - rust.git/blob - src/test/ui/builtin-superkinds/builtin-superkinds-phantom-typaram.rs
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / builtin-superkinds / builtin-superkinds-phantom-typaram.rs
1 // run-pass
2
3 #![allow(dead_code)]
4 // Tests that even when a type parameter doesn't implement a required
5 // super-builtin-kind of a trait, if the type parameter is never used,
6 // the type can implement the trait anyway.
7
8 // pretty-expanded FIXME #23616
9
10 use std::marker;
11
12 trait Foo : Send { }
13
14 struct X<T> { marker: marker::PhantomData<T> }
15
16 impl<T:Send> Foo for X<T> { }
17
18 pub fn main() { }