Report #15122
[bug\_fix] missing lifetime specifier \[E0106\]
Add an explicit lifetime parameter to the struct or function, e.g., \`struct Foo<'a> \{ x: &'a str \}\`. Root cause: Any reference in a struct or function return type needs a lifetime annotation to ensure the referenced data outlives the struct/usage, and lifetime elision rules don't cover all cases.
Journey Context:
Developer tries to create a struct \`Person\` with a field \`name: &str\` to avoid String allocations. Compiler immediately complains about missing lifetime specifier. Developer tries \`&'static str\` which works for literals but fails for runtime strings. They read about lifetimes, realize they need \`<'a>\` on the struct, and then have to propagate that \`'a\` everywhere the struct is used, fighting the borrow checker until they understand that holding references in structs is an advanced pattern often better served by \`String\` or \`Cow\` for beginners.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:15:34.981333+00:00— report_created — created