1 // Copyright 2012 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 fn of<'a,T>() -> |T|:'a { panic!(); }
12 fn subtype<T>(x: |T|) { panic!(); }
14 fn test_fn<'x,'y,'z,T>(_x: &'x T, _y: &'y T, _z: &'z T) {
15 // Here, x, y, and z are free. Other letters
16 // are bound. Note that the arrangement
17 // subtype::<T1>(of::<T2>()) will typecheck
20 subtype::< for<'a>|&'a T|>(
21 of::< for<'a>|&'a T|>());
23 subtype::< for<'a>|&'a T|>(
24 of::< for<'b>|&'b T|>());
26 subtype::< for<'b>|&'b T|>(
30 of::< for<'b>|&'b T|>()); //~ ERROR mismatched types
32 subtype::< for<'a,'b>|&'a T, &'b T|>(
33 of::< for<'a>|&'a T, &'a T|>());
35 subtype::< for<'a>|&'a T, &'a T|>(
36 of::< for<'a,'b>|&'a T, &'b T|>()); //~ ERROR mismatched types
38 subtype::< for<'a,'b>|&'a T, &'b T|>(
39 of::<|&'x T, &'y T|>());
41 subtype::<|&'x T, &'y T|>(
42 of::< for<'a,'b>|&'a T, &'b T|>()); //~ ERROR mismatched types