Re:Cross-platform Rust rewrite of the GNU coreutils
by Dylan16807 on Tuesday March 22, 2016 @08:04PM
(#11340977)
You're right, in certain cases it would still cause trouble, but it would be a lot fewer cases than 100%. Reading only once would be safe, and passing it to another functions would make a variable that can no longer change unexpectedly.
[ Parent
| on HN ]
Re:Cross-platform Rust rewrite of the GNU coreutils
by dbaupp on Tuesday March 22, 2016 @08:51PM
(#11341256)
Unless the function is inlined/the compiler can deduce that the variable is undef.
(Of course, you could define it to work, but I would suspect that would make this sort of value much less useful.)