5 ms·
Dealbreaker? This just means you need to play with let bindings a little bit until they improve it at some point. (Same goes for SEME regions.)
by ewillbefull 11y ago
Dealbreaker? This just means you need to play with let bindings a little bit until they improve it at some point. (Same goes for SEME regions.)
- IsTom 11y agoIt makes array use really awkward in my experience.
- notriddle 11y agoNon-lexical scope won't help with that. Remember that Rust does not allow mutable aliasing, so this code can never be allowed: let mut arr = [1, 2]; let a = &mut arr[0]; let b = &mut arr[0]; This code could be allowed: let mut arr = [1, 2]; let a = &mut arr[0]; let b = &mut arr[1]; And it gets Hard once variable indexes are involved. And since the whole point of using arrays is to get variable indexing, the Rust developers choose to only implement reborrowing for structs and tuples.