1 #![feature(generic_const_exprs)]
2 #![allow(incomplete_features)]
3 use std::marker::PhantomData;
8 // fn(&'static ())` is a supertype of `for<'a> fn(&'a ())` while
9 // we allow two different impls for these types, leading
10 // to different const eval results.
11 impl SadBee for for<'a> fn(&'a ()) {
12 const ASSOC: usize = 0;
14 impl SadBee for fn(&'static ()) {
15 //~^ WARNING conflicting implementations of trait
16 //~| WARNING this was previously accepted
17 const ASSOC: usize = 100;
20 struct Foo<T: SadBee>([u8; <T as SadBee>::ASSOC], PhantomData<T>)
22 [(); <T as SadBee>::ASSOC]: ;
25 v: &'static Foo<for<'a> fn(&'a ())>
26 ) -> &'static Foo<fn(&'static ())> {
27 v //~ ERROR mismatched types
31 let y = covariant(&Foo([], PhantomData));
32 println!("{:?}", y.0);