Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update toolchain to 2024-12-25 #5430

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 85 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2024-10-19"
channel = "nightly-2024-12-25"
components = ["rust-analyzer", "llvm-tools"]
2 changes: 1 addition & 1 deletion src/api/src/v1/column_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub fn options_from_column_schema(column_schema: &ColumnSchema) -> Option<Column
pub fn contains_fulltext(options: &Option<ColumnOptions>) -> bool {
options
.as_ref()
.map_or(false, |o| o.options.contains_key(FULLTEXT_GRPC_KEY))
.is_some_and(|o| o.options.contains_key(FULLTEXT_GRPC_KEY))
}

/// Tries to construct a `ColumnOptions` from the given `FulltextOptions`.
Expand Down
2 changes: 1 addition & 1 deletion src/catalog/src/kvbackend/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ impl KvBackend for CachedKvBackend {
.lock()
.unwrap()
.as_ref()
.map_or(false, |v| !self.validate_version(*v))
.is_some_and(|v| !self.validate_version(*v))
{
self.cache.invalidate(key).await;
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/datasource/src/file_format/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct Test<'a, T: FileOpener> {
expected: Vec<&'a str>,
}

impl<'a, T: FileOpener> Test<'a, T> {
impl<T: FileOpener> Test<'_, T> {
pub async fn run(self) {
let result = FileStream::new(
&self.config,
Expand Down
2 changes: 1 addition & 1 deletion src/common/decimal/src/decimal128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl FromStr for Decimal128 {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
let len = s.as_bytes().len();
let len = s.len();
if len <= BYTES_TO_OVERFLOW_RUST_DECIMAL {
let rd = RustDecimal::from_str_exact(s).context(ParseRustDecimalStrSnafu { raw: s })?;
Ok(Self::from(rd))
Expand Down
2 changes: 1 addition & 1 deletion src/common/meta/src/ddl/drop_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl DropTableProcedure {
})
}

pub(crate) async fn on_prepare<'a>(&mut self) -> Result<Status> {
pub(crate) async fn on_prepare(&mut self) -> Result<Status> {
if self.executor.on_prepare(&self.context).await?.stop() {
return Ok(Status::done());
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/meta/src/key/txn_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl TxnOpGetResponseSet {
impl From<&mut Vec<TxnOpResponse>> for TxnOpGetResponseSet {
fn from(value: &mut Vec<TxnOpResponse>) -> Self {
let value = value
.extract_if(|resp| matches!(resp, TxnOpResponse::ResponseGet(_)))
.extract_if(.., |resp| matches!(resp, TxnOpResponse::ResponseGet(_)))
.flat_map(|resp| {
// Safety: checked
let TxnOpResponse::ResponseGet(r) = resp else {
Expand Down
1 change: 0 additions & 1 deletion src/common/meta/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#![feature(assert_matches)]
#![feature(btree_extract_if)]
#![feature(async_closure)]
#![feature(let_chains)]
#![feature(extract_if)]
#![feature(hash_extract_if)]
Expand Down
5 changes: 1 addition & 4 deletions src/common/query/src/logical_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ pub fn rename_logical_plan_columns(
};

let (qualifier_rename, field_rename) =
match plan.schema().qualified_field_from_column(&old_column) {
Ok(qualifier_and_field) => qualifier_and_field,
Err(err) => return Err(err),
};
plan.schema().qualified_field_from_column(&old_column)?;

for (qualifier, field) in plan.schema().iter() {
if qualifier.eq(&qualifier_rename) && field.as_ref() == field_rename {
Expand Down
15 changes: 7 additions & 8 deletions src/common/version/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ use build_data::{format_timestamp, get_source_time};
use shadow_rs::{CARGO_METADATA, CARGO_TREE};

fn main() -> shadow_rs::SdResult<()> {
println!(
"cargo:rerun-if-changed={}/.git/refs/heads",
env!("CARGO_RUSTC_CURRENT_DIR")
);
// The "CARGO_WORKSPACE_DIR" is set manually (not by Rust itself) in Cargo config file, to
// solve the problem where the "CARGO_MANIFEST_DIR" is not what we want when this repo is
// made as a submodule in another repo.
let src_path = env::var("CARGO_WORKSPACE_DIR").or_else(|_| env::var("CARGO_MANIFEST_DIR"))?;

// `CARGO_RUSTC_CURRENT_DIR` is removed, use `src_path` instead.
println!("cargo:rerun-if-changed={}/.git/refs/heads", src_path);
shuiyisong marked this conversation as resolved.
Show resolved Hide resolved

println!(
"cargo:rustc-env=SOURCE_TIMESTAMP={}",
Expand All @@ -34,10 +37,6 @@ fn main() -> shadow_rs::SdResult<()> {
);
build_data::set_BUILD_TIMESTAMP();

// The "CARGO_WORKSPACE_DIR" is set manually (not by Rust itself) in Cargo config file, to
// solve the problem where the "CARGO_MANIFEST_DIR" is not what we want when this repo is
// made as a submodule in another repo.
let src_path = env::var("CARGO_WORKSPACE_DIR").or_else(|_| env::var("CARGO_MANIFEST_DIR"))?;
let out_path = env::var("OUT_DIR")?;
let _ = shadow_rs::Shadow::build_with(
src_path,
Expand Down
4 changes: 2 additions & 2 deletions src/datatypes/src/types/vector_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pub fn parse_string_to_vector_type_value(s: &str, dim: Option<u32>) -> Result<Ve
let content = trimmed[1..trimmed.len() - 1].trim();

if content.is_empty() {
if dim.map_or(false, |d| d != 0) {
if dim.is_some_and(|d| d != 0) {
return InvalidVectorSnafu {
msg: format!("Failed to parse {s} to Vector value: wrong dimension"),
}
Expand All @@ -139,7 +139,7 @@ pub fn parse_string_to_vector_type_value(s: &str, dim: Option<u32>) -> Result<Ve
.collect::<Result<Vec<f32>>>()?;

// Check dimension
if dim.map_or(false, |d| d as usize != elements.len()) {
if dim.is_some_and(|d| d as usize != elements.len()) {
return InvalidVectorSnafu {
msg: format!("Failed to parse {s} to Vector value: wrong dimension"),
}
Expand Down
3 changes: 1 addition & 2 deletions src/flow/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ impl VectorDiff {

fn try_new(vector: VectorRef, diff: Option<VectorRef>) -> Result<Self, EvalError> {
ensure!(
diff.as_ref()
.map_or(true, |diff| diff.len() == vector.len()),
diff.as_ref().is_none_or(|diff| diff.len() == vector.len()),
InvalidArgumentSnafu {
reason: "Length of vector and diff should be the same"
}
Expand Down
5 changes: 1 addition & 4 deletions src/meta-srv/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -897,9 +897,6 @@ pub(crate) fn match_for_io_error(err_status: &tonic::Status) -> Option<&std::io:
}
}

err = match err.source() {
Some(err) => err,
None => return None,
};
err = err.source()?;
}
}
1 change: 0 additions & 1 deletion src/meta-srv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(async_closure)]
#![feature(result_flattening)]
#![feature(assert_matches)]
#![feature(extract_if)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl UpdateMetadata {
// Removes the candidate region in followers.
let removed = region_route
.follower_peers
.extract_if(|peer| peer.id == candidate.id)
.extract_if(.., |peer| peer.id == candidate.id)
.collect::<Vec<_>>();

if removed.len() > 1 {
Expand Down
2 changes: 1 addition & 1 deletion src/meta-srv/src/region/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ impl RegionSupervisor {
}

let migrating_regions = regions
.extract_if(|(_, _, region_id)| {
.extract_if(.., |(_, _, region_id)| {
self.region_migration_manager.tracker().contains(*region_id)
})
.collect::<Vec<_>>();
Expand Down
Loading
Loading