diff --git a/src/test/ui/nll/relate_tys/hr-fn-aau-eq-abu.rs b/src/test/ui/nll/relate_tys/hr-fn-aau-eq-abu.rs index d62354fece6..9b8268d9736 100644 --- a/src/test/ui/nll/relate_tys/hr-fn-aau-eq-abu.rs +++ b/src/test/ui/nll/relate_tys/hr-fn-aau-eq-abu.rs @@ -8,12 +8,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Test an interesting corner case: a fn that takes two arguments that -// are references with the same lifetime is in fact equivalent to a fn -// that takes two references with distinct lifetimes. This is true -// because the two functions can call one another -- effectively, the -// single lifetime `'a` is just inferred to be the intersection of the -// two distinct lifetimes. +// Test an interesting corner case that ought to be legal (though the +// current code actually gets it wrong, see below): a fn that takes +// two arguments that are references with the same lifetime is in fact +// equivalent to a fn that takes two references with distinct +// lifetimes. This is true because the two functions can call one +// another -- effectively, the single lifetime `'a` is just inferred +// to be the intersection of the two distinct lifetimes. +// +// FIXME: However, we currently reject this example with an error, +// because of how we handle binders and equality in `relate_tys`. // // compile-flags:-Zno-leak-check @@ -28,10 +32,6 @@ fn make_cell_aa() -> Cell fn(&'a u32, &'a u32)> { fn aa_eq_ab() { let a: Cell fn(&'a u32, &'b u32)> = make_cell_aa(); //~^ ERROR higher-ranked subtype error - // - // FIXME -- this .. arguably ought to be accepted. However, the - // current leak check also rejects this example, and it's kind of - // a pain to support it. There are some comments in `relate_tys` drop(a); }