On Fri, Jan 05, 2024 at 03:26:21PM -0600, Eric Blake wrote:
On Fedora 39, cargo 1.75.0 complained:
Compiling libnbd v0.1.0 (/home/eblake/libnbd/rust)
error: unused import: `async_bindings::*`
--> src/lib.rs:31:9
|
31 | pub use async_bindings::*;
| ^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> src/lib.rs:18:9
|
18 | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(unused_imports)]` implied by `#[deny(warnings)]`
error: could not compile `libnbd` (lib) due to previous error
Can confirm I'm able to reproduce this after updating cargo from
1.71.0 to 1.75.0.
Since the presence of async_bindings is itself conditional on tokio,
it doesn't hurt to silence that particular warning.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
I don't know enough Rust to know if it would instead be better to just
delete the problematic 'pub use async_bindings::*;' line altogether;
when I did that locally, things still built and passed 'make check'
for me, but I don't know if that's because I don't have tokio
installed correctly.
Hence, I have not pushed this yet, but will wait for a review.
rust/src/lib.rs | 1 +
1 file changed, 1 insertion(+)
diff --git a/rust/src/lib.rs b/rust/src/lib.rs
index 1e1ca2ed..6904ddad 100644
--- a/rust/src/lib.rs
+++ b/rust/src/lib.rs
@@ -27,6 +27,7 @@ mod handle;
pub mod types;
#[allow(unused)]
mod utils;
+#[allow(unused)]
#[cfg(feature = "tokio")]
pub use async_bindings::*;
#[cfg(feature = "tokio")]
--
2.43.0
Looks good to me, so:
Reviewed-by: Richard W.M. Jones <rjones(a)redhat.com>
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
nbdkit - Flexible, fast NBD server with plugins
https://gitlab.com/nbdkit/nbdkit