rust-unofficial / too-many-lists

Learn Rust by writing Entirely Too Many linked lists
https://rust-unofficial.github.io/too-many-lists/
MIT License
3.22k stars 281 forks source link

fixed mistake in "testing stacked borrows" #227

Closed karakoz closed 2 years ago

karakoz commented 2 years ago

There was code and resulting error message mismatch: code was let sref3 = &*mref1; and error is casting&&mut i32as*mut i32is invalid. Then the phrase goes: Let's properly reborrow it with let sref3 = &mref1 But it should be the opposite: let sref3 = &mref1; gives &&mut i32