"Associated type doesn't live long enough", even though it does #80986
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-lifetimes
Area: Lifetimes / regions
C-bug
Category: This is a bug.
I tried this code:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=0474ce6d89ae44d17d9ef2df99c0883f
I expected this to compile, because lifetime elision enforces that
I::Output
will live as long asself
, and thatSomethingElse
will live as long asI::Output
, and by transitivitySomethingElse
will live as long asself
.However, I got to following
error message
This is not specific to
AsRef
, any function that has the following signature will fail to compileThe text was updated successfully, but these errors were encountered: