blob: b6e12eb7a2bd8c0f12f9563bab50ab0795118648 (
plain) (
tree)
|
|
//! Example of how Rust requires the use of a Cell to build a self-referential
//! struct.
//!
//! NOTE: Also in top-level crate documentation. Keep 'em in sync.
struct MySelfRefStruct<'this> {
this: &'this MySelfRefStruct<'this>,
}
fn main() {
let x = MySelfRefStruct { this: &x };
}
|