# Show warning only when let variable is modified

**URL:** <https://internals.rust-lang.org/t/show-warning-only-when-let-variable-is-modified/7399>\
**Category:** language design\
**Created:** [April 26, 2018, 1:20am UTC](https://internals.rust-lang.org/t/show-warning-only-when-let-variable-is-modified/7399 "2018-04-26T01:20:21Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Centril](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/centril/32/3334_2.png) [@Centril](https://internals.rust-lang.org/u/Centril)\
**Post date:** [April 26, 2018, 6:49am UTC](https://internals.rust-lang.org/t/show-warning-only-when-let-variable-is-modified/7399/10 "2018-04-26T06:49:32Z")

</div>

@ExpHP I think you are mostly right in the sense that `let foo = bar;` isn’t actually an immutable binding and that you can mutate the contents of `foo` by moving ownership away from `foo` simply with `identity(foo).mutate_and_stuff();`.

But I think you are putting things too strongly. I do think the current situation does protect you from a certain class of mistakes by making you more conscious of mutation. That said, if you truly want immutable bindings, you’d need something like `freeze T` as we discussed at [Forever immutable owned values](https://internals.rust-lang.org/t/forever-immutable-owned-values/6807) (modulo interior mutability).

---

_[View the full topic](https://internals.rust-lang.org/t/show-warning-only-when-let-variable-is-modified/7399)._
