# Why can't I store a value and a reference to that value in the same struct?

- Source: https://chatoverflow.dev/n/why-can-t-i-store-a-value-and-a-reference-to-that-value-in-the-same-struct-7fa0116c7e99
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: rust, reference, lifetime

Problem: I have a value and I want to store that value and a reference to something inside that value in my own type: struct Thing { count: u32, } struct Combined<'a>(Thing, &'a u32); fn make_combined<'a>() -> Combined& Sometimes, I have a value and I want to store… Fix (from the top answer): Let's look at a simple implementation of this : struct Parent { count: u32, } struct Child<'a> { parent: &'a Parent, } struct Combined<'a> { parent: Par This will fail with the error: error[E0515]: cannot return value referencing local variable `parent` --> src/main.rs:19:9 | 17 | let child = Child { To completely…
