diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-01-10 08:00:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-10 11:00:25 -0500 |
commit | 6a585dbd5a41d5a9e0a8e406fef133e89bafb832 (patch) | |
tree | 2650388d8f79f974568c8ff24e2c783899ed228a | |
parent | be1db1ca5cce4f2a6e64958e9f36e8b2ba907168 (diff) | |
download | ruby-6a585dbd5a41d5a9e0a8e406fef133e89bafb832.tar.gz |
YJIT: Fix a compilation warning with release build (#7092)
warning: unused variable: `start_addr`
--> ../yjit/src/asm/mod.rs:359:39
|
359 | pub fn remove_comments(&mut self, start_addr: CodePtr, end_addr: CodePtr) {
| ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_start_addr`
|
= note: `#[warn(unused_variables)]` on by default
warning: unused variable: `end_addr`
--> ../yjit/src/asm/mod.rs:359:60
|
359 | pub fn remove_comments(&mut self, start_addr: CodePtr, end_addr: CodePtr) {
|
-rw-r--r-- | yjit/src/asm/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/yjit/src/asm/mod.rs b/yjit/src/asm/mod.rs index 586b01243d..a5ef8dcf4f 100644 --- a/yjit/src/asm/mod.rs +++ b/yjit/src/asm/mod.rs @@ -356,12 +356,15 @@ impl CodeBlock { self.asm_comments.get(&pos) } + #[cfg(feature = "disasm")] pub fn remove_comments(&mut self, start_addr: CodePtr, end_addr: CodePtr) { - #[cfg(feature = "disasm")] for addr in start_addr.into_usize()..end_addr.into_usize() { self.asm_comments.remove(&addr); } } + #[cfg(not(feature = "disasm"))] + #[inline] + pub fn remove_comments(&mut self, _: CodePtr, _: CodePtr) {} pub fn clear_comments(&mut self) { #[cfg(feature = "disasm")] |