From c9c1697a0f821180bb7f786f48a655b4cdf7a961 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 11 Jul 2024 10:11:09 -0700 Subject: [PATCH] Resolve dead_code and unused_variables warnings Summary: Rust 1.79's dead code scanner is more precise than previous versions. `pub` is no longer sufficient to hide a data structure field from the lint. It actually looks at whether an unused pub field is reachable from outside the crate. In the following example, the field `field` is considered dead code by Rust 1.79 and not by 1.78. ```lang=rust mod module { pub struct Struct { pub field: i32, } impl Struct { pub fn new() -> Self { Struct { field: 0 } } } } pub fn repro() { let _ = Struct::new(); } ``` Reviewed By: zertosh, JakobDegen Differential Revision: D59623034 fbshipit-source-id: 6a4e2fb6e5be410d5127b451704df74ecdd42bf0 --- reverie-ptrace/src/gdbstub/session.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/reverie-ptrace/src/gdbstub/session.rs b/reverie-ptrace/src/gdbstub/session.rs index 3a7df3b..8864bce 100644 --- a/reverie-ptrace/src/gdbstub/session.rs +++ b/reverie-ptrace/src/gdbstub/session.rs @@ -60,6 +60,7 @@ pub struct Session { pub stream_tx: BoxWriter, /// buffer use to send data over to tcp stream + #[allow(dead_code)] pub tx_buf: BytesMut, /// Gdb remote protocol command notifier.