For those of you who are all like "hey why did you initially try to make it so rust didn't allow variable shadowing?" I present the past 3 hours of hunting down a variable shadowing bug I wrote, that was only caught by a very-downstream integrity assertion.
-
-
C++. I think Rust at least warns by default. There's an extended warning (-Wshadow) but of course it wasn't turned on on this codebase (-Wall doesn't include it). Representative example:https://gist.github.com/graydon/eec72ed4da23ddd156d2642b49d53f26 …
-
Yeah, the unused parameter/unused var/variable never read warnings usually catch this in Rust by default. It is possible to have shadowing bugs, but they’re rarer. There’s a clippy lint for the rest of them: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/shadow.rs …
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.