Lifetime must be 'static, but why? #138408
Labels
A-borrow-checker
Area: The borrow checker
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: Lifetimes / regions
D-terse
Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=f9243c5a93b40649aaa99f20dc78d5b0
Current output
Desired output
Maybe something like
Rationale and extra context
In the example above it is also easy to figure it out yourself, but I ran into a case where the actual function is hidden:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=4c1003f809e67aec7ded5ea736ab0430
pub fn body<T: Into<Body>>(mut self, body: T) -> RequestBuilder
impl From<&'static str> for Body
In this case the message should directly point to the from implementation.
Rust Version
I tried this on the Rust playground on Rust 1.85.0
The text was updated successfully, but these errors were encountered: