|
|
От: |
Эйнсток Файр
|
Странный реагент |
| Дата: | 29.11.21 21:58 | ||
| Оценка: | |||
// Rust C/C++
a: &T == const T* const a; // can't mutate either
mut a: &T == const T* a; // can't mutate what is pointed to
a: &mut T == T* const a; // can't mutate pointer
mut a: &mut T == T* a; // can mutate botherror[E0384]: cannot assign twice to immutable variable `x`
Multiple variables can be defined with the same name, known as shadowing.