Merge rust-bitcoin/rust-bitcoin#7029: Automated nightly rustfmt (2026-10-11)
What changed, and why it matters
This is a purely cosmetic code-formatting commit. A bot ran the nightly rustfmt tool and re-indented or rewrapped lines in four source files. No program logic, security checks, or behavior were changed.
No security action needed. Treat as routine formatting cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
Commit d57db70813d3de9fef97ae57c0847bef0eca709f merges an automated rustfmt run. The diff shows only whitespace, import reordering, comment alignment, and brace-style changes produced by rustfmt. No functional code, unsafe blocks, arithmetic, bounds checks, or API signatures were modified.
Changed components
internals/src/array_vec.rsinternals/src/script.rsinternals/src/slice.rsprimitives/src/script/mod.rsInspect captured patch +26 / −39
### internals/src/array_vec.rs
@@ -5,20 +5,20 @@
use core::fmt;
use core::mem::MaybeUninit;
-pub use error::CapacityExceededError;
-pub use safety_boundary::ArrayVec;
#[cfg(creusot)]
use creusot_std::prelude::*;
+pub use error::CapacityExceededError;
+pub use safety_boundary::ArrayVec;
/// Limits the scope of `unsafe` auditing.
// New trait impls and fns that don't need to access internals should go below the module, not
// inside it!
mod safety_boundary {
+ use core::mem::MaybeUninit;
+
#[cfg(creusot)]
use creusot_std::prelude::*;
- use core::mem::MaybeUninit;
-
/// A growable contiguous collection backed by array.
#[derive(Copy)]
pub struct ArrayVec<T: Copy, const CAP: usize> {
@@ -63,7 +63,9 @@ mod safety_boundary {
pub const fn as_slice(&self) -> &[T] {
// SAFETY: self.len is chosen such that everything is initialized up to len
unsafe {
- if self.len > CAP { core::hint::unreachable_unchecked() }
+ if self.len > CAP {
+ core::hint::unreachable_unchecked()
+ }
super::slice_assume_init_ref(self.data.split_at(self.len).0)
}
}
@@ -80,7 +82,9 @@ mod safety_boundary {
pub fn as_mut_slice(&mut self) -> &mut [T] {
// SAFETY: self.len is chosen such that everything is initialized up to len
unsafe {
- if self.len > CAP { core::hint::unreachable_unchecked() }
+ if self.len > CAP {
+ core::hint::unreachable_unchecked()
+ }
super::slice_assume_init_mut(self.data.split_at_mut(self.len).0)
}
}
@@ -115,16 +119,12 @@ mod safety_boundary {
#[cfg(creusot)]
#[logic(inline)]
#[ensures(inv(self) ==> result.len() == CAP@)]
- pub fn buf_view(self) -> Seq<MaybeUninit<T>> {
- self.data.view()
- }
+ pub fn buf_view(self) -> Seq<MaybeUninit<T>> { self.data.view() }
#[cfg(creusot)]
#[logic]
#[ensures(inv(self) ==> result <= CAP@)]
- pub fn len_view(self) -> Int {
- self.len.view()
- }
+ pub fn len_view(self) -> Int { self.len.view() }
}
#[cfg(creusot)]
@@ -299,9 +299,7 @@ impl<T: Copy, const CAP: usize> ArrayVec<T, CAP> {
#[cfg_attr(creusot, requires(slice@.len() <= CAP@ - self@.len()))]
#[cfg_attr(creusot, ensures((^self)@ == (*self)@.concat(slice@)))]
pub fn extend_from_slice(&mut self, slice: &[T]) {
- let dst = self.spare_capacity_mut()
- .get_mut(..slice.len())
- .expect("buffer overflow");
+ let dst = self.spare_capacity_mut().get_mut(..slice.len()).expect("buffer overflow");
write_copy_of_slice(dst, slice);
let old_len = self.len();
unsafe { self.set_len(old_len + slice.len()) }
@@ -432,6 +430,7 @@ impl<T: Copy + core::hash::Hash, const CAP: usize> core::hash::Hash for ArrayVec
/// Error types for `ArrayVec`.
pub mod error {
use core::fmt;
+
#[cfg(creusot)]
use creusot_std::prelude::*;
#[cfg(creusot)]
@@ -464,9 +463,7 @@ pub mod error {
type DeepModelTy = Self;
#[logic]
- fn deep_model(self) -> Self::DeepModelTy {
- self
- }
+ fn deep_model(self) -> Self::DeepModelTy { self }
}
}
### internals/src/script.rs
@@ -69,16 +69,12 @@ impl PushDataLenLen {
impl Ord for PushDataLenLen {
#[cfg_attr(creusot, ensures(result == (*self).deep_model().cmp_log((*other).deep_model())))]
- fn cmp(&self, other: &Self) -> core::cmp::Ordering {
- self.to_usize().cmp(&other.to_usize())
- }
+ fn cmp(&self, other: &Self) -> core::cmp::Ordering { self.to_usize().cmp(&other.to_usize()) }
}
impl PartialOrd for PushDataLenLen {
#[cfg_attr(creusot, ensures(result == (*self).deep_model().partial_cmp_log((*other).deep_model())))]
- fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
- Some(self.cmp(other))
- }
+ fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> { Some(self.cmp(other)) }
}
#[cfg(creusot)]
@@ -100,9 +96,7 @@ impl DeepModel for PushDataLenLen {
type DeepModelTy = Int;
#[logic(open, inline)]
- fn deep_model(self) -> Self::DeepModelTy {
- self.view()
- }
+ fn deep_model(self) -> Self::DeepModelTy { self.view() }
}
/// Indicates that we tried to read more bytes from the script than available.
### internals/src/slice.rs
@@ -57,7 +57,7 @@ pub trait SliceExt {
///
/// Returns `None` if the slice is shorter than `ARRAY_LEN`
#[allow(clippy::type_complexity)] // it's not really complex and redefining would make it
- // harder to understand
+ // harder to understand
#[cfg_attr(creusot, ensures(match result {
Some((arr, remainder)) => arr@ == self.view2().subsequence(0, ARRAY_LEN@) && remainder@ == self.view2().subsequence(ARRAY_LEN@, self.view2().len()),
None => ARRAY_LEN@ > self.view2().len(),
@@ -70,7 +70,7 @@ pub trait SliceExt {
///
/// Returns `None` if the slice is shorter than `ARRAY_LEN`
#[allow(clippy::type_complexity)] // it's not really complex and redefining would make it
- // harder to understand
+ // harder to understand
#[cfg_attr(creusot, ensures(match result {
Some((remainder, arr)) => arr@ == self.view2().subsequence(self.view2().len() - ARRAY_LEN@, self.view2().len()) && remainder@ == self.view2().subsequence(0, self.view2().len() - ARRAY_LEN@),
None => ARRAY_LEN@ > self.view2().len(),
@@ -85,9 +85,7 @@ impl<T> SliceExt for [T] {
#[cfg(creusot)]
#[logic(open, inline)]
- fn view2(self) -> Seq<Self::Item> {
- <Self as View>::view(self)
- }
+ fn view2(self) -> Seq<Self::Item> { <Self as View>::view(self) }
// Sadly, creusot doesn't support pointer casts yet, so we can't prove this
#[cfg_attr(creusot, trusted)]
### primitives/src/script/mod.rs
@@ -335,13 +335,11 @@ impl<T> fmt::Display for Script<T> {
macro_rules! read_push_data_len {
($iter:expr, $size:path, $formatter:expr) => {
match script::read_push_data_len($iter, $size) {
- Ok(n) => {
- match usize::try_from(n) {
- Ok(n) => n,
- Err(_) => {
- $formatter.write_str("<push past end>")?;
- break;
- }
+ Ok(n) => match usize::try_from(n) {
+ Ok(n) => n,
+ Err(_) => {
+ $formatter.write_str("<push past end>")?;
+ break;
}
},
Err(_) => {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.