Closed WilliamVenner closed 1 year ago
I noticed using withf
has relaxed lifetime bounds -
with
not be similarly relaxed in order to accommodate this?I noticed using
withf
has relaxed lifetime bounds -1. Does this result in poorer output of test error messages, when there are more than 1 parameters to evaluate?
Yes, exactly. Using a predicate like eq
gives better error messages than withf
.
2. Can the lifetime bounds on `with` not be similarly relaxed in order to accommodate this?
Nope. The predicates passed to with
must be 'static
. In your case, you may be able to do function(move for<'a> |stuff: &[&'a str]| true)
.
I did actually try your suggestion (it requires nightly atm) and it didn't fix it unfortunately.
Then your best bet is to use withf
.
I'm going to close this, on the assumption that I've answered your question.
First, this doesn't work due to missing lifetime specifier:
Second, I can't seem to get this to work at all, even with a specified lifetime parameter:
How can I get it to play nice?