]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.rs
1 // Test where we fail to approximate due to demanding a postdom
2 // relationship between our upper bounds.
4 // compile-flags:-Zverbose
6 #![feature(rustc_attrs)]
16 // we have to prove that `'x: 'y`. We currently can only approximate
17 // via a postdominator -- hence we fail to choose between `'a` and
18 // `'b` here and report the error in the closure.
19 fn establish_relationships
<'a
, 'b
, 'c
, F
>(
20 _cell_a
: Cell
<&'a
u32>,
21 _cell_b
: Cell
<&'b
u32>,
22 _cell_c
: Cell
<&'c
u32>,
26 Cell
<&'a
&'x
u32>, // shows that 'x: 'a
27 Cell
<&'b
&'x
u32>, // shows that 'x: 'b
28 Cell
<&'y
&'c
u32>, // shows that 'c: 'y
35 fn demand_y
<'x
, 'y
>(_cell_x
: Cell
<&'x
u32>, _cell_y
: Cell
<&'y
u32>, _y
: &'y
u32) {}
38 fn supply
<'a
, 'b
, 'c
>(cell_a
: Cell
<&'a
u32>, cell_b
: Cell
<&'b
u32>, cell_c
: Cell
<&'c
u32>) {
39 establish_relationships(
43 |_outlives1
, _outlives2
, _outlives3
, x
, y
| {
44 // Only works if 'x: 'y:
46 demand_y(x
, y
, p
) //~ ERROR