]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/closure-requirements/escape-argument-callee.rs
3 // - takes an argument `y` with lifetime `'a` (in the code, it's anonymous)
4 // - stores `y` into another, longer-lived spot with lifetime `'b`
6 // Because `'a` and `'b` are two different, unrelated higher-ranked
7 // regions with no relationship to one another, this is an error. This
8 // error is reported by the closure itself and is not propagated to
9 // its creator: this is because `'a` and `'b` are higher-ranked
10 // (late-bound) regions and the closure is not allowed to propagate
11 // additional where clauses between higher-ranked regions, only those
12 // that appear free in its type (hence, we see it before the closure's
13 // "external requirements" report).
15 // compile-flags:-Zverbose
17 #![feature(rustc_attrs)]
26 let mut closure
= expect_sig(|p
, y
| *p
= y
);
34 fn expect_sig
<F
>(f
: F
) -> F
35 where F
: FnMut(&mut &i32, &i32)
40 fn deref(_p
: &i32) { }