Skip to content

Commit 16d90d6

Browse files
authored
chore: Bump Rust toolchain to nightly-2025-04-04 (#17752)
* Save work Signed-off-by: Xuanwo <[email protected]> * Save work Signed-off-by: Xuanwo <[email protected]> * Save work Signed-off-by: Xuanwo <[email protected]> --------- Signed-off-by: Xuanwo <[email protected]>
1 parent 5703d16 commit 16d90d6

File tree

85 files changed

+181
-255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+181
-255
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ async_fn_in_trait = "allow"
574574
useless_format = "allow"
575575
mutable_key_type = "allow"
576576
result_large_err = "allow"
577+
map_entry = "allow"
577578

578579
## DONT'T DELETE THIS: If we want best performance, we should use this profile but it will take longer time to compile.
579580
## Test SQL:

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2024-11-28"
2+
channel = "nightly-2025-04-04"
33
components = ["rustfmt", "clippy", "rust-src", "miri", "rust-analyzer"]

src/common/auth/src/auth.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ pub struct TokenFile {
3535

3636
impl TokenFile {
3737
pub fn new(path: &Path) -> Result<Self, Error> {
38-
let token =
39-
std::fs::read_to_string(path).map_err(|err| Error::new(ErrorKind::Other, err))?;
38+
let token = std::fs::read_to_string(path).map_err(Error::other)?;
4039
Ok(Self {
4140
path: path.to_path_buf(),
4241
token,

src/common/base/src/base/dma.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ impl DmaFile {
279279
match rustix::io::write(&self.fd, buf) {
280280
Ok(n) => {
281281
if n != buf.len() {
282-
return Err(io::Error::new(io::ErrorKind::Other, "short write"));
282+
return Err(io::Error::other("short write"));
283283
}
284284
self.mut_buffer().clear();
285285
Ok(n)
@@ -292,7 +292,7 @@ impl DmaFile {
292292
let Self { fd, buf, .. } = self;
293293
let buf = buf.as_mut().unwrap();
294294
if n > buf.capacity() - buf.len() {
295-
return Err(io::Error::new(io::ErrorKind::Other, "buf not sufficient"));
295+
return Err(io::Error::other("buf not sufficient"));
296296
}
297297
let start = buf.len();
298298
unsafe { buf.set_len(buf.len() + n) };
@@ -341,10 +341,7 @@ where
341341
{
342342
match spawn_blocking(f).await {
343343
Ok(res) => res,
344-
Err(_) => Err(io::Error::new(
345-
io::ErrorKind::Other,
346-
"background task failed",
347-
)),
344+
Err(_) => Err(io::Error::other("background task failed")),
348345
}
349346
}
350347

src/common/base/src/obfuscator.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,8 @@ where
311311
let mut hash = std::hash::DefaultHasher::new();
312312
hash.write_u64(seed);
313313

314-
let sliding_window_overflow = if written + sliding_window_size > determinator_size {
315-
written + sliding_window_size - determinator_size
316-
} else {
317-
0
318-
};
314+
let sliding_window_overflow =
315+
(written + sliding_window_size).saturating_sub(determinator_size);
319316

320317
let start = written - sliding_window_overflow;
321318
let end = start + sliding_window_size;

src/common/base/src/runtime/global_runtime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub struct GlobalQueryRuntime(pub Runtime);
2525

2626
impl GlobalQueryRuntime {
2727
#[inline(always)]
28-
pub fn runtime<'a>(self: &'a Arc<Self>) -> &'a Runtime {
28+
pub fn runtime(self: &Arc<Self>) -> &Runtime {
2929
&self.0
3030
}
3131
}

src/common/cloud_control/build.rs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use std::env;
2020
use std::fs;
2121
use std::io::Error;
22-
use std::io::ErrorKind;
2322
use std::io::Result;
2423
use std::path::Path;
2524
use std::process::Command;
@@ -48,32 +47,31 @@ fn build_proto() -> Result<()> {
4847
let output = cmd.output()?;
4948
let version = if output.status.success() {
5049
let content = String::from_utf8_lossy(&output.stdout);
51-
let content = content.trim().split(' ').last().ok_or_else(|| {
52-
Error::new(
53-
ErrorKind::Other,
54-
format!("protoc --version got unexpected output: {}", content),
55-
)
50+
let content = content.trim().split(' ').next_back().ok_or_else(|| {
51+
Error::other(format!(
52+
"protoc --version got unexpected output: {}",
53+
content
54+
))
5655
})?;
5756
lenient_semver::parse(content).map_err(|err| {
58-
Error::new(
59-
ErrorKind::Other,
60-
format!("protoc --version doesn't return valid version: {:?}", err),
61-
)
57+
Error::other(format!(
58+
"protoc --version doesn't return valid version: {:?}",
59+
err
60+
))
6261
})?
6362
} else {
64-
return Err(Error::new(
65-
ErrorKind::Other,
66-
format!("protoc failed: {}", String::from_utf8_lossy(&output.stderr)),
67-
));
63+
return Err(Error::other(format!(
64+
"protoc failed: {}",
65+
String::from_utf8_lossy(&output.stderr)
66+
)));
6867
};
6968

7069
let mut config = prost_build::Config::new();
7170
config.btree_map(["."]);
7271

7372
// Version before 3.12 doesn't support allow_proto3_optional
7473
if version < Version::new(3, 12, 0) {
75-
return Err(Error::new(
76-
ErrorKind::Other,
74+
return Err(Error::other(
7775
format!(
7876
"protoc version is outdated, expect: >= 3.12.0, actual: {version}, reason: need feature --experimental_allow_proto3_optional"
7977
),

src/common/cloud_control/tests/it/task_client.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,7 @@ async fn test_task_client_success_cases() -> Result<()> {
179179
if let Some(client) = client {
180180
Ok(client)
181181
} else {
182-
Err(std::io::Error::new(
183-
std::io::ErrorKind::Other,
184-
"Client already taken",
185-
))
182+
Err(std::io::Error::other("Client already taken"))
186183
}
187184
}
188185
}))

src/common/column/src/binview/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl<T: ViewType + ?Sized> BinaryViewColumnBuilder<T> {
197197
self.push_value(value);
198198
let value = self.views.pop().unwrap();
199199
self.total_bytes_len = old_bytes_len + value.length as usize * additional;
200-
self.views.extend(std::iter::repeat(value).take(additional));
200+
self.views.extend(std::iter::repeat_n(value, additional));
201201
}
202202

203203
#[inline]

src/common/column/src/binview/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ impl<T: ViewType + ?Sized> BinaryViewColumnGeneric<T> {
345345
}
346346

347347
pub fn is_sliced(&self) -> bool {
348-
self.views.as_ptr() != self.views.data_ptr()
348+
!std::ptr::eq(self.views.as_ptr(), self.views.data_ptr())
349349
}
350350

351351
fn slice(&mut self, offset: usize, length: usize) {

0 commit comments

Comments
 (0)