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

Functional Record Update

In this step we desugar Functional Record Update syntax:

#![allow(unused)]
fn main() {
// Assume `Struct` has 4 fields named a,b,c,d
x = Struct { a: $expr_a, b: $expr_b, ..$place };

// becomes:
x = Struct { a: $expr_a, b: $expr_b, c: $place.c, d: $place.d };
}

This is correct because ..$expr is a place context and we've already made sure that all place context contain side-effect free place expressions.