Merge rust-bitcoin/rust-bitcoin#6847: Manual weekly update to rustc (to nightly-2026-09-05) on master
What changed, and why it matters
This is a routine maintenance update that switches the project's pinned nightly Rust compiler version and makes the small code changes needed to keep the project compiling cleanly under the new compiler and its updated linting/formatting rules. There is no security-relevant change here.
No security action needed. Treat as normal dependency/toolchain maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The merge commit updates the workspace pinned nightly toolchain from nightly-2026-07-02 to nightly-2026-09-05. The child commits are purely mechanical: rustfmt reformatting in crypto/src/key.rs, unrolling a single-element loop in a fuzz target, converting an if-let to a let-else early return in a p2p example, allowing the empty_enums lint for typestate marker enums, allowing deprecated instead of deprecated_in_future for cpufeatures macro internals, and removing .get() calls on NonZeroU64 operands because newer Rust permits using NonZero types directly in integer operations. None of these alter behavior, trust boundaries, or cryptographic logic.
Changed components
Cargo.toml (workspace toolchain/lints)crypto/src/key.rs (formatting only)fuzz/fuzz_targets/units/arbitrary_weight.rs (loop unroll, no behavior change)hashes/src/sha256/crypto/mod.rs (lint annotation update)p2p/examples/ping-pong.rs (control-flow style change)units/src/amount/ops.rs (NonZero .get() removal)units/src/fee_rate/mod.rs (NonZero .get() removal)units/src/weight.rs (NonZero .get() removal)Inspect captured patch +47 / −48
### Cargo.toml
@@ -5,7 +5,7 @@ resolver = "2"
[workspace.metadata]
rbmt.version = "0.5.3"
-rbmt.toolchains.nightly = "nightly-2026-07-02"
+rbmt.toolchains.nightly = "nightly-2026-09-05"
rbmt.toolchains.stable = "1.98.1"
[workspace.lints.rust]
@@ -33,7 +33,7 @@ copy_iterator = "warn"
default_trait_access = "warn"
doc_link_with_quotes = "warn"
doc_markdown = "warn"
-empty_enums = "warn"
+empty_enums = "allow" # Uninstantiable enums are used to mark types, such as Block<Checked> and Block<Unchecked>.
enum_glob_use = "warn"
expl_impl_clone_on_copy = "warn"
explicit_deref_methods = "warn"
### crypto/src/key.rs
@@ -831,9 +831,12 @@ impl FromStr for LegacyPublicKey {
fn from_str(s: &str) -> Result<Self, ParsePublicKeyError> {
fn try_decode<const N: usize>(s: &str) -> Result<LegacyPublicKey, ParsePublicKeyError> {
match hex::decode_to_array::<N>(s) {
- Ok(bytes) => LegacyPublicKey::from_slice(&bytes).map_err(ParsePublicKeyError::Encoding),
- Err(DecodeFixedLengthBytesError::InvalidChar(e)) => Err(ParsePublicKeyError::InvalidChar(e)),
- Err(DecodeFixedLengthBytesError::InvalidLength(_)) => Err(ParsePublicKeyError::InvalidHexLength(s.len())),
+ Ok(bytes) =>
+ LegacyPublicKey::from_slice(&bytes).map_err(ParsePublicKeyError::Encoding),
+ Err(DecodeFixedLengthBytesError::InvalidChar(e)) =>
+ Err(ParsePublicKeyError::InvalidChar(e)),
+ Err(DecodeFixedLengthBytesError::InvalidLength(_)) =>
+ Err(ParsePublicKeyError::InvalidHexLength(s.len())),
}
}
try_decode::<33>(s).or_else(|e| match e {
### fuzz/fuzz_targets/units/arbitrary_weight.rs
@@ -39,12 +39,10 @@ fn do_test(data: &[u8]) {
}
// Constructors that return a Weight
- for constructor in [Weight::from_wu] {
- if let Ok(val) = u.arbitrary() {
- constructor(val);
- } else {
- return;
- }
+ if let Ok(val) = u.arbitrary() {
+ Weight::from_wu(val);
+ } else {
+ return;
}
// Constructors that return an Option<Weight>
### hashes/src/sha256/crypto/mod.rs
@@ -27,32 +27,31 @@ use super::{HashEngine, Midstate, BLOCK_SIZE};
#[cfg(feature = "cpufeatures")]
#[cfg(target_arch = "aarch64")]
-// cpufeatures crate internally uses `u8::max_value()` which will be deprecated.
+// cpufeatures crate internally uses deprecated `u8::max_value()`.
// See: https://docs.rs/cpufeatures/0.2.17/src/cpufeatures/lib.rs.html#161
-#[allow(deprecated_in_future)]
+#[allow(deprecated)]
mod cpuid_sha256_aarch64 {
cpufeatures::new!(inner, "sha2");
pub fn get() -> bool { inner::get() }
}
#[cfg(feature = "cpufeatures")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
-// cpufeatures crate internally uses `u8::max_value()` which will be deprecated.
// See: https://docs.rs/cpufeatures/0.2.17/src/cpufeatures/lib.rs.html#161
-#[allow(deprecated_in_future)]
+#[allow(deprecated)]
mod cpuid_sha256_x86 {
cpufeatures::new!(inner, "sha", "sse2", "ssse3", "sse4.1");
pub fn get() -> bool { inner::get() }
}
#[cfg(feature = "cpufeatures")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
-#[allow(deprecated_in_future)]
+#[allow(deprecated)]
mod cpuid_sse41_x86 {
cpufeatures::new!(inner, "sse2", "ssse3", "sse4.1");
pub fn get() -> bool { inner::get() }
}
#[cfg(feature = "cpufeatures")]
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
-#[allow(deprecated_in_future)]
+#[allow(deprecated)]
mod cpuid_avx2_x86 {
cpufeatures::new!(inner, "avx", "avx2");
pub fn get() -> bool { inner::get() }
### p2p/examples/ping-pong.rs
@@ -44,35 +44,34 @@ fn main() {
let version_message = build_version_message(remote_socket);
let version_message = message::V1NetworkMessage::new(magic, version_message);
- if let Ok(mut stream) = TcpStream::connect(remote_socket) {
- encoding::encode_to_writer(&version_message, &mut stream).unwrap();
-
- let read_stream = stream.try_clone().unwrap();
- let mut stream_reader = BufReader::new(read_stream);
- loop {
- let msg =
- encoding::decode_from_read::<V1NetworkMessage, _>(&mut stream_reader).unwrap();
-
- match msg.payload() {
- message::NetworkMessage::Ping(ping) => {
- println!("got ping {:?}", ping);
- let pong = Pong::from_ping(ping);
- println!("send pong {:?}", pong);
- let net_msg = V1NetworkMessage::new(magic, NetworkMessage::Pong(pong));
- encoding::encode_to_writer(&net_msg, &mut stream).unwrap();
- }
- message::NetworkMessage::SendCmpct(_) => {}
- message::NetworkMessage::Verack => {}
- message::NetworkMessage::Version(_v) => {
- let verack = V1NetworkMessage::new(magic, NetworkMessage::Verack);
- encoding::encode_to_writer(&verack, &mut stream).unwrap();
- }
- message::NetworkMessage::FeeFilter(_f) => {}
- _ => unimplemented!("{:?}", msg.payload()),
+ let Ok(mut stream) = TcpStream::connect(remote_socket) else {
+ eprintln!("failed to open connection");
+ return;
+ };
+ encoding::encode_to_writer(&version_message, &mut stream).unwrap();
+
+ let read_stream = stream.try_clone().unwrap();
+ let mut stream_reader = BufReader::new(read_stream);
+ loop {
+ let msg = encoding::decode_from_read::<V1NetworkMessage, _>(&mut stream_reader).unwrap();
+
+ match msg.payload() {
+ message::NetworkMessage::Ping(ping) => {
+ println!("got ping {:?}", ping);
+ let pong = Pong::from_ping(ping);
+ println!("send pong {:?}", pong);
+ let net_msg = V1NetworkMessage::new(magic, NetworkMessage::Pong(pong));
+ encoding::encode_to_writer(&net_msg, &mut stream).unwrap();
+ }
+ message::NetworkMessage::SendCmpct(_) => {}
+ message::NetworkMessage::Verack => {}
+ message::NetworkMessage::Version(_v) => {
+ let verack = V1NetworkMessage::new(magic, NetworkMessage::Verack);
+ encoding::encode_to_writer(&verack, &mut stream).unwrap();
}
+ message::NetworkMessage::FeeFilter(_f) => {}
+ _ => unimplemented!("{:?}", msg.payload()),
}
- } else {
- eprintln!("failed to open connection");
}
}
### units/src/amount/ops.rs
@@ -101,7 +101,7 @@ crate::internal_macros::impl_op_for_references! {
impl ops::Div<NonZeroU64> for Amount {
type Output = Amount;
- fn div(self, rhs: NonZeroU64) -> Self::Output { Self::from_sat(self.to_sat() / rhs.get()).expect("construction after division cannot fail") }
+ fn div(self, rhs: NonZeroU64) -> Self::Output { Self::from_sat(self.to_sat() / rhs).expect("construction after division cannot fail") }
}
impl ops::Div<NonZeroU64> for NumOpResult<Amount> {
type Output = NumOpResult<Amount>;
@@ -116,7 +116,7 @@ crate::internal_macros::impl_op_for_references! {
impl ops::Rem<NonZeroU64> for Amount {
type Output = Amount;
- fn rem(self, modulus: NonZeroU64) -> Self::Output { Self::from_sat(self.to_sat() % modulus.get()).expect("construction from remainder cannot fail") }
+ fn rem(self, modulus: NonZeroU64) -> Self::Output { Self::from_sat(self.to_sat() % modulus).expect("construction from remainder cannot fail") }
}
impl ops::Rem<u64> for NumOpResult<Amount> {
type Output = NumOpResult<Amount>;
### units/src/fee_rate/mod.rs
@@ -241,7 +241,7 @@ crate::internal_macros::impl_op_for_references! {
impl ops::Div<NonZeroU64> for FeeRate {
type Output = FeeRate;
- fn div(self, rhs: NonZeroU64) -> Self::Output{ Self::from_sat_per_mvb(self.to_sat_per_mvb() / rhs.get()) }
+ fn div(self, rhs: NonZeroU64) -> Self::Output{ Self::from_sat_per_mvb(self.to_sat_per_mvb() / rhs) }
}
}
crate::internal_macros::impl_add_assign!(FeeRate);
### units/src/weight.rs
@@ -255,7 +255,7 @@ crate::internal_macros::impl_op_for_references! {
impl ops::Div<NonZeroU64> for Weight {
type Output = Weight;
- fn div(self, rhs: NonZeroU64) -> Self::Output{ Self::from_wu(self.to_wu() / rhs.get()) }
+ fn div(self, rhs: NonZeroU64) -> Self::Output{ Self::from_wu(self.to_wu() / rhs) }
}
}
crate::internal_macros::impl_add_assign!(Weight);Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.