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 we can parse all the various places that a `for` keyword
12 // can appear representing universal quantification.
14 // pretty-expanded FIXME #23616
16 #![feature(unboxed_closures)]
17 #![allow(unused_variables)]
21 fn get(&self, arg: A) -> R;
24 // Parse HRTB with explicit `for` in a where-clause:
27 where T : for<'a> Get<&'a i32, &'a i32>
31 fn foo01<T: for<'a> Get<&'a i32, &'a i32>>(t: T)
35 // Parse HRTB with explicit `for` in various sorts of types:
37 fn foo10(t: Box<for<'a> Get<i32, i32>>) { }
38 fn foo11(t: Box<for<'a> Fn(i32) -> i32>) { }
40 fn foo20(t: for<'a> fn(i32) -> i32) { }
41 fn foo21(t: for<'a> unsafe fn(i32) -> i32) { }
42 fn foo22(t: for<'a> extern "C" fn(i32) -> i32) { }
43 fn foo23(t: for<'a> unsafe extern "C" fn(i32) -> i32) { }