Const closure weirdness #55272
Labels
A-closures
Area: Closures (`|…| { … }`)
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
A-lifetimes
Area: Lifetimes / regions
The following compiles just fine:
However this does not:
It gives the following error message:
Why is this an error? The closure does not capture anything, so it's lifetime is
'static
, and const requires'static
.The text was updated successfully, but these errors were encountered: