1 // Test for RFC 1268: we allow overlapping impls of marker traits,
2 // that is, traits without items. In this case, a type `T` is
3 // `MyMarker` if it is either `Debug` or `Display`. This test just
4 // checks that we don't consider **all** types to be `MyMarker`. See
5 // also the companion test in
6 // `run-pass/overlap-permitted-for-marker-traits.rs`.
8 #![feature(overlapping_marker_traits)]
9 #![feature(optin_builtin_traits)]
11 use std::fmt::{Debug, Display};
15 impl<T: Debug> Marker for T {}
16 impl<T: Display> Marker for T {}
18 fn is_marker<T: Marker>() { }
20 struct NotDebugOrDisplay;
27 is_marker::<Vec<i32>>();
30 is_marker::<NotDebugOrDisplay>(); //~ ERROR