mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Ignore return value of into_raw_fd
Fix as the compiler orders: ``` warning: unused return value of `into_raw_fd` that must be used --> ../src/yjit/src/disasm.rs:123:21 | 123 | file.into_raw_fd(); // keep the fd open | ^^^^^^^^^^^^^^^^^^ | = note: losing the raw file descriptor may leak resources = note: `#[warn(unused_must_use)]` on by default help: use `let _ = ...` to ignore the resulting value | 123 | let _ = file.into_raw_fd(); // keep the fd open | +++++++ warning: unused return value of `into_raw_fd` that must be used --> ../src/yjit/src/log.rs:84:21 | 84 | file.into_raw_fd(); // keep the fd open | ^^^^^^^^^^^^^^^^^^ | = note: losing the raw file descriptor may leak resources help: use `let _ = ...` to ignore the resulting value | 84 | let _ = file.into_raw_fd(); // keep the fd open | +++++++ ```
This commit is contained in:
parent
ab7ab9e450
commit
c690ca03f3
Notes:
git
2024-11-06 03:37:31 +00:00
2 changed files with 2 additions and 2 deletions
|
@ -120,7 +120,7 @@ pub fn dump_disasm_addr_range(cb: &CodeBlock, start_addr: CodePtr, end_addr: Cod
|
|||
// Write with the fd opened during boot
|
||||
let mut file = unsafe { std::fs::File::from_raw_fd(*fd) };
|
||||
file.write_all(disasm.as_bytes()).unwrap();
|
||||
file.into_raw_fd(); // keep the fd open
|
||||
let _ = file.into_raw_fd(); // keep the fd open
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ impl Log {
|
|||
let mut file = unsafe { std::fs::File::from_raw_fd(fd) };
|
||||
writeln!(file, "{}", entry).unwrap();
|
||||
file.flush().unwrap();
|
||||
file.into_raw_fd(); // keep the fd open
|
||||
let _ = file.into_raw_fd(); // keep the fd open
|
||||
}
|
||||
|
||||
LogOutput::MemoryOnly => () // Don't print or write anything
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue