Specify the minimum Rust version (1.69) in rust/Cargo.toml. Previously,
trying to compile with an older Rust toolchain caused various
compilation errors which were hard to interpret. Now the cause of the
error will be much more clear.
---
rust/Cargo.toml | 4 ++++
rust/cargo_test/Cargo.toml | 1 +
rust/libnbd-sys/Cargo.toml | 1 +
rust/tests/test_220_opt_list.rs | 2 +-
rust/tests/test_240_opt_list_meta.rs | 2 +-
rust/tests/test_245_opt_list_meta_queries.rs | 2 +-
rust/tests/test_250_opt_set_meta.rs | 2 +-
rust/tests/test_255_opt_set_meta_queries.rs | 2 +-
rust/tests/test_460_block_status.rs | 2 +-
9 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index 04e371e..9ac6e53 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -20,7 +20,10 @@
[workspace.package]
authors = ["Tage Johansson"]
version = "0.1.0"
+# Make sure that the values of the edition and rust-version fields in
+# rust_test/Cargo.toml matches the values here.
edition = "2021"
+rust-version = "1.69"
description = "Rust bindings for libnbd, a client library for controlling block
devices over a network."
license = "LGPL-2.1-only"
keywords = ["libnbd", "block-device", "network"]
@@ -31,6 +34,7 @@ name = "libnbd"
authors.workspace = true
version.workspace = true
edition.workspace = true
+rust-version.workspace = true
description.workspace = true
license.workspace = true
keywords.workspace = true
diff --git a/rust/cargo_test/Cargo.toml b/rust/cargo_test/Cargo.toml
index 9f9d478..ffe88c1 100644
--- a/rust/cargo_test/Cargo.toml
+++ b/rust/cargo_test/Cargo.toml
@@ -20,4 +20,5 @@
[package]
name = "cargo_test"
edition = "2021"
+rust-version = "1.69"
version = "0.1.0"
diff --git a/rust/libnbd-sys/Cargo.toml b/rust/libnbd-sys/Cargo.toml
index 3fa581f..3f09f1b 100644
--- a/rust/libnbd-sys/Cargo.toml
+++ b/rust/libnbd-sys/Cargo.toml
@@ -18,6 +18,7 @@
[package]
name = "libnbd-sys"
version.workspace = true
+rust-version.workspace = true
edition.workspace = true
description.workspace = true
license.workspace = true
diff --git a/rust/tests/test_220_opt_list.rs b/rust/tests/test_220_opt_list.rs
index 180a95b..28d4db9 100644
--- a/rust/tests/test_220_opt_list.rs
+++ b/rust/tests/test_220_opt_list.rs
@@ -66,7 +66,7 @@ impl ConnTester {
.push(String::from_utf8(name.to_owned()).unwrap());
0
})?;
- let exports = Arc::into_inner(exports).unwrap().into_inner().unwrap();
+ let exports = Arc::try_unwrap(exports).unwrap().into_inner().unwrap();
assert_eq!(exports.len(), count as usize);
assert_eq!(exports.len(), expected_exports.len());
for (export, &expected) in exports.iter().zip(expected_exports) {
diff --git a/rust/tests/test_240_opt_list_meta.rs b/rust/tests/test_240_opt_list_meta.rs
index 5598458..cc0310d 100644
--- a/rust/tests/test_240_opt_list_meta.rs
+++ b/rust/tests/test_240_opt_list_meta.rs
@@ -43,7 +43,7 @@ fn list_meta_ctxs(nbd: &libnbd::Handle) ->
libnbd::Result<CtxInfo> {
}
0
})?;
- let info = Arc::into_inner(info).unwrap().into_inner().unwrap();
+ let info = Arc::try_unwrap(info).unwrap().into_inner().unwrap();
assert_eq!(info.count, replies);
Ok(info)
}
diff --git a/rust/tests/test_245_opt_list_meta_queries.rs
b/rust/tests/test_245_opt_list_meta_queries.rs
index da5c674..d6409e5 100644
--- a/rust/tests/test_245_opt_list_meta_queries.rs
+++ b/rust/tests/test_245_opt_list_meta_queries.rs
@@ -46,7 +46,7 @@ fn list_meta_ctxs(
}
0
})?;
- let info = Arc::into_inner(info).unwrap().into_inner().unwrap();
+ let info = Arc::try_unwrap(info).unwrap().into_inner().unwrap();
assert_eq!(info.count, replies);
Ok(info)
}
diff --git a/rust/tests/test_250_opt_set_meta.rs b/rust/tests/test_250_opt_set_meta.rs
index c7a8144..26d82e5 100644
--- a/rust/tests/test_250_opt_set_meta.rs
+++ b/rust/tests/test_250_opt_set_meta.rs
@@ -44,7 +44,7 @@ fn set_meta_ctxs(nbd: &libnbd::Handle) ->
libnbd::Result<CtxInfo> {
}
0
})?;
- let info = Arc::into_inner(info).unwrap().into_inner().unwrap();
+ let info = Arc::try_unwrap(info).unwrap().into_inner().unwrap();
assert_eq!(info.count, replies);
Ok(info)
}
diff --git a/rust/tests/test_255_opt_set_meta_queries.rs
b/rust/tests/test_255_opt_set_meta_queries.rs
index 143a2f1..87f8d6a 100644
--- a/rust/tests/test_255_opt_set_meta_queries.rs
+++ b/rust/tests/test_255_opt_set_meta_queries.rs
@@ -47,7 +47,7 @@ fn set_meta_ctxs_queries(
}
0
})?;
- let info = Arc::into_inner(info).unwrap().into_inner().unwrap();
+ let info = Arc::try_unwrap(info).unwrap().into_inner().unwrap();
assert_eq!(info.count, replies);
Ok(info)
}
diff --git a/rust/tests/test_460_block_status.rs b/rust/tests/test_460_block_status.rs
index 7cdcb34..6b53ba9 100644
--- a/rust/tests/test_460_block_status.rs
+++ b/rust/tests/test_460_block_status.rs
@@ -43,7 +43,7 @@ fn block_status_get_entries(
flags,
)
.unwrap();
- Arc::into_inner(entries)
+ Arc::try_unwrap(entries)
.unwrap()
.into_inner()
.unwrap()
--
2.41.0