diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2022-04-29 18:20:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-29 18:20:23 -0400 |
commit | 5c843a1a6e24aeabb3497065a362caf7b3e2d3b1 (patch) | |
tree | 3933db10caabd1ac0f527f8a2e6e7c0d84f63611 /yjit/src/yjit.rs | |
parent | 7c039e423cb59c9e5d76df9f1dc1bf8b1a1b9a6b (diff) | |
download | ruby-5c843a1a6e24aeabb3497065a362caf7b3e2d3b1.tar.gz |
YJIT: Enable default rustc lints (warnings) (#5864)
`rustc` performs in depth dead code analysis and issues warning
even for things like unused struct fields and unconstructed enum
variants. This was annoying for us during the port but hopefully
they are less of an issue now.
This patch enables all the unused warnings we disabled and address
all the warnings we previously ignored. Generally, the approach I've
taken is to use `cfg!` instead of using the `cfg` attribute and
to delete code where it makes sense. I've put `#[allow(unused)]`
on things we intentionally keep around for printf style debugging
and on items that are too annoying to keep warning-free in all
build configs.
Diffstat (limited to 'yjit/src/yjit.rs')
-rw-r--r-- | yjit/src/yjit.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/yjit/src/yjit.rs b/yjit/src/yjit.rs index 24a6b426bf..06e428f34a 100644 --- a/yjit/src/yjit.rs +++ b/yjit/src/yjit.rs @@ -86,8 +86,7 @@ pub extern "C" fn rb_yjit_simulate_oom_bang(_ec: EcPtr, _ruby_self: VALUE) -> VA } // Enabled in debug mode only for security - #[cfg(debug_assertions)] - { + if cfg!(debug_assertions) { let cb = CodegenGlobals::get_inline_cb(); let ocb = CodegenGlobals::get_outlined_cb().unwrap(); cb.set_pos(cb.get_mem_size() - 1); |