Content-Length: 24145 | pFad | https://doc.rust-lang.org/std/iter/../convert/../../std/../std/../error_codes/././E0609.html

E0609 - 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 E0609

Attempted to access a nonexistent field in a struct.

Erroneous code example:

#![allow(unused)]
fn main() {
struct StructWithFields {
    x: u32,
}

let s = StructWithFields { x: 0 };
println!("{}", s.foo); // error: no field `foo` on type `StructWithFields`
}

To fix this error, check that you didn’t misspell the field’s name or that the field actually exists. Example:

#![allow(unused)]
fn main() {
struct StructWithFields {
    x: u32,
}

let s = StructWithFields { x: 0 };
println!("{}", s.x); // ok!
}








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/iter/../convert/../../std/../std/../error_codes/././E0609.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy