]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/relate_tys/hr-fn-aau-eq-abu.rs
1 // Test an interesting corner case that ought to be legal (though the
2 // current code actually gets it wrong, see below): a fn that takes
3 // two arguments that are references with the same lifetime is in fact
4 // equivalent to a fn that takes two references with distinct
5 // lifetimes. This is true because the two functions can call one
6 // another -- effectively, the single lifetime `'a` is just inferred
7 // to be the intersection of the two distinct lifetimes.
10 // compile-flags:-Zno-leak-check
14 fn make_cell_aa() -> Cell
<for<'a
> fn(&'a
u32, &'a
u32)> {
19 let a
: Cell
<for<'a
, 'b
> fn(&'a
u32, &'b
u32)> = make_cell_aa();