Open
Description
I tried this code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=fa659e7e2652bb05a7e407a9925b1344
I expected to see this happen: The reference should convert to a pointer, losing all lifetime information.
Instead, this happened: Rust askes that the reference be given a static lifetime. This doesn't occur with non-dyn references. In addition, if you make a small modification to the code then it works: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=1257118244ee5aef365f12906c3b52fc
Meta
rustc --version --verbose
:
1.49.0
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: trait objects, vtable layoutArea: Lifetimes / regionsArea: raw pointers, MaybeUninit, NonNullDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Relevant to the compiler team, which will review and decide on the PR/issue.