& Confusion again : Even The Book gets it wrong?


In my studies of The Book I arrived at chapter 18.3, “Destructuring References”.


It is stated here, that the & Operator is required in the definition of the closure, to prevent a compiler error. Confused again, I tried to omit the &, and (not really) surprise : the code works perfectly without it. (Tested in the Rust Playground)

I suspect, that the error producing compiler was an outdated version.

1 Like

&Point is correct. The Point syntax is now also accepted thanks to silent error correction that has been added as part of “match ergonomics”:

It looks like the book has been updated recently to reflect that:



Really great :+1:. I will continue my reading with the ‘Nightly’ version, of course.


Just to add to this, this particular feature is called “default match bindings” and introduced in the 2018 edition guide.

1 Like