rust/tests/ui/builtin-superkinds/builtin-superkinds-phantom-typaram.rs

19 lines
392 B
Rust
Raw Normal View History

//@ run-pass
#![allow(dead_code)]
2014-08-01 23:42:13 +00:00
// Tests that even when a type parameter doesn't implement a required
2013-08-19 21:15:25 +00:00
// super-builtin-kind of a trait, if the type parameter is never used,
// the type can implement the trait anyway.
//@ pretty-expanded FIXME #23616
use std::marker;
2013-08-16 22:21:02 +00:00
trait Foo : Send { }
struct X<T> { marker: marker::PhantomData<T> }
2013-08-16 22:21:02 +00:00
impl<T:Send> Foo for X<T> { }
2013-08-16 22:21:02 +00:00
pub fn main() { }