From 093f8c5f45e8a5d86730ad4363b7eb45045314ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arpad=20M=C3=BCller?= Date: Tue, 17 Oct 2023 14:13:12 +0200 Subject: [PATCH] Update rust to 1.73.0 (#5574) [Release notes](https://blog.rust-lang.org/2023/10/05/Rust-1.73.0.html) --- libs/metrics/src/wrappers.rs | 16 ++++++++-------- pageserver/src/tenant/ephemeral_file.rs | 3 +-- .../src/tenant/storage_layer/remote_layer.rs | 2 +- proxy/src/sasl/messages.rs | 2 +- rust-toolchain.toml | 2 +- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/libs/metrics/src/wrappers.rs b/libs/metrics/src/wrappers.rs index 1bf1ea0753..c3959cbf16 100644 --- a/libs/metrics/src/wrappers.rs +++ b/libs/metrics/src/wrappers.rs @@ -1,6 +1,6 @@ use std::io::{Read, Result, Write}; -/// A wrapper for an object implementing [Read](std::io::Read) +/// A wrapper for an object implementing [Read] /// which allows a closure to observe the amount of bytes read. /// This is useful in conjunction with metrics (e.g. [IntCounter](crate::IntCounter)). /// @@ -51,17 +51,17 @@ impl<'a, T> CountedReader<'a, T> { } } - /// Get an immutable reference to the underlying [Read](std::io::Read) implementor + /// Get an immutable reference to the underlying [Read] implementor pub fn inner(&self) -> &T { &self.reader } - /// Get a mutable reference to the underlying [Read](std::io::Read) implementor + /// Get a mutable reference to the underlying [Read] implementor pub fn inner_mut(&mut self) -> &mut T { &mut self.reader } - /// Consume the wrapper and return the underlying [Read](std::io::Read) implementor + /// Consume the wrapper and return the underlying [Read] implementor pub fn into_inner(self) -> T { self.reader } @@ -75,7 +75,7 @@ impl Read for CountedReader<'_, T> { } } -/// A wrapper for an object implementing [Write](std::io::Write) +/// A wrapper for an object implementing [Write] /// which allows a closure to observe the amount of bytes written. /// This is useful in conjunction with metrics (e.g. [IntCounter](crate::IntCounter)). /// @@ -122,17 +122,17 @@ impl<'a, T> CountedWriter<'a, T> { } } - /// Get an immutable reference to the underlying [Write](std::io::Write) implementor + /// Get an immutable reference to the underlying [Write] implementor pub fn inner(&self) -> &T { &self.writer } - /// Get a mutable reference to the underlying [Write](std::io::Write) implementor + /// Get a mutable reference to the underlying [Write] implementor pub fn inner_mut(&mut self) -> &mut T { &mut self.writer } - /// Consume the wrapper and return the underlying [Write](std::io::Write) implementor + /// Consume the wrapper and return the underlying [Write] implementor pub fn into_inner(self) -> T { self.writer } diff --git a/pageserver/src/tenant/ephemeral_file.rs b/pageserver/src/tenant/ephemeral_file.rs index 5b99a1dd03..9a06d9df61 100644 --- a/pageserver/src/tenant/ephemeral_file.rs +++ b/pageserver/src/tenant/ephemeral_file.rs @@ -354,8 +354,7 @@ mod tests { } // Test a large blob that spans multiple pages - let mut large_data = Vec::new(); - large_data.resize(20000, 0); + let mut large_data = vec![0; 20000]; thread_rng().fill_bytes(&mut large_data); let pos_large = file.write_blob(&large_data, &ctx).await?; let result = file.block_cursor().read_blob(pos_large, &ctx).await?; diff --git a/pageserver/src/tenant/storage_layer/remote_layer.rs b/pageserver/src/tenant/storage_layer/remote_layer.rs index cafe5f6bb6..94bebb5f6e 100644 --- a/pageserver/src/tenant/storage_layer/remote_layer.rs +++ b/pageserver/src/tenant/storage_layer/remote_layer.rs @@ -25,7 +25,7 @@ use super::{ }; /// RemoteLayer is a not yet downloaded [`ImageLayer`] or -/// [`DeltaLayer`](super::DeltaLayer). +/// [`DeltaLayer`]. /// /// RemoteLayer might be downloaded on-demand during operations which are /// allowed download remote layers and during which, it gets replaced with a diff --git a/proxy/src/sasl/messages.rs b/proxy/src/sasl/messages.rs index fb3833c8b6..b9208f6f1f 100644 --- a/proxy/src/sasl/messages.rs +++ b/proxy/src/sasl/messages.rs @@ -31,7 +31,7 @@ impl<'a> FirstMessage<'a> { /// A single SASL message. /// This struct is deliberately decoupled from lower-level -/// [`BeAuthenticationSaslMessage`](pq_proto::BeAuthenticationSaslMessage). +/// [`BeAuthenticationSaslMessage`]. #[derive(Debug)] pub(super) enum ServerMessage { /// We expect to see more steps. diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 9cc47ec039..ca12f0dee5 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.72.1" +channel = "1.73.0" profile = "default" # The default profile includes rustc, rust-std, cargo, rust-docs, rustfmt and clippy. # https://rust-lang.github.io/rustup/concepts/profiles.html