Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#56746 - pnkfelix:issue-56537-add-test-of-cl…
…osure-using-region-from-containing-fn, r=nikomatsakis Add test of current behavior (infer free region within closure body) This behavior was previously not encoded in our test suite. it is pretty important that we test this behavior. In particular, in rust-lang#56537 I had proposed expanding the lifetime elision rules so that they would apply to some of the cases encoded in this test, which would cause them to start failing to compile successfully (because the lifetime attached to the return type would start being treated as connected to the lifetime on the input parameter to the lambda expression, which is explicitly *not* what the code wants in this particular case). In other words, I am trying to ensure that anyone who tries such experiments with lifetime elision in the future quickly finds out why we don't support lifetime elision on lambda expressions (at least not in the naive manner described on rust-lang#56537).
- Loading branch information