Change MarkerTrait to be invariant. This is a (small) loss of expressiveness,

but is necessary for now to work around #22806. Fixes #22655.
This commit is contained in:
Niko Matsakis
2015-02-25 12:21:15 -05:00
parent 880fb89bde
commit 7074346e4f
2 changed files with 36 additions and 1 deletions

View File

@@ -275,7 +275,13 @@ macro_rules! impls{
/// any methods, but instead is used to gate access to data.
///
/// FIXME. Better documentation needed here!
pub trait MarkerTrait : PhantomFn<Self> { }
pub trait MarkerTrait : PhantomFn<Self,Self> { }
// ~~~~~ <-- FIXME(#22806)?
//
// Marker trait has been made invariant so as to avoid inf recursion,
// but we should ideally solve the underlying problem. That's a bit
// complicated.
impl<T:?Sized> MarkerTrait for T { }
/// `PhantomFn` is a marker trait for use with traits that contain