Unexpected static lifetime requirement for nested boxed closures with generic parameters #134835
Labels
C-discussion
Category: Discussion or questions that doesn't represent real issues.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I tried this code:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c96c451d36a64d657cdfecc7c5185f31
I expected to see this happen: successful compilation
Instead, this happened:
I am not exactly sure its a bug per say, but from my perspective, this is relatively surprising that this code fails to build.
The
'static
bound is on the boxed dyn object itself and not on the parameters of the boxed closure.Its not clear why U should be
'static
whenContext
which holdsU
is not.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: