]>
Commit | Line | Data |
---|---|---|
ff7c6d11 XL |
1 | // Test closure that takes two references and is supposed to return |
2 | // the first, but actually returns the second. This should fail within | |
3 | // the closure. | |
4 | ||
923072b8 | 5 | // compile-flags:-Zverbose |
ff7c6d11 XL |
6 | |
7 | #![feature(rustc_attrs)] | |
8 | ||
9 | #[rustc_regions] | |
10 | fn test() { | |
11 | expect_sig(|a, b| b); // ought to return `a` | |
b7449926 | 12 | //~^ ERROR |
ff7c6d11 XL |
13 | } |
14 | ||
15 | fn expect_sig<F>(f: F) -> F | |
16 | where F: for<'a> FnMut(&'a i32, &i32) -> &'a i32 | |
17 | { | |
18 | f | |
19 | } | |
20 | ||
21 | fn deref(_p: &i32) { } | |
22 | ||
23 | fn main() { } |