3 ms·
Please note there is an accepted proposal[1] to add an unused keyword, making it possible to detect conflicts between things being marked unused and actually be
by AndyKelley 5y ago
Please note there is an accepted proposal[1] to add an unused keyword, making it possible to detect conflicts between things being marked unused and actually being used, and improving tooling integration.
[1]: https://github.com/ziglang/zig/issues/10245 https://github.com/ziglang/zig/issues/10245
- nicoburns 5y agoI think there should definitely be a global option to disable this during development. This makes temporarily trying something out (e.g commenting out some code to run only part of it) a massive pain, as you have to go up and edit the variable definition as well as the code using it).
- dureuill 5y agoagreed. Rust has a warning for unused items, which is indeed interesting to catch logic errors (variables that should be used, but aren't). No need to fail compilation for this. It is then on you to deny warnings in CI to ensure that they are all handled before the code actually lands
- kaba0 5y agoFully agree. I meet with it mostly in typescript’s linter, but recursively having to comment out things is just simply terrible. Of course it is great for prod, but for debug it is very questionable.
- dnautics 5y agoI like this a lot. Though, many pls offer making the identifier start with _ to make it unused well.