1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Test that the unboxed closure sugar can be used with an arbitrary
12 // struct type and that it is equivalent to the same syntax using
13 // angle brackets. This test covers only simple types and in
14 // particular doesn't test bound regions.
16 #![feature(unboxed_closures)]
21 fn dummy(&self, t: T);
24 trait Eq<X: ?Sized> { }
25 impl<X: ?Sized> Eq<X> for X { }
26 fn eq<A: ?Sized,B: ?Sized +Eq<A>>() { }
29 eq::< for<'a> Foo<(&'a isize,), Output=&'a isize>,
30 Foo(&isize) -> &isize >();
31 eq::< for<'a> Foo<(&'a isize,), Output=(&'a isize, &'a isize)>,
32 Foo(&isize) -> (&isize, &isize) >();
34 let _: Foo(&isize, &usize) -> &usize; //~ ERROR missing lifetime specifier