1 // Test for RFC 1268: we allow overlapping impls of marker traits,
2 // that is, traits with #[marker]. 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`.
6 #![feature(marker_trait_attr)]
8 use std::fmt::{Debug, Display};
10 #[marker] trait Marker {}
12 impl<T: Debug> Marker for T {}
13 impl<T: Display> Marker for T {}
15 fn is_marker<T: Marker>() { }
17 struct NotDebugOrDisplay;
24 is_marker::<Vec<i32>>();
27 is_marker::<NotDebugOrDisplay>(); //~ ERROR