Report #70804
[bug\_fix] missing lifetime specifier... expected named lifetime parameter
Add an explicit lifetime annotation to the function signature, e.g., \`fn foo<'a>\(input: &'a str\) -> &'a str\`, linking the output lifetime to the input.
Journey Context:
Developer defines a helper function \`fn first\_word\(s: &str\) -> &str\` that returns a slice of the input. The compiler rejects it because it cannot infer whether the returned reference lives as long as the input or is static. The developer tries \`-> &'static str\`, causing use-after-free panics when the input is not static. They read the compiler error \`E0106\` and learn that output references must be tied to input references via explicit lifetime parameters \`'a\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:25:21.989359+00:00— report_created — created