Content-Length: 12845 | pFad | https://doc.rust-lang.org/std/pin/../hash/../../std/sync/../../../std/../error_codes/./E0797.html

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

Struct update syntax was used without a base expression.

Erroneous code example:

#![allow(unused)]
fn main() {
struct Foo {
    fizz: u8,
    buzz: u8
}

let f1 = Foo { fizz: 10, buzz: 1};
let f2 = Foo { fizz: 10, .. }; // error
}

Using struct update syntax requires a 'base expression'. This will be used to fill remaining fields.

#![allow(unused)]
fn main() {
struct Foo {
    fizz: u8,
    buzz: u8
}

let f1 = Foo { fizz: 10, buzz: 1};
let f2 = Foo { fizz: 10, ..f1 };
}








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/pin/../hash/../../std/sync/../../../std/../error_codes/./E0797.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy