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.
-
-
Replying to @graydon_pub
Could you briefly share relevant details (or a link, if public)? I've been on a hunt w.r.t. "shadowing warnings are annoying as _heck_, I wonder what sort of bugs they actually prevent" for some time now.
1 reply 0 retweets 3 likes -
Replying to @glaebhoerl
In this case, moved some “self contained” lines of code (that happen to bind and use a local temporary foo) into a function that had foo as a parameter name. Parameter now silently ignored in favor of local.
3 replies 0 retweets 5 likes -
Replying to @graydon_pub @glaebhoerl
(in old lines of function, following the new lines)
1 reply 0 retweets 0 likes -
-
Replying to @pcwalton @glaebhoerl
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 …
2 replies 0 retweets 1 like -
(It's a dismaying part of how life has turned out that after all that work, I rarely get to use Rust outside of hobby projects. Probably another good argument for why I ought to keep my mouth shut on further points of technical design. I'm sorry about today.)
1 reply 0 retweets 5 likes
No, I’m sorry!
-
-
Replying to @pcwalton @glaebhoerl
The dreaded who-is-sorrier loop. Canadians can get trapped in these things for years if we're not careful; luckily you are from Texas.
1 reply 0 retweets 20 likes -
I’m sorry that we do!
0 replies 0 retweets 1 like
End of conversation
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.