1 // Test interaction between unboxed closure sugar and region
2 // parameters (should be exactly as if angle brackets were used
3 // and regions omitted).
5 #![feature(unboxed_closures)]
12 fn dummy(&'a self) -> &'a (T,Self::Output);
15 trait Eq<X: ?Sized> { fn is_of_eq_type(&self, x: &X) -> bool { true } }
16 impl<X: ?Sized> Eq<X> for X { }
17 fn eq<A: ?Sized,B: ?Sized +Eq<A>>() { }
19 fn same_type<A,B:Eq<A>>(a: A, b: B) { }
22 // Parens are equivalent to omitting default in angle.
23 eq::< dyn Foo<(isize,),Output=()>, dyn Foo(isize) >();
25 // Here we specify 'static explicitly in angle-bracket version.
26 // Parenthesized winds up getting inferred.
27 eq::< dyn Foo<'static, (isize,),Output=()>, dyn Foo(isize) >();
30 fn test2(x: &dyn Foo<(isize,),Output=()>, y: &dyn Foo(isize)) {
31 //~^ ERROR this trait takes 1 lifetime argument but 0 lifetime arguments were supplied
32 // Here, the omitted lifetimes are expanded to distinct things.