Note about object lifetime defaults in does not live long enough error by Nilstr...
source link: https://github.com/rust-lang/rust/pull/117835
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Conversation
Member
This is a aspect of Rust that frequently trips up people who are not aware of it yet. This diagnostic attempts to explain what's happening and why the lifetime constraint, that was never mentioned in the source, arose.
The implementation feels a bit questionable, I'm not sure whether there are better ways to do this. There probably are.
fixes #117835
r? types
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK