Content-Length: 24462 | pFad | https://doc.rust-lang.org/std/string/../error/../string/../thread/../../../error_codes/./E0073.html

E0073 - Error codes index

Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Error code E0073

Note: this error code is no longer emitted by the compiler.

You cannot define a struct (or enum) Foo that requires an instance of Foo in order to make a new Foo value. This is because there would be no way a first instance of Foo could be made to initialize another instance!

Here’s an example of a struct that has this problem:

#![allow(unused)]
fn main() {
struct Foo { x: Box<Foo> } // error
}

One fix is to use Option, like so:

#![allow(unused)]
fn main() {
struct Foo { x: Option<Box<Foo>> }
}

Now it’s possible to create at least one instance of Foo: Foo { x: None }.









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/std/string/../error/../string/../thread/../../../error_codes/./E0073.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy