From 8a8b36879872d8462c0f17bcbcff516c818c9f8f Mon Sep 17 00:00:00 2001 From: Croxx Date: Wed, 30 Oct 2024 22:29:35 +0800 Subject: [PATCH] chore: bump toolchain to nightly-2024-10-11 (#19170) Signed-off-by: MrCroxx --- Cargo.toml | 1 + ci/Dockerfile | 2 +- ci/build-ci-image.sh | 2 +- ci/docker-compose.yml | 10 +- ci/rust-toolchain | 2 +- lints/Cargo.lock | 207 +++++++++--------- lints/Cargo.toml | 6 +- lints/rust-toolchain | 2 +- lints/src/format_error.rs | 2 +- src/batch/src/executor/join/chunked_data.rs | 2 +- src/batch/src/executor/join/hash_join.rs | 2 +- src/batch/src/lib.rs | 1 - src/bench/s3_bench/main.rs | 2 +- src/bench/sink_bench/main.rs | 6 +- .../estimate_size/src/collections/btreemap.rs | 4 +- .../estimate_size/src/collections/mod.rs | 6 +- src/common/metrics/src/gauge_ext.rs | 2 +- src/common/metrics/src/guarded_metrics.rs | 2 + src/common/proc_macro/src/lib.rs | 1 + src/common/src/array/arrow/arrow_iceberg.rs | 5 +- src/common/src/array/bytes_array.rs | 4 +- src/common/src/array/data_chunk_iter.rs | 4 +- src/common/src/array/iterator.rs | 4 +- src/common/src/array/mod.rs | 4 +- src/common/src/array/utf8_array.rs | 2 +- src/common/src/bitmap.rs | 18 +- src/common/src/cache.rs | 4 +- src/common/src/config.rs | 2 +- src/common/src/hash/key.rs | 2 +- src/common/src/lib.rs | 2 - src/common/src/row/mod.rs | 2 +- src/common/src/row/project.rs | 4 +- src/common/src/types/mod.rs | 2 +- src/common/src/types/num256.rs | 4 +- src/common/src/types/scalar_impl.rs | 16 +- src/common/src/types/with_data_type.rs | 4 +- src/common/src/util/hash_util.rs | 4 +- src/common/src/util/prost.rs | 4 +- src/common/src/util/recursive.rs | 2 +- .../codec/tests/integration_tests/utils.rs | 14 +- src/connector/src/parser/mod.rs | 28 ++- src/connector/src/parser/parquet_parser.rs | 9 +- .../elasticsearch_converter.rs | 1 + src/connector/src/sink/formatter/mod.rs | 1 + .../prometheus/monitored_partition_writer.rs | 1 + .../prometheus/monitored_write_writer.rs | 1 + src/expr/core/src/window_function/kind.rs | 1 + src/expr/core/src/window_function/session.rs | 2 +- .../binder/expr/function/builtin_scalar.rs | 4 +- src/frontend/src/binder/insert.rs | 1 - src/frontend/src/binder/set_expr.rs | 1 - src/frontend/src/expr/type_inference/func.rs | 2 +- src/frontend/src/handler/create_connection.rs | 4 +- src/frontend/src/handler/create_source.rs | 4 +- src/frontend/src/handler/variable.rs | 2 +- src/frontend/src/lib.rs | 1 - .../src/optimizer/plan_node/generic/join.rs | 2 - .../plan_node/generic/over_window.rs | 2 +- .../src/optimizer/plan_node/logical_agg.rs | 1 - .../plan_node/logical_over_window.rs | 4 +- .../src/optimizer/plan_node/logical_scan.rs | 4 +- .../optimizer/plan_node/logical_sys_scan.rs | 4 +- .../src/optimizer/plan_node/merge_eq_nodes.rs | 2 +- .../plan_visitor/plan_correlated_id_finder.rs | 1 - .../rule/apply_union_transpose_rule.rs | 1 - .../pull_up_correlated_predicate_agg_rule.rs | 1 - .../src/scheduler/streaming_manager.rs | 2 +- src/frontend/src/utils/condition.rs | 4 +- src/frontend/src/utils/index_set.rs | 4 +- src/frontend/src/utils/pretty_serde.rs | 2 +- src/jni_core/src/lib.rs | 8 +- src/meta/src/barrier/mod.rs | 1 - .../compaction/compaction_group_manager.rs | 3 +- .../src/hummock/manager/compaction/mod.rs | 3 +- src/meta/src/hummock/manager/transaction.rs | 16 +- src/meta/src/lib.rs | 2 - src/meta/src/model/mod.rs | 16 +- src/sqlparser/src/ast/ddl.rs | 2 +- src/sqlparser/src/ast/mod.rs | 2 +- src/sqlparser/src/ast/query.rs | 8 +- src/sqlparser/src/ast/value.rs | 2 +- src/sqlparser/src/parser_v2/impl_.rs | 6 +- src/sqlparser/src/test_utils.rs | 1 + src/storage/backup/src/meta_snapshot_v1.rs | 3 +- .../compaction_group/hummock_version_ext.rs | 7 +- .../hummock_sdk/src/compaction_group/mod.rs | 9 +- src/storage/hummock_sdk/src/key.rs | 8 +- src/storage/hummock_sdk/src/lib.rs | 1 - src/storage/hummock_sdk/src/version.rs | 2 +- src/storage/hummock_trace/src/lib.rs | 2 +- src/storage/hummock_trace/src/read.rs | 3 +- .../src/hummock/compactor/compaction_utils.rs | 2 +- .../src/hummock/event_handler/uploader/mod.rs | 1 + .../event_handler/uploader/test_utils.rs | 1 + .../src/hummock/iterator/merge_inner.rs | 6 +- src/storage/src/hummock/iterator/mod.rs | 2 +- src/storage/src/hummock/sstable/utils.rs | 1 - .../hummock/store/local_hummock_storage.rs | 5 +- src/storage/src/hummock/store/version.rs | 4 +- src/storage/src/lib.rs | 1 - src/storage/src/store_impl.rs | 6 + src/storage/src/table/merge_sort.rs | 8 +- src/stream/src/cache/managed_lru.rs | 6 +- .../log_store_impl/kv_log_store/serde.rs | 1 + src/stream/src/common/state_cache/ordered.rs | 5 +- src/stream/src/common/state_cache/top_n.rs | 5 +- .../executor/aggregation/agg_state_cache.rs | 2 +- src/stream/src/executor/mview/materialize.rs | 8 +- .../src/executor/nested_loop_temporal_join.rs | 1 + src/stream/src/executor/sink.rs | 1 + src/stream/src/from_proto/stream_cdc_scan.rs | 4 +- src/stream/src/lib.rs | 1 - src/tests/simulation/src/client.rs | 2 +- src/tests/sqlsmith/src/sql_gen/agg.rs | 2 +- src/tests/sqlsmith/src/sql_gen/cast.rs | 2 +- src/tests/sqlsmith/src/sql_gen/expr.rs | 2 +- src/tests/sqlsmith/src/sql_gen/functions.rs | 2 +- src/tests/sqlsmith/src/sql_gen/query.rs | 2 +- src/tests/sqlsmith/src/sql_gen/relation.rs | 2 +- src/tests/sqlsmith/src/sql_gen/scalar.rs | 2 +- src/tests/sqlsmith/src/sql_gen/time_window.rs | 2 +- src/tests/sqlsmith/src/sql_gen/utils.rs | 4 +- src/utils/pgwire/src/pg_message.rs | 2 +- src/utils/pgwire/src/pg_protocol.rs | 6 +- src/utils/pgwire/src/types.rs | 2 +- 125 files changed, 343 insertions(+), 331 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index da6b0bfa8738..80166c384efb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -285,6 +285,7 @@ new_without_default = "allow" # duplicated_attributes = "allow" # TODO: remove later https://github.com/rust-lang/rust-clippy/issues/12436 mixed_attributes_style = "allow" +too_long_first_doc_paragraph = "allow" [workspace.lints.rustdoc] private_intra_doc_links = "allow" diff --git a/ci/Dockerfile b/ci/Dockerfile index 95dbb5205c75..88fe2519252e 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -77,7 +77,7 @@ RUN cargo binstall -y --locked --no-symlinks cargo-llvm-cov cargo-nextest cargo- && rm -rf "/root/.cargo/registry/cache" \ && rm -rf "/root/.cargo/git/db" \ && cargo uninstall cargo-cache -RUN cargo install cargo-dylint@3.1.0 dylint-link@3.1.0 +RUN cargo install cargo-dylint@3.2.1 dylint-link@3.2.1 # install risedev COPY < LateLintPass<'tcx> for FormatError { if let FormatArgsPiece::Placeholder(placeholder) = piece && let Ok(index) = placeholder.argument.index && let Some(arg) = format_args.arguments.all_args().get(index) - && let Ok(arg_expr) = find_format_arg_expr(expr, arg) + && let Some(arg_expr) = find_format_arg_expr(expr, arg) { if in_tracing_event_macro { check_fmt_arg_in_tracing_event(cx, arg_expr); diff --git a/src/batch/src/executor/join/chunked_data.rs b/src/batch/src/executor/join/chunked_data.rs index 158f9cba9f28..be947a885cb5 100644 --- a/src/batch/src/executor/join/chunked_data.rs +++ b/src/batch/src/executor/join/chunked_data.rs @@ -37,7 +37,7 @@ pub(super) struct AllRowIdIter<'a> { chunk_offsets: &'a [usize], } -impl<'a> Iterator for AllRowIdIter<'a> { +impl Iterator for AllRowIdIter<'_> { type Item = RowId; fn next(&mut self) -> Option { diff --git a/src/batch/src/executor/join/hash_join.rs b/src/batch/src/executor/join/hash_join.rs index 863e53035626..834320b60d2b 100644 --- a/src/batch/src/executor/join/hash_join.rs +++ b/src/batch/src/executor/join/hash_join.rs @@ -158,7 +158,7 @@ impl ChunkedData> { } } -impl<'a> Iterator for RowIdIter<'a> { +impl Iterator for RowIdIter<'_> { type Item = RowId; fn next(&mut self) -> Option { diff --git a/src/batch/src/lib.rs b/src/batch/src/lib.rs index 9b88c3be9cd6..38eb0efd8055 100644 --- a/src/batch/src/lib.rs +++ b/src/batch/src/lib.rs @@ -20,7 +20,6 @@ #![feature(coroutines)] #![feature(proc_macro_hygiene, stmt_expr_attributes)] #![feature(iterator_try_collect)] -#![feature(is_sorted)] #![recursion_limit = "256"] #![feature(let_chains)] #![feature(int_roundings)] diff --git a/src/bench/s3_bench/main.rs b/src/bench/s3_bench/main.rs index 792c9c4743db..6720a492ba94 100644 --- a/src/bench/s3_bench/main.rs +++ b/src/bench/s3_bench/main.rs @@ -557,7 +557,7 @@ where { struct StringVisitor; - impl<'de> serde::de::Visitor<'de> for StringVisitor { + impl serde::de::Visitor<'_> for StringVisitor { type Value = ByteSize; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/src/bench/sink_bench/main.rs b/src/bench/sink_bench/main.rs index 05eabdb96e91..850c41c31460 100644 --- a/src/bench/sink_bench/main.rs +++ b/src/bench/sink_bench/main.rs @@ -383,10 +383,10 @@ where sink_writer_param.vnode_bitmap = Some(Bitmap::ones(1)); } let log_sinker = sink.new_log_sinker(sink_writer_param).await.unwrap(); - if let Err(e) = log_sinker.consume_log_and_sink(&mut log_reader).await { - return Err(e.to_report_string()); + match log_sinker.consume_log_and_sink(&mut log_reader).await { + Ok(_) => Err("Stream closed".to_string()), + Err(e) => Err(e.to_report_string()), } - Err("Stream closed".to_string()) } #[derive(Debug, Deserialize)] diff --git a/src/common/estimate_size/src/collections/btreemap.rs b/src/common/estimate_size/src/collections/btreemap.rs index af9ab3471ace..25d0c5f82c67 100644 --- a/src/common/estimate_size/src/collections/btreemap.rs +++ b/src/common/estimate_size/src/collections/btreemap.rs @@ -224,7 +224,7 @@ pub struct OccupiedEntry<'a, K, V> { heap_size: &'a mut KvSize, } -impl<'a, K, V> OccupiedEntry<'a, K, V> +impl OccupiedEntry<'_, K, V> where K: EstimateSize + Ord, V: EstimateSize, @@ -248,7 +248,7 @@ where heap_size: &'a mut KvSize, } -impl<'a, K, V, F> Iterator for ExtractIf<'a, K, V, F> +impl Iterator for ExtractIf<'_, K, V, F> where K: EstimateSize, V: EstimateSize, diff --git a/src/common/estimate_size/src/collections/mod.rs b/src/common/estimate_size/src/collections/mod.rs index 5bffd5133edd..c5c8a03d7176 100644 --- a/src/common/estimate_size/src/collections/mod.rs +++ b/src/common/estimate_size/src/collections/mod.rs @@ -85,7 +85,7 @@ where } } -impl<'a, V, S> Drop for MutGuard<'a, V, S> +impl Drop for MutGuard<'_, V, S> where V: EstimateSize, S: private::GenericKvSize, @@ -96,7 +96,7 @@ where } } -impl<'a, V, S> Deref for MutGuard<'a, V, S> +impl Deref for MutGuard<'_, V, S> where V: EstimateSize, S: private::GenericKvSize, @@ -108,7 +108,7 @@ where } } -impl<'a, V, S> DerefMut for MutGuard<'a, V, S> +impl DerefMut for MutGuard<'_, V, S> where V: EstimateSize, S: private::GenericKvSize, diff --git a/src/common/metrics/src/gauge_ext.rs b/src/common/metrics/src/gauge_ext.rs index d357ae5e52cb..b76f2ac7531d 100644 --- a/src/common/metrics/src/gauge_ext.rs +++ b/src/common/metrics/src/gauge_ext.rs @@ -30,7 +30,7 @@ impl IntGauge { } } - impl<'a> Drop for Guard<'a> { + impl Drop for Guard<'_> { fn drop(&mut self) { self.gauge.dec(); } diff --git a/src/common/metrics/src/guarded_metrics.rs b/src/common/metrics/src/guarded_metrics.rs index 9b16cc778938..97ea31145527 100644 --- a/src/common/metrics/src/guarded_metrics.rs +++ b/src/common/metrics/src/guarded_metrics.rs @@ -191,6 +191,8 @@ impl LabelGuardedMetricsInfo { } } +/// An RAII metrics vec with labels. +/// /// `LabelGuardedMetricVec` enhances the [`MetricVec`] to ensure the set of labels to be /// correctly removed from the Prometheus client once being dropped. This is useful for metrics /// that are associated with an object that can be dropped, such as streaming jobs, fragments, diff --git a/src/common/proc_macro/src/lib.rs b/src/common/proc_macro/src/lib.rs index ccf7d4c282e2..52761b589110 100644 --- a/src/common/proc_macro/src/lib.rs +++ b/src/common/proc_macro/src/lib.rs @@ -268,6 +268,7 @@ pub fn session_config(input: TokenStream) -> TokenStream { /// This proc macro recursively extracts rustdoc comments from the fields in a struct and generates a method /// that produces docs for each field. +/// /// Unlike rustdoc, this tool focuses solely on extracting rustdoc for struct fields, without methods. /// /// Example: diff --git a/src/common/src/array/arrow/arrow_iceberg.rs b/src/common/src/array/arrow/arrow_iceberg.rs index ce15c5e3646e..e353b57e257c 100644 --- a/src/common/src/array/arrow/arrow_iceberg.rs +++ b/src/common/src/array/arrow/arrow_iceberg.rs @@ -138,8 +138,9 @@ impl ToArrow for IcebergArrowConvert { impl FromArrow for IcebergArrowConvert {} /// Iceberg sink with `create_table_if_not_exists` option will use this struct to convert the -/// iceberg data type to arrow data type. Specifically, it will add the field id to the -/// arrow field metadata, because iceberg-rust and icelake need the field id to be set. +/// iceberg data type to arrow data type. +/// +/// Specifically, it will add the field id to the arrow field metadata, because iceberg-rust and icelake need the field id to be set. /// /// Note: this is different from [`IcebergArrowConvert`], which is used to read from/write to /// an _existing_ iceberg table. In that case, we just need to make sure the data is compatible to the existing schema. diff --git a/src/common/src/array/bytes_array.rs b/src/common/src/array/bytes_array.rs index 0d62c3d26c6e..2b19451822ad 100644 --- a/src/common/src/array/bytes_array.rs +++ b/src/common/src/array/bytes_array.rs @@ -271,7 +271,7 @@ pub struct PartialBytesWriter<'a> { builder: &'a mut BytesArrayBuilder, } -impl<'a> PartialBytesWriter<'a> { +impl PartialBytesWriter<'_> { /// `write_ref` will append partial dirty data to `builder`. /// `PartialBytesWriter::write_ref` is different from `BytesWriter::write_ref` /// in that it allows us to call it multiple times. @@ -287,7 +287,7 @@ impl<'a> PartialBytesWriter<'a> { } } -impl<'a> Drop for PartialBytesWriter<'a> { +impl Drop for PartialBytesWriter<'_> { fn drop(&mut self) { // If `finish` is not called, we should rollback the data. self.builder.rollback_partial(); diff --git a/src/common/src/array/data_chunk_iter.rs b/src/common/src/array/data_chunk_iter.rs index 064de8532c69..24d6271b547a 100644 --- a/src/common/src/array/data_chunk_iter.rs +++ b/src/common/src/array/data_chunk_iter.rs @@ -85,7 +85,7 @@ impl<'a> Iterator for DataChunkRefIter<'a> { } } -impl<'a> FusedIterator for DataChunkRefIter<'a> {} +impl FusedIterator for DataChunkRefIter<'_> {} pub struct DataChunkRefIterWithHoles<'a> { chunk: &'a DataChunk, @@ -132,7 +132,7 @@ mod row_ref { idx: usize, } - impl<'a> std::fmt::Debug for RowRef<'a> { + impl std::fmt::Debug for RowRef<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_list().entries(self.iter()).finish() } diff --git a/src/common/src/array/iterator.rs b/src/common/src/array/iterator.rs index 31518150e6f8..fa39f1ab2e63 100644 --- a/src/common/src/array/iterator.rs +++ b/src/common/src/array/iterator.rs @@ -47,8 +47,8 @@ impl<'a, A: Array> Iterator for ArrayIterator<'a, A> { } } -impl<'a, A: Array> ExactSizeIterator for ArrayIterator<'a, A> {} -unsafe impl<'a, A: Array> TrustedLen for ArrayIterator<'a, A> {} +impl ExactSizeIterator for ArrayIterator<'_, A> {} +unsafe impl TrustedLen for ArrayIterator<'_, A> {} #[cfg(test)] mod tests { diff --git a/src/common/src/array/mod.rs b/src/common/src/array/mod.rs index b34e5f9b9c47..e8d4cad8fb5b 100644 --- a/src/common/src/array/mod.rs +++ b/src/common/src/array/mod.rs @@ -731,10 +731,10 @@ mod test_util { use crate::util::iter_util::ZipEqFast; pub fn hash_finish(hashers: &[H]) -> Vec { - return hashers + hashers .iter() .map(|hasher| hasher.finish()) - .collect::>(); + .collect::>() } pub fn test_hash(arrs: Vec, expects: Vec, hasher_builder: H) { diff --git a/src/common/src/array/utf8_array.rs b/src/common/src/array/utf8_array.rs index 8463f73e3ee5..749a9efe3da1 100644 --- a/src/common/src/array/utf8_array.rs +++ b/src/common/src/array/utf8_array.rs @@ -204,7 +204,7 @@ pub struct PartialStringWriter<'a> { bytes: PartialBytesWriter<'a>, } -impl<'a> PartialStringWriter<'a> { +impl PartialStringWriter<'_> { /// `finish` will be called while the entire record is written. /// Exactly one new record was appended and the `builder` can be safely used. pub fn finish(self) { diff --git a/src/common/src/bitmap.rs b/src/common/src/bitmap.rs index ae0710516440..22869b23bc1d 100644 --- a/src/common/src/bitmap.rs +++ b/src/common/src/bitmap.rs @@ -325,7 +325,7 @@ impl Bitmap { /// Returns the length of vector to store `num_bits` bits. fn vec_len(num_bits: usize) -> usize { - (num_bits + BITS - 1) / BITS + num_bits.div_ceil(BITS) } /// Returns the number of valid bits in the bitmap, @@ -468,7 +468,7 @@ impl From for Bitmap { } } -impl<'a, 'b> BitAnd<&'b Bitmap> for &'a Bitmap { +impl<'b> BitAnd<&'b Bitmap> for &Bitmap { type Output = Bitmap; fn bitand(self, rhs: &'b Bitmap) -> Bitmap { @@ -488,7 +488,7 @@ impl<'a, 'b> BitAnd<&'b Bitmap> for &'a Bitmap { } } -impl<'a> BitAnd for &'a Bitmap { +impl BitAnd for &Bitmap { type Output = Bitmap; fn bitand(self, rhs: Bitmap) -> Self::Output { @@ -524,7 +524,7 @@ impl BitAndAssign for Bitmap { } } -impl<'a, 'b> BitOr<&'b Bitmap> for &'a Bitmap { +impl<'b> BitOr<&'b Bitmap> for &Bitmap { type Output = Bitmap; fn bitor(self, rhs: &'b Bitmap) -> Bitmap { @@ -544,7 +544,7 @@ impl<'a, 'b> BitOr<&'b Bitmap> for &'a Bitmap { } } -impl<'a> BitOr for &'a Bitmap { +impl BitOr for &Bitmap { type Output = Bitmap; fn bitor(self, rhs: Bitmap) -> Self::Output { @@ -599,7 +599,7 @@ impl BitXor for &Bitmap { } } -impl<'a> Not for &'a Bitmap { +impl Not for &Bitmap { type Output = Bitmap; fn not(self) -> Self::Output { @@ -700,7 +700,7 @@ pub struct BitmapIter<'a> { all_ones: bool, } -impl<'a> BitmapIter<'a> { +impl BitmapIter<'_> { fn next_always_load_usize(&mut self) -> Option { if self.idx >= self.num_bits { return None; @@ -724,7 +724,7 @@ impl<'a> BitmapIter<'a> { } } -impl<'a> iter::Iterator for BitmapIter<'a> { +impl iter::Iterator for BitmapIter<'_> { type Item = bool; fn next(&mut self) -> Option { @@ -778,7 +778,7 @@ pub enum BitmapOnesIter<'a> { }, } -impl<'a> iter::Iterator for BitmapOnesIter<'a> { +impl iter::Iterator for BitmapOnesIter<'_> { type Item = usize; fn next(&mut self) -> Option { diff --git a/src/common/src/cache.rs b/src/common/src/cache.rs index e86ef432eea9..678a101ae62a 100644 --- a/src/common/src/cache.rs +++ b/src/common/src/cache.rs @@ -877,13 +877,13 @@ pub struct CleanCacheGuard<'a, K: LruKey + Clone + 'static, T: LruValue + 'stati hash: u64, } -impl<'a, K: LruKey + Clone + 'static, T: LruValue + 'static> CleanCacheGuard<'a, K, T> { +impl CleanCacheGuard<'_, K, T> { fn mark_success(mut self) -> K { self.key.take().unwrap() } } -impl<'a, K: LruKey + Clone + 'static, T: LruValue + 'static> Drop for CleanCacheGuard<'a, K, T> { +impl Drop for CleanCacheGuard<'_, K, T> { fn drop(&mut self) { if let Some(key) = self.key.as_ref() { self.cache.clear_pending_request(key, self.hash); diff --git a/src/common/src/config.rs b/src/common/src/config.rs index b2020b2ac054..c3fc78919a3e 100644 --- a/src/common/src/config.rs +++ b/src/common/src/config.rs @@ -116,7 +116,7 @@ pub trait OverrideConfig { fn r#override(&self, config: &mut RwConfig); } -impl<'a, T: OverrideConfig> OverrideConfig for &'a T { +impl OverrideConfig for &T { fn r#override(&self, config: &mut RwConfig) { T::r#override(self, config) } diff --git a/src/common/src/hash/key.rs b/src/common/src/hash/key.rs index 96928e69f4a8..1c6f60f6c621 100644 --- a/src/common/src/hash/key.rs +++ b/src/common/src/hash/key.rs @@ -480,7 +480,7 @@ impl HashKeyDe for Int256 { } } -impl<'a> HashKeySer<'a> for Serial { +impl HashKeySer<'_> for Serial { fn serialize_into(self, mut buf: impl BufMut) { buf.put_i64_ne(self.as_row_id()); } diff --git a/src/common/src/lib.rs b/src/common/src/lib.rs index e3417853b020..b47076c64594 100644 --- a/src/common/src/lib.rs +++ b/src/common/src/lib.rs @@ -18,7 +18,6 @@ )] #![feature(extract_if)] #![feature(trait_alias)] -#![feature(is_sorted)] #![feature(type_alias_impl_trait)] #![feature(test)] #![feature(trusted_len)] @@ -35,7 +34,6 @@ #![feature(iter_order_by)] #![feature(binary_heap_into_iter_sorted)] #![feature(impl_trait_in_assoc_type)] -#![feature(map_entry_replace)] #![feature(negative_impls)] #![feature(register_tool)] #![feature(btree_cursors)] diff --git a/src/common/src/row/mod.rs b/src/common/src/row/mod.rs index 0b2181105352..2aba5ce074c6 100644 --- a/src/common/src/row/mod.rs +++ b/src/common/src/row/mod.rs @@ -187,7 +187,7 @@ pub trait RowExt: Row { fn display(&self) -> impl Display + '_ { struct D<'a, T: Row>(&'a T); - impl<'a, T: Row> Display for D<'a, T> { + impl Display for D<'_, T> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!( f, diff --git a/src/common/src/row/project.rs b/src/common/src/row/project.rs index 542ea6417051..9c4ee3231b6a 100644 --- a/src/common/src/row/project.rs +++ b/src/common/src/row/project.rs @@ -24,12 +24,12 @@ pub struct Project<'i, R> { indices: &'i [usize], } -impl<'i, R: Row> PartialEq for Project<'i, R> { +impl PartialEq for Project<'_, R> { fn eq(&self, other: &Self) -> bool { self.iter().eq(other.iter()) } } -impl<'i, R: Row> Eq for Project<'i, R> {} +impl Eq for Project<'_, R> {} impl<'i, R: Row> Row for Project<'i, R> { #[inline] diff --git a/src/common/src/types/mod.rs b/src/common/src/types/mod.rs index 54b6c0718d90..44be87116643 100644 --- a/src/common/src/types/mod.rs +++ b/src/common/src/types/mod.rs @@ -951,7 +951,7 @@ impl ScalarImpl { } } -impl<'a> ScalarRefImpl<'a> { +impl ScalarRefImpl<'_> { /// Converts [`ScalarRefImpl`] to [`ScalarImpl`] pub fn into_scalar_impl(self) -> ScalarImpl { dispatch_scalar_ref_variants!(self, inner, { inner.to_owned_scalar().into() }) diff --git a/src/common/src/types/num256.rs b/src/common/src/types/num256.rs index 2acbcf636a03..6c96b3ddbbec 100644 --- a/src/common/src/types/num256.rs +++ b/src/common/src/types/num256.rs @@ -42,7 +42,7 @@ pub struct Int256(pub(crate) Box); #[derive(Debug, Copy, Clone, PartialEq, Eq, Ord, PartialOrd)] pub struct Int256Ref<'a>(pub &'a i256); -impl<'a> Display for Int256Ref<'a> { +impl Display for Int256Ref<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { self.write(f) } @@ -208,7 +208,7 @@ impl Int256 { } } -impl<'a> Int256Ref<'a> { +impl Int256Ref<'_> { pub fn memcmp_serialize( &self, serializer: &mut memcomparable::Serializer, diff --git a/src/common/src/types/scalar_impl.rs b/src/common/src/types/scalar_impl.rs index 43742f74c7b5..9384961e4a89 100644 --- a/src/common/src/types/scalar_impl.rs +++ b/src/common/src/types/scalar_impl.rs @@ -145,7 +145,7 @@ impl Scalar for bool { } /// Implement `ScalarRef` for `bool`. -impl<'a> ScalarRef<'a> for bool { +impl ScalarRef<'_> for bool { type ScalarType = bool; fn to_owned_scalar(&self) -> bool { @@ -167,7 +167,7 @@ impl Scalar for Decimal { } /// Implement `ScalarRef` for `Decimal`. -impl<'a> ScalarRef<'a> for Decimal { +impl ScalarRef<'_> for Decimal { type ScalarType = Decimal; fn to_owned_scalar(&self) -> Decimal { @@ -189,7 +189,7 @@ impl Scalar for Interval { } /// Implement `ScalarRef` for `Interval`. -impl<'a> ScalarRef<'a> for Interval { +impl ScalarRef<'_> for Interval { type ScalarType = Interval; fn to_owned_scalar(&self) -> Interval { @@ -211,7 +211,7 @@ impl Scalar for Date { } /// Implement `ScalarRef` for `Date`. -impl<'a> ScalarRef<'a> for Date { +impl ScalarRef<'_> for Date { type ScalarType = Date; fn to_owned_scalar(&self) -> Date { @@ -233,7 +233,7 @@ impl Scalar for Timestamp { } /// Implement `ScalarRef` for `Timestamp`. -impl<'a> ScalarRef<'a> for Timestamp { +impl ScalarRef<'_> for Timestamp { type ScalarType = Timestamp; fn to_owned_scalar(&self) -> Timestamp { @@ -255,7 +255,7 @@ impl Scalar for Time { } /// Implement `ScalarRef` for `Time`. -impl<'a> ScalarRef<'a> for Time { +impl ScalarRef<'_> for Time { type ScalarType = Time; fn to_owned_scalar(&self) -> Time { @@ -277,7 +277,7 @@ impl Scalar for Timestamptz { } /// Implement `ScalarRef` for `Timestamptz`. -impl<'a> ScalarRef<'a> for Timestamptz { +impl ScalarRef<'_> for Timestamptz { type ScalarType = Timestamptz; fn to_owned_scalar(&self) -> Timestamptz { @@ -322,7 +322,7 @@ impl ScalarImpl { } } -impl<'scalar> ScalarRefImpl<'scalar> { +impl ScalarRefImpl<'_> { pub fn get_ident(&self) -> &'static str { dispatch_scalar_ref_variants!(self, [I = VARIANT_NAME], { I }) } diff --git a/src/common/src/types/with_data_type.rs b/src/common/src/types/with_data_type.rs index 257d8c7f15dc..1001a277b316 100644 --- a/src/common/src/types/with_data_type.rs +++ b/src/common/src/types/with_data_type.rs @@ -92,7 +92,7 @@ impl_with_data_type!(rust_decimal::Decimal, DataType::Decimal); impl_with_data_type!(Decimal, DataType::Decimal); impl_with_data_type!(Serial, DataType::Serial); -impl<'a> WithDataType for &'a str { +impl WithDataType for &str { fn default_data_type() -> DataType { DataType::Varchar } @@ -109,7 +109,7 @@ impl_with_data_type!(Vec, DataType::Bytea); impl_with_data_type!(Bytes, DataType::Bytea); impl_with_data_type!(JsonbVal, DataType::Jsonb); -impl<'a> WithDataType for JsonbRef<'a> { +impl WithDataType for JsonbRef<'_> { fn default_data_type() -> DataType { DataType::Jsonb } diff --git a/src/common/src/util/hash_util.rs b/src/common/src/util/hash_util.rs index 264e4783786b..85654580827e 100644 --- a/src/common/src/util/hash_util.rs +++ b/src/common/src/util/hash_util.rs @@ -15,10 +15,10 @@ use std::hash::{BuildHasher, Hasher}; pub fn finalize_hashers(hashers: &[H]) -> Vec { - return hashers + hashers .iter() .map(|hasher| hasher.finish()) - .collect::>(); + .collect::>() } #[derive(Clone, Copy)] diff --git a/src/common/src/util/prost.rs b/src/common/src/util/prost.rs index 8145a37a8a20..4ea799f1befe 100644 --- a/src/common/src/util/prost.rs +++ b/src/common/src/util/prost.rs @@ -32,7 +32,7 @@ impl TypeUrl for batch_plan::ExchangeNode { pub struct StackTraceResponseOutput<'a>(&'a StackTraceResponse); -impl<'a> Deref for StackTraceResponseOutput<'a> { +impl Deref for StackTraceResponseOutput<'_> { type Target = StackTraceResponse; fn deref(&self) -> &Self::Target { @@ -40,7 +40,7 @@ impl<'a> Deref for StackTraceResponseOutput<'a> { } } -impl<'a> Display for StackTraceResponseOutput<'a> { +impl Display for StackTraceResponseOutput<'_> { fn fmt(&self, s: &mut Formatter<'_>) -> std::fmt::Result { if !self.actor_traces.is_empty() { writeln!(s, "--- Actor Traces ---")?; diff --git a/src/common/src/util/recursive.rs b/src/common/src/util/recursive.rs index 2869b3c49633..839bcb72e5f3 100644 --- a/src/common/src/util/recursive.rs +++ b/src/common/src/util/recursive.rs @@ -82,7 +82,7 @@ impl Tracker { } } - impl<'a> Drop for DepthGuard<'a> { + impl Drop for DepthGuard<'_> { fn drop(&mut self) { let mut d = self.depth.borrow_mut(); d.last_max = d.last_max.max(d.current); // update the last max depth diff --git a/src/connector/codec/tests/integration_tests/utils.rs b/src/connector/codec/tests/integration_tests/utils.rs index 889dbeffc306..021913edf033 100644 --- a/src/connector/codec/tests/integration_tests/utils.rs +++ b/src/connector/codec/tests/integration_tests/utils.rs @@ -23,7 +23,7 @@ use risingwave_pb::plan_common::AdditionalColumn; /// More concise display for `DataType`, to use in tests. pub struct DataTypeTestDisplay<'a>(pub &'a DataType); -impl<'a> std::fmt::Debug for DataTypeTestDisplay<'a> { +impl std::fmt::Debug for DataTypeTestDisplay<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self.0 { DataType::Struct(s) => { @@ -68,7 +68,7 @@ impl<'a> std::fmt::Debug for DataTypeTestDisplay<'a> { /// More concise display for `ScalarRefImpl`, to use in tests. pub struct ScalarRefImplTestDisplay<'a>(pub ScalarRefImpl<'a>); -impl<'a> std::fmt::Debug for ScalarRefImplTestDisplay<'a> { +impl std::fmt::Debug for ScalarRefImplTestDisplay<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self.0 { ScalarRefImpl::Struct(s) => { @@ -112,7 +112,7 @@ impl<'a> std::fmt::Debug for ScalarRefImplTestDisplay<'a> { /// More concise display for `ScalarImpl`, to use in tests. pub struct ScalarImplTestDisplay<'a>(pub &'a ScalarImpl); -impl<'a> std::fmt::Debug for ScalarImplTestDisplay<'a> { +impl std::fmt::Debug for ScalarImplTestDisplay<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { ScalarRefImplTestDisplay(self.0.as_scalar_ref_impl()).fmt(f) } @@ -121,7 +121,7 @@ impl<'a> std::fmt::Debug for ScalarImplTestDisplay<'a> { /// More concise display for `DatumRef`, to use in tests. pub struct DatumRefTestDisplay<'a>(pub DatumRef<'a>); -impl<'a> std::fmt::Debug for DatumRefTestDisplay<'a> { +impl std::fmt::Debug for DatumRefTestDisplay<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self.0 { Some(scalar) => ScalarRefImplTestDisplay(scalar).fmt(f), @@ -133,7 +133,7 @@ impl<'a> std::fmt::Debug for DatumRefTestDisplay<'a> { /// More concise display for `Datum`, to use in tests. pub struct DatumTestDisplay<'a>(pub &'a Datum); -impl<'a> std::fmt::Debug for DatumTestDisplay<'a> { +impl std::fmt::Debug for DatumTestDisplay<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { DatumRefTestDisplay(self.0.to_datum_ref()).fmt(f) } @@ -142,7 +142,7 @@ impl<'a> std::fmt::Debug for DatumTestDisplay<'a> { /// More concise display for `DatumCow`, to use in tests. pub struct DatumCowTestDisplay<'a>(pub &'a DatumCow<'a>); -impl<'a> std::fmt::Debug for DatumCowTestDisplay<'a> { +impl std::fmt::Debug for DatumCowTestDisplay<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self.0 { DatumCow::Borrowed(datum_ref) => { @@ -164,7 +164,7 @@ impl<'a> std::fmt::Debug for DatumCowTestDisplay<'a> { /// More concise display for `ColumnDesc`, to use in tests. pub struct ColumnDescTestDisplay<'a>(pub &'a ColumnDesc); -impl<'a> std::fmt::Debug for ColumnDescTestDisplay<'a> { +impl std::fmt::Debug for ColumnDescTestDisplay<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let ColumnDesc { data_type, diff --git a/src/connector/src/parser/mod.rs b/src/connector/src/parser/mod.rs index 2142914aa250..53621721ac25 100644 --- a/src/connector/src/parser/mod.rs +++ b/src/connector/src/parser/mod.rs @@ -445,22 +445,22 @@ impl SourceStreamChunkRowWriter<'_> { } (_, &Some(AdditionalColumnType::Partition(_))) => { // the meta info does not involve spec connector - return Ok(A::output_for( + Ok(A::output_for( self.row_meta .as_ref() .map(|ele| ScalarRefImpl::Utf8(ele.split_id)), - )); + )) } (_, &Some(AdditionalColumnType::Offset(_))) => { // the meta info does not involve spec connector - return Ok(A::output_for( + Ok(A::output_for( self.row_meta .as_ref() .map(|ele| ScalarRefImpl::Utf8(ele.offset)), - )); + )) } (_, &Some(AdditionalColumnType::HeaderInner(ref header_inner))) => { - return Ok(A::output_for( + Ok(A::output_for( self.row_meta .as_ref() .and_then(|ele| { @@ -473,21 +473,19 @@ impl SourceStreamChunkRowWriter<'_> { .unwrap_or(Datum::None.into()), )) } - (_, &Some(AdditionalColumnType::Headers(_))) => { - return Ok(A::output_for( - self.row_meta - .as_ref() - .and_then(|ele| extract_headers_from_meta(ele.meta)) - .unwrap_or(None), - )) - } + (_, &Some(AdditionalColumnType::Headers(_))) => Ok(A::output_for( + self.row_meta + .as_ref() + .and_then(|ele| extract_headers_from_meta(ele.meta)) + .unwrap_or(None), + )), (_, &Some(AdditionalColumnType::Filename(_))) => { // Filename is used as partition in FS connectors - return Ok(A::output_for( + Ok(A::output_for( self.row_meta .as_ref() .map(|ele| ScalarRefImpl::Utf8(ele.split_id)), - )); + )) } (_, &Some(AdditionalColumnType::Payload(_))) => { // ingest the whole payload as a single column diff --git a/src/connector/src/parser/parquet_parser.rs b/src/connector/src/parser/parquet_parser.rs index db2ace3d2b6d..4657a518991f 100644 --- a/src/connector/src/parser/parquet_parser.rs +++ b/src/connector/src/parser/parquet_parser.rs @@ -87,11 +87,10 @@ impl ParquetParser { /// # Returns /// /// A `StreamChunk` containing the converted data from the `RecordBatch`. - - // The hidden columns that must be included here are _rw_file and _rw_offset. - // Depending on whether the user specifies a primary key (pk), there may be an additional hidden column row_id. - // Therefore, the maximum number of hidden columns is three. - + /// + /// The hidden columns that must be included here are `_rw_file` and `_rw_offset`. + /// Depending on whether the user specifies a primary key (pk), there may be an additional hidden column `row_id`. + /// Therefore, the maximum number of hidden columns is three. fn convert_record_batch_to_stream_chunk( &mut self, record_batch: RecordBatch, diff --git a/src/connector/src/sink/elasticsearch_opensearch/elasticsearch_converter.rs b/src/connector/src/sink/elasticsearch_opensearch/elasticsearch_converter.rs index 195c976ba2b7..80dc5e0f1ca6 100644 --- a/src/connector/src/sink/elasticsearch_opensearch/elasticsearch_converter.rs +++ b/src/connector/src/sink/elasticsearch_opensearch/elasticsearch_converter.rs @@ -28,6 +28,7 @@ use super::elasticsearch_opensearch_config::{ use super::elasticsearch_opensearch_formatter::{BuildBulkPara, ElasticSearchOpenSearchFormatter}; use crate::sink::Result; +#[expect(clippy::large_enum_variant)] pub enum StreamChunkConverter { Es(EsStreamChunkConverter), Other, diff --git a/src/connector/src/sink/formatter/mod.rs b/src/connector/src/sink/formatter/mod.rs index bb0a41f63c33..6b8bcfa4a8c9 100644 --- a/src/connector/src/sink/formatter/mod.rs +++ b/src/connector/src/sink/formatter/mod.rs @@ -49,6 +49,7 @@ pub trait SinkFormatter { /// For example append-only without `primary_key` (aka `downstream_pk`) set. /// * Value may be None so that messages with same key are removed during log compaction. /// For example debezium tombstone event. + #[expect(clippy::type_complexity)] fn format_chunk( &self, chunk: &StreamChunk, diff --git a/src/connector/src/sink/iceberg/prometheus/monitored_partition_writer.rs b/src/connector/src/sink/iceberg/prometheus/monitored_partition_writer.rs index c5fb3bcc906b..8a5352772e7c 100644 --- a/src/connector/src/sink/iceberg/prometheus/monitored_partition_writer.rs +++ b/src/connector/src/sink/iceberg/prometheus/monitored_partition_writer.rs @@ -28,6 +28,7 @@ pub struct MonitoredFanoutPartitionedWriterBuilder { } impl MonitoredFanoutPartitionedWriterBuilder { + #[expect(dead_code)] pub fn new( inner: FanoutPartitionedWriterBuilder, partition_num: LabelGuardedIntGauge<2>, diff --git a/src/connector/src/sink/iceberg/prometheus/monitored_write_writer.rs b/src/connector/src/sink/iceberg/prometheus/monitored_write_writer.rs index 634e9ac968f8..90d0bf575d56 100644 --- a/src/connector/src/sink/iceberg/prometheus/monitored_write_writer.rs +++ b/src/connector/src/sink/iceberg/prometheus/monitored_write_writer.rs @@ -28,6 +28,7 @@ pub struct MonitoredWriteWriterBuilder { impl MonitoredWriteWriterBuilder { /// Create writer context. + #[expect(dead_code)] pub fn new( inner: B, write_qps: LabelGuardedIntCounter<2>, diff --git a/src/expr/core/src/window_function/kind.rs b/src/expr/core/src/window_function/kind.rs index 6bf5ea8c45e5..e7a16d421483 100644 --- a/src/expr/core/src/window_function/kind.rs +++ b/src/expr/core/src/window_function/kind.rs @@ -21,6 +21,7 @@ use crate::aggregate::AggType; use crate::Result; /// Kind of window functions. +#[expect(clippy::large_enum_variant)] #[derive(Debug, Display, FromStr /* for builtin */, Clone, PartialEq, Eq, Hash, EnumAsInner)] #[display(style = "snake_case")] pub enum WindowFuncKind { diff --git a/src/expr/core/src/window_function/session.rs b/src/expr/core/src/window_function/session.rs index 81a77058759b..cc98c789019c 100644 --- a/src/expr/core/src/window_function/session.rs +++ b/src/expr/core/src/window_function/session.rs @@ -196,7 +196,7 @@ struct SessionFrameGapRef<'a> { add_expr: &'a dyn Expression, } -impl<'a> SessionFrameGapRef<'a> { +impl SessionFrameGapRef<'_> { fn minimal_next_start_of(&self, end_order_value: impl ToOwnedDatum) -> Datum { let row = OwnedRow::new(vec![end_order_value.to_owned_datum()]); self.add_expr diff --git a/src/frontend/src/binder/expr/function/builtin_scalar.rs b/src/frontend/src/binder/expr/function/builtin_scalar.rs index 778114043257..68b37a3fee4e 100644 --- a/src/frontend/src/binder/expr/function/builtin_scalar.rs +++ b/src/frontend/src/binder/expr/function/builtin_scalar.rs @@ -432,10 +432,10 @@ impl Binder { ("current_catalog", current_database()), ("current_database", current_database()), ("current_schema", guard_by_len(0, raw(|binder, _inputs| { - return Ok(binder + Ok(binder .first_valid_schema() .map(|schema| ExprImpl::literal_varchar(schema.name())) - .unwrap_or_else(|_| ExprImpl::literal_null(DataType::Varchar))); + .unwrap_or_else(|_| ExprImpl::literal_null(DataType::Varchar))) }))), ("current_schemas", raw(|binder, mut inputs| { let no_match_err = ErrorCode::ExprError( diff --git a/src/frontend/src/binder/insert.rs b/src/frontend/src/binder/insert.rs index 505acec2265b..ac4a52f2c11a 100644 --- a/src/frontend/src/binder/insert.rs +++ b/src/frontend/src/binder/insert.rs @@ -305,7 +305,6 @@ impl Binder { /// Cast a list of `exprs` to corresponding `expected_types` IN ASSIGNMENT CONTEXT. Make sure /// you understand the difference of implicit, assignment and explicit cast before reusing it. - pub(super) fn cast_on_insert( expected_types: &Vec, exprs: Vec, diff --git a/src/frontend/src/binder/set_expr.rs b/src/frontend/src/binder/set_expr.rs index 68af5845bf7a..0d7f74efa95d 100644 --- a/src/frontend/src/binder/set_expr.rs +++ b/src/frontend/src/binder/set_expr.rs @@ -78,7 +78,6 @@ impl From for BoundSetOperation { impl BoundSetExpr { /// The schema returned by this [`BoundSetExpr`]. - pub fn schema(&self) -> Cow<'_, Schema> { match self { BoundSetExpr::Select(s) => Cow::Borrowed(s.schema()), diff --git a/src/frontend/src/expr/type_inference/func.rs b/src/frontend/src/expr/type_inference/func.rs index 99392ad87b97..719484b959f3 100644 --- a/src/frontend/src/expr/type_inference/func.rs +++ b/src/frontend/src/expr/type_inference/func.rs @@ -1042,7 +1042,7 @@ fn narrow_same_type<'a>( } struct TypeDisplay<'a>(&'a Option); -impl<'a> std::fmt::Display for TypeDisplay<'a> { +impl std::fmt::Display for TypeDisplay<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self.0 { Some(t) => t.fmt(f), diff --git a/src/frontend/src/handler/create_connection.rs b/src/frontend/src/handler/create_connection.rs index 634d5ab829db..d7ef3aa10b88 100644 --- a/src/frontend/src/handler/create_connection.rs +++ b/src/frontend/src/handler/create_connection.rs @@ -45,7 +45,7 @@ fn resolve_create_connection_payload( with_properties: &BTreeMap, ) -> Result { let connection_type = get_connection_property_required(with_properties, CONNECTION_TYPE_PROP)?; - return match connection_type.as_str() { + match connection_type.as_str() { PRIVATELINK_CONNECTION => Err(RwError::from(ErrorCode::Deprecated( "CREATE CONNECTION to Private Link".to_string(), "RisingWave Cloud Portal (Please refer to the doc https://docs.risingwave.com/cloud/create-a-connection/)".to_string(), @@ -53,7 +53,7 @@ fn resolve_create_connection_payload( _ => Err(RwError::from(ProtocolError(format!( "Connection type \"{connection_type}\" is not supported" )))), - }; + } } pub async fn handle_create_connection( diff --git a/src/frontend/src/handler/create_source.rs b/src/frontend/src/handler/create_source.rs index 077c811d9afc..c1b88e945512 100644 --- a/src/frontend/src/handler/create_source.rs +++ b/src/frontend/src/handler/create_source.rs @@ -162,9 +162,9 @@ async fn extract_avro_table_schema( if let risingwave_connector::parser::EncodingProperties::Avro(avro_props) = &parser_config.encoding_config && matches!(avro_props.schema_location, SchemaLocation::File { .. }) - && !format_encode_options + && format_encode_options .get("with_deprecated_file_header") - .is_some_and(|v| v == "true") + .is_none_or(|v| v != "true") { bail_not_implemented!(issue = 12871, "avro without schema registry"); } diff --git a/src/frontend/src/handler/variable.rs b/src/frontend/src/handler/variable.rs index 96fd232215cc..e22ab045565d 100644 --- a/src/frontend/src/handler/variable.rs +++ b/src/frontend/src/handler/variable.rs @@ -54,7 +54,7 @@ pub fn handle_set( status: &'a mut ParameterStatus, } - impl<'a> ConfigReporter for Reporter<'a> { + impl ConfigReporter for Reporter<'_> { fn report_status(&mut self, key: &str, new_val: String) { if key == "APPLICATION_NAME" { self.status.application_name = Some(new_val); diff --git a/src/frontend/src/lib.rs b/src/frontend/src/lib.rs index 8dbd09a19a62..5c006e191157 100644 --- a/src/frontend/src/lib.rs +++ b/src/frontend/src/lib.rs @@ -33,7 +33,6 @@ #![feature(error_generic_member_access)] #![feature(iterator_try_collect)] #![feature(used_with_arg)] -#![feature(entry_insert)] #![recursion_limit = "256"] #[cfg(test)] diff --git a/src/frontend/src/optimizer/plan_node/generic/join.rs b/src/frontend/src/optimizer/plan_node/generic/join.rs index f7ce096e73eb..4663205ea6f0 100644 --- a/src/frontend/src/optimizer/plan_node/generic/join.rs +++ b/src/frontend/src/optimizer/plan_node/generic/join.rs @@ -492,7 +492,6 @@ impl Join { /// predicate. /// /// `InputRef`s in the right pushed condition are indexed by the right child's output schema. - pub fn push_down_into_join( predicate: &mut Condition, left_col_num: usize, @@ -534,7 +533,6 @@ pub fn push_down_into_join( /// pushed part will be removed from the original join predicate. /// /// `InputRef`s in the right pushed condition are indexed by the right child's output schema. - pub fn push_down_join_condition( on_condition: &mut Condition, left_col_num: usize, diff --git a/src/frontend/src/optimizer/plan_node/generic/over_window.rs b/src/frontend/src/optimizer/plan_node/generic/over_window.rs index fc10df60421b..c65dabd3ee09 100644 --- a/src/frontend/src/optimizer/plan_node/generic/over_window.rs +++ b/src/frontend/src/optimizer/plan_node/generic/over_window.rs @@ -45,7 +45,7 @@ struct PlanWindowFunctionDisplay<'a> { pub input_schema: &'a Schema, } -impl<'a> std::fmt::Debug for PlanWindowFunctionDisplay<'a> { +impl std::fmt::Debug for PlanWindowFunctionDisplay<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let window_function = self.window_function; if f.alternate() { diff --git a/src/frontend/src/optimizer/plan_node/logical_agg.rs b/src/frontend/src/optimizer/plan_node/logical_agg.rs index 4e2474287c96..7f2b52797924 100644 --- a/src/frontend/src/optimizer/plan_node/logical_agg.rs +++ b/src/frontend/src/optimizer/plan_node/logical_agg.rs @@ -440,7 +440,6 @@ impl LogicalAgg { /// `MergeProject` z /// / \ /// x y - fn build_approx_percentile_aggs( &self, input: PlanRef, diff --git a/src/frontend/src/optimizer/plan_node/logical_over_window.rs b/src/frontend/src/optimizer/plan_node/logical_over_window.rs index 7273e7d41851..0e4e56ac2a20 100644 --- a/src/frontend/src/optimizer/plan_node/logical_over_window.rs +++ b/src/frontend/src/optimizer/plan_node/logical_over_window.rs @@ -151,7 +151,7 @@ impl<'a> LogicalOverWindowBuilder<'a> { } } -impl<'a> ExprRewriter for LogicalOverWindowBuilder<'a> { +impl ExprRewriter for LogicalOverWindowBuilder<'_> { fn rewrite_window_function(&mut self, window_func: WindowFunction) -> ExprImpl { let dummy = Literal::new(None, window_func.return_type()).into(); match self.try_rewrite_window_function(window_func) { @@ -226,7 +226,7 @@ impl<'a> OverWindowProjectBuilder<'a> { } } -impl<'a> ExprVisitor for OverWindowProjectBuilder<'a> { +impl ExprVisitor for OverWindowProjectBuilder<'_> { fn visit_window_function(&mut self, window_function: &WindowFunction) { if let Err(e) = self.try_visit_window_function(window_function) { self.error = Some(e); diff --git a/src/frontend/src/optimizer/plan_node/logical_scan.rs b/src/frontend/src/optimizer/plan_node/logical_scan.rs index e2aeaa6b9517..ccb90889cb94 100644 --- a/src/frontend/src/optimizer/plan_node/logical_scan.rs +++ b/src/frontend/src/optimizer/plan_node/logical_scan.rs @@ -419,13 +419,13 @@ impl PredicatePushdown for LogicalScan { self.clone_with_predicate(predicate.and(self.predicate().clone())) .into() } else { - return LogicalFilter::create( + LogicalFilter::create( self.clone_with_predicate(predicate.and(self.predicate().clone())) .into(), Condition { conjunctions: non_pushable_predicate, }, - ); + ) } } } diff --git a/src/frontend/src/optimizer/plan_node/logical_sys_scan.rs b/src/frontend/src/optimizer/plan_node/logical_sys_scan.rs index a85afa8afa03..cf711f74a039 100644 --- a/src/frontend/src/optimizer/plan_node/logical_sys_scan.rs +++ b/src/frontend/src/optimizer/plan_node/logical_sys_scan.rs @@ -309,13 +309,13 @@ impl PredicatePushdown for LogicalSysScan { self.clone_with_predicate(predicate.and(self.predicate().clone())) .into() } else { - return LogicalFilter::create( + LogicalFilter::create( self.clone_with_predicate(predicate.and(self.predicate().clone())) .into(), Condition { conjunctions: non_pushable_predicate, }, - ); + ) } } } diff --git a/src/frontend/src/optimizer/plan_node/merge_eq_nodes.rs b/src/frontend/src/optimizer/plan_node/merge_eq_nodes.rs index 36d0c1bec73a..b136d3468472 100644 --- a/src/frontend/src/optimizer/plan_node/merge_eq_nodes.rs +++ b/src/frontend/src/optimizer/plan_node/merge_eq_nodes.rs @@ -92,7 +92,7 @@ impl VisitPlan for Counter { where F: FnMut(&mut Self), { - if !self.counts.get(&plan.id()).is_some_and(|c| *c > 1) { + if self.counts.get(&plan.id()).is_none_or(|c| *c <= 1) { f(self); } } diff --git a/src/frontend/src/optimizer/plan_visitor/plan_correlated_id_finder.rs b/src/frontend/src/optimizer/plan_visitor/plan_correlated_id_finder.rs index e2d042791af5..4a62fe5aa4f8 100644 --- a/src/frontend/src/optimizer/plan_visitor/plan_correlated_id_finder.rs +++ b/src/frontend/src/optimizer/plan_visitor/plan_correlated_id_finder.rs @@ -43,7 +43,6 @@ impl PlanCorrelatedIdFinder { impl PlanVisitor for PlanCorrelatedIdFinder { /// `correlated_input_ref` can only appear in `LogicalProject`, `LogicalFilter`, /// `LogicalJoin` or the `filter` clause of `PlanAggCall` of `LogicalAgg` now. - type Result = (); type DefaultBehavior = impl DefaultBehavior; diff --git a/src/frontend/src/optimizer/rule/apply_union_transpose_rule.rs b/src/frontend/src/optimizer/rule/apply_union_transpose_rule.rs index 0bfe6e268e14..e66f4c8e11bc 100644 --- a/src/frontend/src/optimizer/rule/apply_union_transpose_rule.rs +++ b/src/frontend/src/optimizer/rule/apply_union_transpose_rule.rs @@ -39,7 +39,6 @@ use crate::optimizer::PlanRef; /// / \ / \ /// Domain T1 Domain T2 /// ``` - pub struct ApplyUnionTransposeRule {} impl Rule for ApplyUnionTransposeRule { fn apply(&self, plan: PlanRef) -> Option { diff --git a/src/frontend/src/optimizer/rule/pull_up_correlated_predicate_agg_rule.rs b/src/frontend/src/optimizer/rule/pull_up_correlated_predicate_agg_rule.rs index 4a59dcda785b..0cd3dfdd5716 100644 --- a/src/frontend/src/optimizer/rule/pull_up_correlated_predicate_agg_rule.rs +++ b/src/frontend/src/optimizer/rule/pull_up_correlated_predicate_agg_rule.rs @@ -59,7 +59,6 @@ use crate::utils::{Condition, IndexSet}; /// | /// Filter /// ``` - pub struct PullUpCorrelatedPredicateAggRule {} impl Rule for PullUpCorrelatedPredicateAggRule { fn apply(&self, plan: PlanRef) -> Option { diff --git a/src/frontend/src/scheduler/streaming_manager.rs b/src/frontend/src/scheduler/streaming_manager.rs index dfe04acaa24d..6e9c07eb8f98 100644 --- a/src/frontend/src/scheduler/streaming_manager.rs +++ b/src/frontend/src/scheduler/streaming_manager.rs @@ -92,7 +92,7 @@ pub struct StreamingJobGuard<'a> { tracker: &'a StreamingJobTracker, } -impl<'a> Drop for StreamingJobGuard<'a> { +impl Drop for StreamingJobGuard<'_> { fn drop(&mut self) { self.tracker.delete_job(&self.task_id); } diff --git a/src/frontend/src/utils/condition.rs b/src/frontend/src/utils/condition.rs index 5bb53a84ae41..f3f9738e2cae 100644 --- a/src/frontend/src/utils/condition.rs +++ b/src/frontend/src/utils/condition.rs @@ -663,14 +663,14 @@ impl Condition { new_conds: &ScalarImpl, eq_conds: &[Option], ) -> bool { - return !eq_conds.is_empty() + !eq_conds.is_empty() && eq_conds.iter().all(|l| { if let Some(l) = l { l != new_conds } else { true } - }); + }) } fn merge_lower_bound_conjunctions(lb: Vec>) -> Bound { diff --git a/src/frontend/src/utils/index_set.rs b/src/frontend/src/utils/index_set.rs index 000fb2ef924a..e34d2f1f66cb 100644 --- a/src/frontend/src/utils/index_set.rs +++ b/src/frontend/src/utils/index_set.rs @@ -106,7 +106,7 @@ impl BitAnd for IndexSet { } } -impl<'a> BitAnd for &'a IndexSet { +impl BitAnd for &IndexSet { type Output = IndexSet; fn bitand(self, rhs: Self) -> Self::Output { @@ -126,7 +126,7 @@ impl BitOr for IndexSet { } } -impl<'a> BitOr for &'a IndexSet { +impl BitOr for &IndexSet { type Output = IndexSet; fn bitor(self, rhs: Self) -> Self::Output { diff --git a/src/frontend/src/utils/pretty_serde.rs b/src/frontend/src/utils/pretty_serde.rs index 37959ce3eb97..705267c3163b 100644 --- a/src/frontend/src/utils/pretty_serde.rs +++ b/src/frontend/src/utils/pretty_serde.rs @@ -30,7 +30,7 @@ use serde::{Serialize, Serializer}; pub struct PrettySerde<'a>(pub Pretty<'a>); -impl<'a> Serialize for PrettySerde<'a> { +impl Serialize for PrettySerde<'_> { fn serialize(&self, serializer: S) -> Result where S: Serializer, diff --git a/src/jni_core/src/lib.rs b/src/jni_core/src/lib.rs index 3f776c3a2e98..d700d979896c 100644 --- a/src/jni_core/src/lib.rs +++ b/src/jni_core/src/lib.rs @@ -118,7 +118,7 @@ pub struct SliceGuard<'env, 'array> { slice: &'array [u8], } -impl<'env, 'array> Deref for SliceGuard<'env, 'array> { +impl Deref for SliceGuard<'_, '_> { type Target = [u8]; fn deref(&self) -> &Self::Target { @@ -132,7 +132,7 @@ pub struct Pointer<'a, T> { _phantom: PhantomData<&'a T>, } -impl<'a, T> Default for Pointer<'a, T> { +impl Default for Pointer<'_, T> { fn default() -> Self { Self { pointer: 0, @@ -187,7 +187,7 @@ impl<'a> Deref for EnvParam<'a> { } } -impl<'a> DerefMut for EnvParam<'a> { +impl DerefMut for EnvParam<'_> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.env } @@ -306,7 +306,7 @@ impl JavaBindingIterator<'static> { } } -impl<'a> Deref for JavaBindingIterator<'a> { +impl Deref for JavaBindingIterator<'_> { type Target = OwnedRow; fn deref(&self) -> &Self::Target { diff --git a/src/meta/src/barrier/mod.rs b/src/meta/src/barrier/mod.rs index 590add2b9333..f1b80bbcbc00 100644 --- a/src/meta/src/barrier/mod.rs +++ b/src/meta/src/barrier/mod.rs @@ -1090,7 +1090,6 @@ impl CheckpointControl { impl GlobalBarrierWorker { /// Set barrier manager status. - async fn failure_recovery(&mut self, err: MetaError) { self.clear_on_err(&err).await; diff --git a/src/meta/src/hummock/manager/compaction/compaction_group_manager.rs b/src/meta/src/hummock/manager/compaction/compaction_group_manager.rs index cc5b80cc29ca..02b63ab47de6 100644 --- a/src/meta/src/hummock/manager/compaction/compaction_group_manager.rs +++ b/src/meta/src/hummock/manager/compaction/compaction_group_manager.rs @@ -489,6 +489,7 @@ impl CompactionGroupManager { CompactionGroupTransaction::new(&mut self.compaction_groups) } + #[expect(clippy::type_complexity)] pub fn start_owned_compaction_groups_txn>( inner: P, ) -> BTreeMapTransactionInner< @@ -591,7 +592,7 @@ fn update_compaction_config(target: &mut CompactionConfig, items: &[MutableConfi } } -impl<'a> CompactionGroupTransaction<'a> { +impl CompactionGroupTransaction<'_> { /// Inserts compaction group configs if they do not exist. pub fn try_create_compaction_groups( &mut self, diff --git a/src/meta/src/hummock/manager/compaction/mod.rs b/src/meta/src/hummock/manager/compaction/mod.rs index 80c6e5ca81c9..cf2c448f1002 100644 --- a/src/meta/src/hummock/manager/compaction/mod.rs +++ b/src/meta/src/hummock/manager/compaction/mod.rs @@ -143,7 +143,7 @@ fn init_selectors() -> HashMap HummockVersionTransaction<'a> { +impl HummockVersionTransaction<'_> { fn apply_compact_task(&mut self, compact_task: &CompactTask) { let mut version_delta = self.new_delta(); let trivial_move = CompactStatus::is_trivial_move_task(compact_task); @@ -1097,7 +1097,6 @@ impl HummockManager { /// /// Return Ok(false) indicates either the task is not found, /// or the task is not owned by `context_id` when `context_id` is not None. - pub async fn report_compact_tasks(&self, report_tasks: Vec) -> Result> { let mut guard = self.compaction.write().await; let deterministic_mode = self.env.opts.compaction_deterministic_test; diff --git a/src/meta/src/hummock/manager/transaction.rs b/src/meta/src/hummock/manager/transaction.rs index 57a228f35805..054ae657d594 100644 --- a/src/meta/src/hummock/manager/transaction.rs +++ b/src/meta/src/hummock/manager/transaction.rs @@ -199,7 +199,7 @@ impl<'a> HummockVersionTransaction<'a> { } } -impl<'a> InMemValTransaction for HummockVersionTransaction<'a> { +impl InMemValTransaction for HummockVersionTransaction<'_> { fn commit(self) { if let Some((version, deltas)) = self.pre_applied_version { *self.orig_version = version; @@ -258,7 +258,7 @@ pub(super) struct SingleDeltaTransaction<'a, 'b> { delta: Option, } -impl<'a, 'b> SingleDeltaTransaction<'a, 'b> { +impl SingleDeltaTransaction<'_, '_> { pub(super) fn latest_version(&self) -> &HummockVersion { self.version_txn.latest_version() } @@ -278,7 +278,7 @@ impl<'a, 'b> SingleDeltaTransaction<'a, 'b> { } } -impl<'a, 'b> Deref for SingleDeltaTransaction<'a, 'b> { +impl Deref for SingleDeltaTransaction<'_, '_> { type Target = HummockVersionDelta; fn deref(&self) -> &Self::Target { @@ -286,13 +286,13 @@ impl<'a, 'b> Deref for SingleDeltaTransaction<'a, 'b> { } } -impl<'a, 'b> DerefMut for SingleDeltaTransaction<'a, 'b> { +impl DerefMut for SingleDeltaTransaction<'_, '_> { fn deref_mut(&mut self) -> &mut Self::Target { self.delta.as_mut().expect("should exist") } } -impl<'a, 'b> Drop for SingleDeltaTransaction<'a, 'b> { +impl Drop for SingleDeltaTransaction<'_, '_> { fn drop(&mut self) { if let Some(delta) = self.delta.take() { self.version_txn.pre_apply(delta); @@ -317,7 +317,7 @@ impl<'a> HummockVersionStatsTransaction<'a> { } } -impl<'a> InMemValTransaction for HummockVersionStatsTransaction<'a> { +impl InMemValTransaction for HummockVersionStatsTransaction<'_> { fn commit(self) { if self.stats.has_new_value() { let stats = self.stats.clone(); @@ -337,7 +337,7 @@ where } } -impl<'a> Deref for HummockVersionStatsTransaction<'a> { +impl Deref for HummockVersionStatsTransaction<'_> { type Target = HummockVersionStats; fn deref(&self) -> &Self::Target { @@ -345,7 +345,7 @@ impl<'a> Deref for HummockVersionStatsTransaction<'a> { } } -impl<'a> DerefMut for HummockVersionStatsTransaction<'a> { +impl DerefMut for HummockVersionStatsTransaction<'_> { fn deref_mut(&mut self) -> &mut Self::Target { self.stats.deref_mut() } diff --git a/src/meta/src/lib.rs b/src/meta/src/lib.rs index 8d65cf00f1a4..7b80eddb347d 100644 --- a/src/meta/src/lib.rs +++ b/src/meta/src/lib.rs @@ -26,12 +26,10 @@ #![cfg_attr(coverage, feature(coverage_attribute))] #![feature(custom_test_frameworks)] #![test_runner(risingwave_test_runner::test_runner::run_failpont_tests)] -#![feature(is_sorted)] #![feature(impl_trait_in_assoc_type)] #![feature(const_option)] #![feature(anonymous_lifetime_in_impl_trait)] #![feature(duration_millis_float)] -#![feature(option_get_or_insert_default)] pub mod backup_restore; pub mod barrier; diff --git a/src/meta/src/model/mod.rs b/src/meta/src/model/mod.rs index 829ebb589025..10d7f08448ad 100644 --- a/src/meta/src/model/mod.rs +++ b/src/meta/src/model/mod.rs @@ -113,7 +113,7 @@ impl<'a, T> VarTransaction<'a, T> { } } -impl<'a, T> Deref for VarTransaction<'a, T> { +impl Deref for VarTransaction<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { @@ -124,7 +124,7 @@ impl<'a, T> Deref for VarTransaction<'a, T> { } } -impl<'a, T: Clone> DerefMut for VarTransaction<'a, T> { +impl DerefMut for VarTransaction<'_, T> { fn deref_mut(&mut self) -> &mut Self::Target { if self.new_value.is_none() { self.new_value.replace(self.orig_value_ref.clone()); @@ -133,7 +133,7 @@ impl<'a, T: Clone> DerefMut for VarTransaction<'a, T> { } } -impl<'a, T> InMemValTransaction for VarTransaction<'a, T> +impl InMemValTransaction for VarTransaction<'_, T> where T: PartialEq, { @@ -202,7 +202,7 @@ impl<'a, K: Ord, V: Clone> BTreeMapTransactionValueGuard<'a, K, V> { } } -impl<'a, K: Ord, V: Clone> Deref for BTreeMapTransactionValueGuard<'a, K, V> { +impl Deref for BTreeMapTransactionValueGuard<'_, K, V> { type Target = V; fn deref(&self) -> &Self::Target { @@ -216,7 +216,7 @@ impl<'a, K: Ord, V: Clone> Deref for BTreeMapTransactionValueGuard<'a, K, V> { } } -impl<'a, K: Ord, V: Clone> DerefMut for BTreeMapTransactionValueGuard<'a, K, V> { +impl DerefMut for BTreeMapTransactionValueGuard<'_, K, V> { fn deref_mut(&mut self) -> &mut Self::Target { let is_occupied = matches!( self.staging_entry.as_ref().unwrap(), @@ -478,7 +478,7 @@ impl<'a, K: Ord + Debug, V: Clone> BTreeMapEntryTransaction<'a, K, V> { } } -impl<'a, K, V> Deref for BTreeMapEntryTransaction<'a, K, V> { +impl Deref for BTreeMapEntryTransaction<'_, K, V> { type Target = V; fn deref(&self) -> &Self::Target { @@ -486,13 +486,13 @@ impl<'a, K, V> Deref for BTreeMapEntryTransaction<'a, K, V> { } } -impl<'a, K, V> DerefMut for BTreeMapEntryTransaction<'a, K, V> { +impl DerefMut for BTreeMapEntryTransaction<'_, K, V> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.new_value } } -impl<'a, K: Ord, V: PartialEq> InMemValTransaction for BTreeMapEntryTransaction<'a, K, V> { +impl InMemValTransaction for BTreeMapEntryTransaction<'_, K, V> { fn commit(self) { self.tree_ref.insert(self.key, self.new_value); } diff --git a/src/sqlparser/src/ast/ddl.rs b/src/sqlparser/src/ast/ddl.rs index 451e8ddf9990..15ac6a9d2762 100644 --- a/src/sqlparser/src/ast/ddl.rs +++ b/src/sqlparser/src/ast/ddl.rs @@ -731,7 +731,7 @@ impl fmt::Display for ColumnOption { fn display_constraint_name(name: &'_ Option) -> impl fmt::Display + '_ { struct ConstraintName<'a>(&'a Option); - impl<'a> fmt::Display for ConstraintName<'a> { + impl fmt::Display for ConstraintName<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if let Some(name) = self.0 { write!(f, "CONSTRAINT {} ", name)?; diff --git a/src/sqlparser/src/ast/mod.rs b/src/sqlparser/src/ast/mod.rs index 1523a1bbb2e1..563dc66be478 100644 --- a/src/sqlparser/src/ast/mod.rs +++ b/src/sqlparser/src/ast/mod.rs @@ -76,7 +76,7 @@ where sep: &'static str, } -impl<'a, T> fmt::Display for DisplaySeparated<'a, T> +impl fmt::Display for DisplaySeparated<'_, T> where T: fmt::Display, { diff --git a/src/sqlparser/src/ast/query.rs b/src/sqlparser/src/ast/query.rs index 0dd7ab2f626f..428fe4e4c541 100644 --- a/src/sqlparser/src/ast/query.rs +++ b/src/sqlparser/src/ast/query.rs @@ -321,6 +321,7 @@ impl fmt::Display for With { } /// A single CTE (used after `WITH`): `alias [(col1, col2, ...)] AS ( query )` +/// /// The names in the column list before `AS`, when specified, replace the names /// of the columns returned by the query. The parser does not validate that the /// number of columns in the query matches the number of columns in the query. @@ -464,9 +465,8 @@ impl fmt::Display for TableFactor { match self { TableFactor::Table { name, alias, as_of } => { write!(f, "{}", name)?; - match as_of { - Some(as_of) => write!(f, "{}", as_of)?, - None => (), + if let Some(as_of) = as_of { + write!(f, "{}", as_of)? } if let Some(alias) = alias { write!(f, " AS {}", alias)?; @@ -541,7 +541,7 @@ impl fmt::Display for Join { } fn suffix(constraint: &'_ JoinConstraint) -> impl fmt::Display + '_ { struct Suffix<'a>(&'a JoinConstraint); - impl<'a> fmt::Display for Suffix<'a> { + impl fmt::Display for Suffix<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self.0 { JoinConstraint::On(expr) => write!(f, " ON {}", expr), diff --git a/src/sqlparser/src/ast/value.rs b/src/sqlparser/src/ast/value.rs index 9cae715e0927..2bf8a6fdf3a0 100644 --- a/src/sqlparser/src/ast/value.rs +++ b/src/sqlparser/src/ast/value.rs @@ -181,7 +181,7 @@ impl fmt::Display for DateTimeField { pub struct EscapeSingleQuoteString<'a>(&'a str); -impl<'a> fmt::Display for EscapeSingleQuoteString<'a> { +impl fmt::Display for EscapeSingleQuoteString<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { for c in self.0.chars() { if c == '\'' { diff --git a/src/sqlparser/src/parser_v2/impl_.rs b/src/sqlparser/src/parser_v2/impl_.rs index e4b6af291974..328fccb20076 100644 --- a/src/sqlparser/src/parser_v2/impl_.rs +++ b/src/sqlparser/src/parser_v2/impl_.rs @@ -26,7 +26,7 @@ impl<'a> Offset> for CheckpointWrapper<'a> { } // Used for diagnostics with `--features winnow/debug`. -impl<'a> std::fmt::Debug for Parser<'a> { +impl std::fmt::Debug for Parser<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { if let Some(token) = self.0.first() { write!(f, "{}", token.token)?; @@ -52,7 +52,7 @@ impl<'a> Offset> for Parser<'a> { } } -impl<'a> SliceLen for Parser<'a> { +impl SliceLen for Parser<'_> { #[inline(always)] fn slice_len(&self) -> usize { self.0.len() @@ -135,7 +135,7 @@ impl<'a> Stream for Parser<'a> { } } -impl<'a> UpdateSlice for Parser<'a> { +impl UpdateSlice for Parser<'_> { #[inline(always)] fn update_slice(self, inner: Self::Slice) -> Self { Parser(self.0.update_slice(inner.0)) diff --git a/src/sqlparser/src/test_utils.rs b/src/sqlparser/src/test_utils.rs index bfdf04dcc2d3..b6675928302c 100644 --- a/src/sqlparser/src/test_utils.rs +++ b/src/sqlparser/src/test_utils.rs @@ -45,6 +45,7 @@ pub fn parse_sql_statements(sql: &str) -> Result, ParserError> { } /// Ensures that `sql` parses as a single statement and returns it. +/// /// If non-empty `canonical` SQL representation is provided, /// additionally asserts that parsing `sql` results in the same parse /// tree as parsing `canonical`, and that serializing it back to string diff --git a/src/storage/backup/src/meta_snapshot_v1.rs b/src/storage/backup/src/meta_snapshot_v1.rs index b873f863b6d0..c073dba1c270 100644 --- a/src/storage/backup/src/meta_snapshot_v1.rs +++ b/src/storage/backup/src/meta_snapshot_v1.rs @@ -29,8 +29,7 @@ use risingwave_pb::user::UserInfo; use crate::error::{BackupError, BackupResult}; use crate::meta_snapshot::{MetaSnapshot, Metadata}; -/// TODO: remove `ClusterMetadata` and even the trait, after applying model v2. - +// TODO: remove `ClusterMetadata` and even the trait, after applying model v2. pub type MetaSnapshotV1 = MetaSnapshot; impl Display for ClusterMetadata { diff --git a/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs b/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs index 9abd99cefb51..7a1f0851d3d4 100644 --- a/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs +++ b/src/storage/hummock_sdk/src/compaction_group/hummock_version_ext.rs @@ -116,7 +116,7 @@ impl HummockVersion { pub fn get_sst_infos_from_groups<'a>( &'a self, select_group: &'a HashSet, - ) -> impl Iterator + 'a { + ) -> impl Iterator + 'a { self.levels .iter() .filter_map(|(cg_id, level)| { @@ -332,7 +332,7 @@ impl HummockVersion { let [parent_levels, cur_levels] = self .levels .get_many_mut([&parent_group_id, &group_id]) - .unwrap(); + .map(|res| res.unwrap()); let l0 = &mut parent_levels.l0; { for sub_level in &mut l0.sub_levels { @@ -895,7 +895,8 @@ impl HummockVersionCommon { let [parent_levels, cur_levels] = self .levels .get_many_mut([&parent_group_id, &group_id]) - .unwrap(); + .map(|res| res.unwrap()); + let l0 = &mut parent_levels.l0; { for sub_level in &mut l0.sub_levels { diff --git a/src/storage/hummock_sdk/src/compaction_group/mod.rs b/src/storage/hummock_sdk/src/compaction_group/mod.rs index 0bf3fcea1c4e..dbe58018f15e 100644 --- a/src/storage/hummock_sdk/src/compaction_group/mod.rs +++ b/src/storage/hummock_sdk/src/compaction_group/mod.rs @@ -44,6 +44,10 @@ impl From for CompactionGroupId { } } +/// The split will follow the following rules: +/// 1. Ssts with `split_key` will be split into two separate ssts and their `key_range` will be changed `sst_1`: [`sst.key_range.right`, `split_key`) `sst_2`: [`split_key`, `sst.key_range.right`]. +/// 2. Currently only `vnode` 0 and `vnode` max is supported. +/// 3. Due to the above rule, `vnode` max will be rewritten as `table_id` + 1, vnode 0 pub mod group_split { use std::cmp::Ordering; use std::collections::BTreeSet; @@ -61,11 +65,6 @@ pub mod group_split { use crate::sstable_info::SstableInfo; use crate::{can_concat, HummockEpoch, KeyComparator}; - /// The split will follow the following rules: - /// 1. Ssts with `split_key` will be split into two separate ssts and their `key_range` will be changed `sst_1`: [`sst.key_range.right`, `split_key`) `sst_2`: [`split_key`, `sst.key_range.right`]. - /// 2. Currently only `vnode` 0 and `vnode` max is supported. - /// 3. Due to the above rule, `vnode` max will be rewritten as `table_id` + 1, vnode 0 - // By default, the split key is constructed with vnode = 0 and epoch = MAX, so that we can split table_id to the right group pub fn build_split_key(table_id: StateTableId, vnode: VirtualNode) -> Bytes { build_split_full_key(table_id, vnode).encode().into() diff --git a/src/storage/hummock_sdk/src/key.rs b/src/storage/hummock_sdk/src/key.rs index 9685b0cff3ec..3318756d6667 100644 --- a/src/storage/hummock_sdk/src/key.rs +++ b/src/storage/hummock_sdk/src/key.rs @@ -292,7 +292,6 @@ pub fn prev_epoch(epoch: &[u8]) -> Vec { /// compute the next full key of the given full key /// /// if the `user_key` has no successor key, the result will be a empty vec - pub fn next_full_key(full_key: &[u8]) -> Vec { let (user_key, epoch) = split_key_epoch(full_key); let prev_epoch = prev_epoch(epoch); @@ -315,7 +314,6 @@ pub fn next_full_key(full_key: &[u8]) -> Vec { /// compute the prev full key of the given full key /// /// if the `user_key` has no predecessor key, the result will be a empty vec - pub fn prev_full_key(full_key: &[u8]) -> Vec { let (user_key, epoch) = split_key_epoch(full_key); let next_epoch = next_epoch(epoch); @@ -532,7 +530,7 @@ impl EstimateSize for TableKey { } } -impl<'a> TableKey<&'a [u8]> { +impl TableKey<&[u8]> { pub fn copy_into>(&self) -> TableKey { TableKey(T::copy_from_slice(self.as_ref())) } @@ -646,7 +644,7 @@ impl<'a> UserKey<&'a [u8]> { } } -impl<'a, T: AsRef<[u8]> + Clone> UserKey<&'a T> { +impl + Clone> UserKey<&T> { pub fn cloned(self) -> UserKey { UserKey { table_id: self.table_id, @@ -941,7 +939,7 @@ impl EmptySliceRef for Vec { } const EMPTY_SLICE: &[u8] = b""; -impl<'a> EmptySliceRef for &'a [u8] { +impl EmptySliceRef for &[u8] { fn empty_slice_ref<'b>() -> &'b Self { &EMPTY_SLICE } diff --git a/src/storage/hummock_sdk/src/lib.rs b/src/storage/hummock_sdk/src/lib.rs index aae0c0c0971a..366fc02310eb 100644 --- a/src/storage/hummock_sdk/src/lib.rs +++ b/src/storage/hummock_sdk/src/lib.rs @@ -18,7 +18,6 @@ #![feature(map_many_mut)] #![feature(type_alias_impl_trait)] #![feature(impl_trait_in_assoc_type)] -#![feature(is_sorted)] #![feature(let_chains)] #![feature(btree_cursors)] #![feature(strict_overflow_ops)] diff --git a/src/storage/hummock_sdk/src/version.rs b/src/storage/hummock_sdk/src/version.rs index b106563cdc7a..80276b09ffdf 100644 --- a/src/storage/hummock_sdk/src/version.rs +++ b/src/storage/hummock_sdk/src/version.rs @@ -526,7 +526,7 @@ impl HummockVersionDelta { pub fn newly_added_sst_infos<'a>( &'a self, select_group: Option<&'a HashSet>, - ) -> impl Iterator + 'a { + ) -> impl Iterator + 'a { self.group_deltas .iter() .filter_map(move |(cg_id, group_deltas)| { diff --git a/src/storage/hummock_trace/src/lib.rs b/src/storage/hummock_trace/src/lib.rs index 48b0a71010a7..3a2f1dd643f8 100644 --- a/src/storage/hummock_trace/src/lib.rs +++ b/src/storage/hummock_trace/src/lib.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#![feature(cursor_remaining)] +#![feature(cursor_split)] #![feature(trait_alias)] #![feature(coroutines)] diff --git a/src/storage/hummock_trace/src/read.rs b/src/storage/hummock_trace/src/read.rs index bf6563123044..858e680f35aa 100644 --- a/src/storage/hummock_trace/src/read.rs +++ b/src/storage/hummock_trace/src/read.rs @@ -185,7 +185,8 @@ mod test { } assert!(deserializer.deserialize(&mut buf).is_err()); - assert!(buf.is_empty()); + // https://github.com/rust-lang/rust/pull/109174 + assert!(buf.split().1.is_empty()); } #[test] diff --git a/src/storage/src/hummock/compactor/compaction_utils.rs b/src/storage/src/hummock/compactor/compaction_utils.rs index 3b032123f426..f11fb1eca76b 100644 --- a/src/storage/src/hummock/compactor/compaction_utils.rs +++ b/src/storage/src/hummock/compactor/compaction_utils.rs @@ -674,6 +674,6 @@ pub fn calculate_task_parallelism_impl( compaction_size: u64, max_sub_compaction: u32, ) -> usize { - let parallelism = (compaction_size + parallel_compact_size - 1) / parallel_compact_size; + let parallelism = compaction_size.div_ceil(parallel_compact_size); worker_num.min(parallelism.min(max_sub_compaction as u64) as usize) } diff --git a/src/storage/src/hummock/event_handler/uploader/mod.rs b/src/storage/src/hummock/event_handler/uploader/mod.rs index 6a20f96008db..8326b3b87689 100644 --- a/src/storage/src/hummock/event_handler/uploader/mod.rs +++ b/src/storage/src/hummock/event_handler/uploader/mod.rs @@ -655,6 +655,7 @@ impl TableUnsyncData { self.unsync_epochs.insert(epoch, ()); } + #[expect(clippy::type_complexity)] fn sync( &mut self, epoch: HummockEpoch, diff --git a/src/storage/src/hummock/event_handler/uploader/test_utils.rs b/src/storage/src/hummock/event_handler/uploader/test_utils.rs index 2f711ede7cef..6eb41bda5207 100644 --- a/src/storage/src/hummock/event_handler/uploader/test_utils.rs +++ b/src/storage/src/hummock/event_handler/uploader/test_utils.rs @@ -271,6 +271,7 @@ impl HummockUploader { } } +#[expect(clippy::type_complexity)] pub(crate) fn prepare_uploader_order_test( config: &StorageOpts, skip_schedule: bool, diff --git a/src/storage/src/hummock/iterator/merge_inner.rs b/src/storage/src/hummock/iterator/merge_inner.rs index 54221ee8b70a..68fbc7876f1e 100644 --- a/src/storage/src/hummock/iterator/merge_inner.rs +++ b/src/storage/src/hummock/iterator/merge_inner.rs @@ -172,7 +172,7 @@ impl<'a, T: Ord> PeekMutGuard<'a, T> { } } -impl<'a, T: Ord> Deref for PeekMutGuard<'a, T> { +impl Deref for PeekMutGuard<'_, T> { type Target = T; fn deref(&self) -> &Self::Target { @@ -180,13 +180,13 @@ impl<'a, T: Ord> Deref for PeekMutGuard<'a, T> { } } -impl<'a, T: Ord> DerefMut for PeekMutGuard<'a, T> { +impl DerefMut for PeekMutGuard<'_, T> { fn deref_mut(&mut self) -> &mut Self::Target { self.peek.as_mut().expect("should not be None") } } -impl<'a, T: Ord> Drop for PeekMutGuard<'a, T> { +impl Drop for PeekMutGuard<'_, T> { /// When the guard is dropped, if `pop` or `used` is not called before it is dropped, we will /// call `PeekMut::pop` on the `PeekMut` and recycle the node to the unused list. fn drop(&mut self) { diff --git a/src/storage/src/hummock/iterator/mod.rs b/src/storage/src/hummock/iterator/mod.rs index a205baac0aa9..e0a1d433892d 100644 --- a/src/storage/src/hummock/iterator/mod.rs +++ b/src/storage/src/hummock/iterator/mod.rs @@ -129,7 +129,7 @@ pub trait HummockIterator: Send { fn seek<'a>( &'a mut self, key: FullKey<&'a [u8]>, - ) -> impl Future> + Send + '_; + ) -> impl Future> + Send; /// take local statistic info from iterator to report metrics. fn collect_local_statistic(&self, _stats: &mut StoreLocalStatistic); diff --git a/src/storage/src/hummock/sstable/utils.rs b/src/storage/src/hummock/sstable/utils.rs index 4f4693d5e60b..e9211ed0e32c 100644 --- a/src/storage/src/hummock/sstable/utils.rs +++ b/src/storage/src/hummock/sstable/utils.rs @@ -60,7 +60,6 @@ pub fn xxhash64_checksum(data: &[u8]) -> u64 { } /// Verifies the checksum of the data equals the given checksum with xxhash64. - pub fn xxhash64_verify(data: &[u8], checksum: u64) -> HummockResult<()> { let data_checksum = xxhash64_checksum(data); if data_checksum != checksum { diff --git a/src/storage/src/hummock/store/local_hummock_storage.rs b/src/storage/src/hummock/store/local_hummock_storage.rs index d0082f21b31f..a2fcc5a2c786 100644 --- a/src/storage/src/hummock/store/local_hummock_storage.rs +++ b/src/storage/src/hummock/store/local_hummock_storage.rs @@ -58,7 +58,6 @@ use crate::store::*; /// `LocalHummockStorage` is a handle for a state table shard to access data from and write data to /// the hummock state backend. It is created via `HummockStorage::new_local`. - pub struct LocalHummockStorage { mem_table: MemTable, @@ -781,7 +780,7 @@ impl<'a> HummockStorageIteratorInner<'a> { } } -impl<'a> Drop for HummockStorageIteratorInner<'a> { +impl Drop for HummockStorageIteratorInner<'_> { fn drop(&mut self) { self.inner .collect_local_statistic(&mut self.stats_guard.local_stats); @@ -863,7 +862,7 @@ impl<'a> HummockStorageRevIteratorInner<'a> { } } -impl<'a> Drop for HummockStorageRevIteratorInner<'a> { +impl Drop for HummockStorageRevIteratorInner<'_> { fn drop(&mut self) { self.inner .collect_local_statistic(&mut self.stats_guard.local_stats); diff --git a/src/storage/src/hummock/store/version.rs b/src/storage/src/hummock/store/version.rs index 33bc9fc49f75..d38424820c70 100644 --- a/src/storage/src/hummock/store/version.rs +++ b/src/storage/src/hummock/store/version.rs @@ -165,8 +165,8 @@ impl StagingVersion { table_id: TableId, table_key_range: &'a TableKeyRange, ) -> ( - impl Iterator + 'a, - impl Iterator + 'a, + impl Iterator + 'a, + impl Iterator + 'a, ) { let (ref left, ref right) = table_key_range; let left = left.as_ref().map(|key| TableKey(key.0.as_ref())); diff --git a/src/storage/src/lib.rs b/src/storage/src/lib.rs index 779062767c7a..07b06d0c5259 100644 --- a/src/storage/src/lib.rs +++ b/src/storage/src/lib.rs @@ -27,7 +27,6 @@ #![feature(type_changing_struct_update)] #![test_runner(risingwave_test_runner::test_runner::run_failpont_tests)] #![feature(assert_matches)] -#![feature(is_sorted)] #![feature(btree_extract_if)] #![feature(exact_size_is_empty)] #![cfg_attr(coverage, feature(coverage_attribute))] diff --git a/src/storage/src/store_impl.rs b/src/storage/src/store_impl.rs index ae9f630f304c..17bb7fb98f83 100644 --- a/src/storage/src/store_impl.rs +++ b/src/storage/src/store_impl.rs @@ -844,11 +844,13 @@ pub mod boxed_state_store { use crate::store::*; use crate::store_impl::AsHummock; + #[expect(elided_named_lifetimes)] // false positive #[async_trait::async_trait] pub trait DynamicDispatchedStateStoreIter: Send { async fn try_next(&mut self) -> StorageResult>>; } + #[expect(elided_named_lifetimes)] // false positive #[async_trait::async_trait] impl> DynamicDispatchedStateStoreIter for I { async fn try_next(&mut self) -> StorageResult>> { @@ -954,12 +956,14 @@ pub mod boxed_state_store { read_options: ReadOptions, ) -> StorageResult>; + #[expect(elided_named_lifetimes)] // false positive async fn iter( &self, key_range: TableKeyRange, read_options: ReadOptions, ) -> StorageResult>; + #[expect(elided_named_lifetimes)] // false positive async fn rev_iter( &self, key_range: TableKeyRange, @@ -1002,6 +1006,7 @@ pub mod boxed_state_store { self.get(key, read_options).await } + #[expect(elided_named_lifetimes)] // false positive async fn iter( &self, key_range: TableKeyRange, @@ -1010,6 +1015,7 @@ pub mod boxed_state_store { Ok(Box::new(self.iter(key_range, read_options).await?)) } + #[expect(elided_named_lifetimes)] // false positive async fn rev_iter( &self, key_range: TableKeyRange, diff --git a/src/storage/src/table/merge_sort.rs b/src/storage/src/table/merge_sort.rs index 5f94656b7f65..57d5e780fbd6 100644 --- a/src/storage/src/table/merge_sort.rs +++ b/src/storage/src/table/merge_sort.rs @@ -54,7 +54,7 @@ struct Node<'a, S, R> { peeked: Box + 'a + Send + Sync>, } -impl<'a, S, R> PartialEq for Node<'a, S, R> { +impl PartialEq for Node<'_, S, R> { fn eq(&self, other: &Self) -> bool { match self.peeked.vnode_key() == other.peeked.vnode_key() { true => unreachable!("primary key from different iters should be unique"), @@ -62,15 +62,15 @@ impl<'a, S, R> PartialEq for Node<'a, S, R> { } } } -impl<'a, S, R> Eq for Node<'a, S, R> {} +impl Eq for Node<'_, S, R> {} -impl<'a, S, R> PartialOrd for Node<'a, S, R> { +impl PartialOrd for Node<'_, S, R> { fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } } -impl<'a, S, R> Ord for Node<'a, S, R> { +impl Ord for Node<'_, S, R> { fn cmp(&self, other: &Self) -> std::cmp::Ordering { // The heap is a max heap, so we need to reverse the order. self.peeked diff --git a/src/stream/src/cache/managed_lru.rs b/src/stream/src/cache/managed_lru.rs index 7e1b2aa39130..d498c20e2794 100644 --- a/src/stream/src/cache/managed_lru.rs +++ b/src/stream/src/cache/managed_lru.rs @@ -196,7 +196,7 @@ impl<'a, V: EstimateSize> MutGuard<'a, V> { } } -impl<'a, V: EstimateSize> Drop for MutGuard<'a, V> { +impl Drop for MutGuard<'_, V> { fn drop(&mut self) { let new_value_size = self.inner.estimated_size(); if new_value_size != self.old_value_size { @@ -209,7 +209,7 @@ impl<'a, V: EstimateSize> Drop for MutGuard<'a, V> { } } -impl<'a, V: EstimateSize> Deref for MutGuard<'a, V> { +impl Deref for MutGuard<'_, V> { type Target = V; fn deref(&self) -> &Self::Target { @@ -217,7 +217,7 @@ impl<'a, V: EstimateSize> Deref for MutGuard<'a, V> { } } -impl<'a, V: EstimateSize> DerefMut for MutGuard<'a, V> { +impl DerefMut for MutGuard<'_, V> { fn deref_mut(&mut self) -> &mut Self::Target { self.inner } diff --git a/src/stream/src/common/log_store_impl/kv_log_store/serde.rs b/src/stream/src/common/log_store_impl/kv_log_store/serde.rs index 6e020536cfb9..4bfe82aa7c41 100644 --- a/src/stream/src/common/log_store_impl/kv_log_store/serde.rs +++ b/src/stream/src/common/log_store_impl/kv_log_store/serde.rs @@ -1191,6 +1191,7 @@ mod tests { ) } + #[expect(clippy::type_complexity)] fn gen_single_test_stream( serde: LogStoreRowSerde, seq_id: &mut SeqIdType, diff --git a/src/stream/src/common/state_cache/ordered.rs b/src/stream/src/common/state_cache/ordered.rs index 8a47d1b7ecaf..02797eabad76 100644 --- a/src/stream/src/common/state_cache/ordered.rs +++ b/src/stream/src/common/state_cache/ordered.rs @@ -41,7 +41,10 @@ impl Default for OrderedStateCache } impl StateCache for OrderedStateCache { - type Filler<'a> = &'a mut Self where Self: 'a; + type Filler<'a> + = &'a mut Self + where + Self: 'a; type Key = K; type Value = V; diff --git a/src/stream/src/common/state_cache/top_n.rs b/src/stream/src/common/state_cache/top_n.rs index fef7017d7512..6ca988bf2740 100644 --- a/src/stream/src/common/state_cache/top_n.rs +++ b/src/stream/src/common/state_cache/top_n.rs @@ -108,7 +108,10 @@ impl TopNStateCache { } impl StateCache for TopNStateCache { - type Filler<'a> = &'a mut Self where Self: 'a; + type Filler<'a> + = &'a mut Self + where + Self: 'a; type Key = K; type Value = V; diff --git a/src/stream/src/executor/aggregation/agg_state_cache.rs b/src/stream/src/executor/aggregation/agg_state_cache.rs index 8a202ed6dd1d..dc04b1313ed0 100644 --- a/src/stream/src/executor/aggregation/agg_state_cache.rs +++ b/src/stream/src/executor/aggregation/agg_state_cache.rs @@ -161,7 +161,7 @@ where cache_filler: C::Filler<'filler>, } -impl<'filler, C> AggStateCacheFiller for GenericAggStateCacheFiller<'filler, C> +impl AggStateCacheFiller for GenericAggStateCacheFiller<'_, C> where C: StateCache, { diff --git a/src/stream/src/executor/mview/materialize.rs b/src/stream/src/executor/mview/materialize.rs index a5dc24d5cd74..c2cbef8e6114 100644 --- a/src/stream/src/executor/mview/materialize.rs +++ b/src/stream/src/executor/mview/materialize.rs @@ -702,11 +702,9 @@ impl MaterializeCache { ConflictBehavior::Overwrite | ConflictBehavior::IgnoreConflict | ConflictBehavior::DoUpdateIfNotNull => { - match self.force_get(&key) { - Some(old_row) => { - fixed_changes().delete(key.clone(), old_row.row.clone()); - } - None => (), // delete a nonexistent value + // delete a nonexistent value + if let Some(old_row) = self.force_get(&key) { + fixed_changes().delete(key.clone(), old_row.row.clone()); }; } _ => unreachable!(), diff --git a/src/stream/src/executor/nested_loop_temporal_join.rs b/src/stream/src/executor/nested_loop_temporal_join.rs index 55d21b468a77..842fa5254f8d 100644 --- a/src/stream/src/executor/nested_loop_temporal_join.rs +++ b/src/stream/src/executor/nested_loop_temporal_join.rs @@ -98,6 +98,7 @@ async fn phase1_handle_chunk( } impl NestedLoopTemporalJoinExecutor { + #[expect(dead_code)] #[expect(clippy::too_many_arguments)] pub fn new( ctx: ActorContextRef, diff --git a/src/stream/src/executor/sink.rs b/src/stream/src/executor/sink.rs index fc839bfb85da..206b8c498981 100644 --- a/src/stream/src/executor/sink.rs +++ b/src/stream/src/executor/sink.rs @@ -508,6 +508,7 @@ impl SinkExecutor { log_reader.init().await?; + #[expect(irrefutable_let_patterns)] // false positive while let Err(e) = sink .new_log_sinker(sink_writer_param.clone()) .and_then(|log_sinker| log_sinker.consume_log_and_sink(&mut log_reader)) diff --git a/src/stream/src/from_proto/stream_cdc_scan.rs b/src/stream/src/from_proto/stream_cdc_scan.rs index 3c81ecb80e85..18a47ae8a461 100644 --- a/src/stream/src/from_proto/stream_cdc_scan.rs +++ b/src/stream/src/from_proto/stream_cdc_scan.rs @@ -79,9 +79,9 @@ impl ExecutorBuilder for StreamCdcScanExecutorBuilder { .columns .iter() .filter(|col| { - !col.additional_column + col.additional_column .as_ref() - .is_some_and(|a_col| a_col.column_type.is_some()) + .is_none_or(|a_col| a_col.column_type.is_none()) }) .map(Into::into) .collect(); diff --git a/src/stream/src/lib.rs b/src/stream/src/lib.rs index 577b82994562..06893b16c245 100644 --- a/src/stream/src/lib.rs +++ b/src/stream/src/lib.rs @@ -34,7 +34,6 @@ #![feature(exact_size_is_empty)] #![feature(impl_trait_in_assoc_type)] #![feature(test)] -#![feature(is_sorted)] #![feature(btree_cursors)] #![feature(assert_matches)] #![feature(try_blocks)] diff --git a/src/tests/simulation/src/client.rs b/src/tests/simulation/src/client.rs index 84717583eb42..65ec200b05c3 100644 --- a/src/tests/simulation/src/client.rs +++ b/src/tests/simulation/src/client.rs @@ -53,7 +53,7 @@ where stmts_iter: core::iter::Rev>, } -impl<'a, 'b> SetStmtsIterator<'a, 'b> { +impl<'a> SetStmtsIterator<'a, '_> { fn new(stmts: &'a SetStmts) -> Self { Self { _stmts: stmts, diff --git a/src/tests/sqlsmith/src/sql_gen/agg.rs b/src/tests/sqlsmith/src/sql_gen/agg.rs index 177603ddb333..90f9dad3aaed 100644 --- a/src/tests/sqlsmith/src/sql_gen/agg.rs +++ b/src/tests/sqlsmith/src/sql_gen/agg.rs @@ -24,7 +24,7 @@ use risingwave_sqlparser::ast::{ use crate::sql_gen::types::AGG_FUNC_TABLE; use crate::sql_gen::{SqlGenerator, SqlGeneratorContext}; -impl<'a, R: Rng> SqlGenerator<'a, R> { +impl SqlGenerator<'_, R> { pub fn gen_agg(&mut self, ret: &DataType) -> Expr { let funcs = match AGG_FUNC_TABLE.get(ret) { None => return self.gen_simple_scalar(ret), diff --git a/src/tests/sqlsmith/src/sql_gen/cast.rs b/src/tests/sqlsmith/src/sql_gen/cast.rs index 464d6e39d86f..983333c6ca4f 100644 --- a/src/tests/sqlsmith/src/sql_gen/cast.rs +++ b/src/tests/sqlsmith/src/sql_gen/cast.rs @@ -21,7 +21,7 @@ use risingwave_sqlparser::ast::Expr; use crate::sql_gen::types::{data_type_to_ast_data_type, EXPLICIT_CAST_TABLE}; use crate::sql_gen::{SqlGenerator, SqlGeneratorContext}; -impl<'a, R: Rng> SqlGenerator<'a, R> { +impl SqlGenerator<'_, R> { pub(crate) fn gen_explicit_cast( &mut self, ret: &DataType, diff --git a/src/tests/sqlsmith/src/sql_gen/expr.rs b/src/tests/sqlsmith/src/sql_gen/expr.rs index ee4c7ac2ee9e..4625727f67dc 100644 --- a/src/tests/sqlsmith/src/sql_gen/expr.rs +++ b/src/tests/sqlsmith/src/sql_gen/expr.rs @@ -28,7 +28,7 @@ static STRUCT_FIELD_NAMES: [&str; 26] = [ "t", "u", "v", "w", "x", "y", "z", ]; -impl<'a, R: Rng> SqlGenerator<'a, R> { +impl SqlGenerator<'_, R> { /// In generating expression, there are two execution modes: /// 1) Can have Aggregate expressions (`can_agg` = true) /// We can have aggregate of all bound columns (those present in GROUP BY and otherwise). diff --git a/src/tests/sqlsmith/src/sql_gen/functions.rs b/src/tests/sqlsmith/src/sql_gen/functions.rs index 8cd1645ec1f5..7e78334de9fa 100644 --- a/src/tests/sqlsmith/src/sql_gen/functions.rs +++ b/src/tests/sqlsmith/src/sql_gen/functions.rs @@ -25,7 +25,7 @@ use risingwave_sqlparser::ast::{ use crate::sql_gen::types::{FUNC_TABLE, IMPLICIT_CAST_TABLE, INVARIANT_FUNC_SET}; use crate::sql_gen::{SqlGenerator, SqlGeneratorContext}; -impl<'a, R: Rng> SqlGenerator<'a, R> { +impl SqlGenerator<'_, R> { pub fn gen_func(&mut self, ret: &DataType, context: SqlGeneratorContext) -> Expr { match self.rng.gen_bool(0.1) { true => self.gen_special_func(ret, context), diff --git a/src/tests/sqlsmith/src/sql_gen/query.rs b/src/tests/sqlsmith/src/sql_gen/query.rs index dcead4275c7a..cfbfdb70cbf8 100644 --- a/src/tests/sqlsmith/src/sql_gen/query.rs +++ b/src/tests/sqlsmith/src/sql_gen/query.rs @@ -30,7 +30,7 @@ use crate::sql_gen::utils::create_table_with_joins_from_table; use crate::sql_gen::{Column, SqlGenerator, SqlGeneratorContext, Table}; /// Generators -impl<'a, R: Rng> SqlGenerator<'a, R> { +impl SqlGenerator<'_, R> { /// Generates query expression and returns its /// query schema as well. pub(crate) fn gen_query(&mut self) -> (Query, Vec) { diff --git a/src/tests/sqlsmith/src/sql_gen/relation.rs b/src/tests/sqlsmith/src/sql_gen/relation.rs index 6e6db4e40493..71242febe780 100644 --- a/src/tests/sqlsmith/src/sql_gen/relation.rs +++ b/src/tests/sqlsmith/src/sql_gen/relation.rs @@ -33,7 +33,7 @@ fn create_equi_expr(left: String, right: String) -> Expr { create_binary_expr(BinaryOperator::Eq, left, right) } -impl<'a, R: Rng> SqlGenerator<'a, R> { +impl SqlGenerator<'_, R> { /// A relation specified in the FROM clause. pub(crate) fn gen_from_relation(&mut self) -> (TableWithJoins, Vec) { match self.rng.gen_range(1..=4) { diff --git a/src/tests/sqlsmith/src/sql_gen/scalar.rs b/src/tests/sqlsmith/src/sql_gen/scalar.rs index 93cdf6518e73..62cd7218dcc9 100644 --- a/src/tests/sqlsmith/src/sql_gen/scalar.rs +++ b/src/tests/sqlsmith/src/sql_gen/scalar.rs @@ -24,7 +24,7 @@ use risingwave_sqlparser::ast::{Array, DataType as AstDataType, Expr, Value}; use crate::sql_gen::expr::typed_null; use crate::sql_gen::SqlGenerator; -impl<'a, R: Rng> SqlGenerator<'a, R> { +impl SqlGenerator<'_, R> { /// Generates integer scalar expression. /// Bound: [start, end). /// Type: `DataType`. diff --git a/src/tests/sqlsmith/src/sql_gen/time_window.rs b/src/tests/sqlsmith/src/sql_gen/time_window.rs index a4d619b57452..d8e783df5bd1 100644 --- a/src/tests/sqlsmith/src/sql_gen/time_window.rs +++ b/src/tests/sqlsmith/src/sql_gen/time_window.rs @@ -22,7 +22,7 @@ use risingwave_sqlparser::ast::{ use crate::sql_gen::utils::{create_args, create_table_alias}; use crate::sql_gen::{Column, Expr, SqlGenerator, Table}; -impl<'a, R: Rng> SqlGenerator<'a, R> { +impl SqlGenerator<'_, R> { /// Generates time window functions. pub(crate) fn gen_time_window_func(&mut self) -> (TableFactor, Table) { match self.flip_coin() { diff --git a/src/tests/sqlsmith/src/sql_gen/utils.rs b/src/tests/sqlsmith/src/sql_gen/utils.rs index 0e36507e8616..a00d61456bd5 100644 --- a/src/tests/sqlsmith/src/sql_gen/utils.rs +++ b/src/tests/sqlsmith/src/sql_gen/utils.rs @@ -25,7 +25,7 @@ use crate::sql_gen::{Column, Expr, Ident, ObjectName, SqlGenerator, Table}; type Context = (Vec, Vec
); /// Context utils -impl<'a, R: Rng> SqlGenerator<'a, R> { +impl SqlGenerator<'_, R> { pub(crate) fn add_relations_to_context(&mut self, mut tables: Vec
) { for rel in &tables { let mut bound_columns = rel.get_qualified_columns(); @@ -53,7 +53,7 @@ impl<'a, R: Rng> SqlGenerator<'a, R> { } /// Gen utils -impl<'a, R: Rng> SqlGenerator<'a, R> { +impl SqlGenerator<'_, R> { pub(crate) fn gen_table_name_with_prefix(&mut self, prefix: &str) -> String { format!("{}_{}", prefix, &self.gen_relation_id()) } diff --git a/src/utils/pgwire/src/pg_message.rs b/src/utils/pgwire/src/pg_message.rs index 00c9a09b2eda..58a1cccaf562 100644 --- a/src/utils/pgwire/src/pg_message.rs +++ b/src/utils/pgwire/src/pg_message.rs @@ -426,7 +426,7 @@ pub enum TransactionStatus { InFailedTransaction, } -impl<'a> BeMessage<'a> { +impl BeMessage<'_> { /// Write message to the given buf. pub fn write(buf: &mut BytesMut, message: &BeMessage<'_>) -> Result<()> { match message { diff --git a/src/utils/pgwire/src/pg_protocol.rs b/src/utils/pgwire/src/pg_protocol.rs index 630feb1ebd28..5a2120b91f3d 100644 --- a/src/utils/pgwire/src/pg_protocol.rs +++ b/src/utils/pgwire/src/pg_protocol.rs @@ -1190,7 +1190,7 @@ pub mod truncated_fmt { finished: bool, f: &'a mut Formatter<'b>, } - impl<'a, 'b> Write for TruncatedFormatter<'a, 'b> { + impl Write for TruncatedFormatter<'_, '_> { fn write_str(&mut self, s: &str) -> Result { if self.finished { return Ok(()); @@ -1212,7 +1212,7 @@ pub mod truncated_fmt { pub struct TruncatedFmt<'a, T>(pub &'a T, pub usize); - impl<'a, T> Debug for TruncatedFmt<'a, T> + impl Debug for TruncatedFmt<'_, T> where T: Debug, { @@ -1226,7 +1226,7 @@ pub mod truncated_fmt { } } - impl<'a, T> Display for TruncatedFmt<'a, T> + impl Display for TruncatedFmt<'_, T> where T: Display, { diff --git a/src/utils/pgwire/src/types.rs b/src/utils/pgwire/src/types.rs index c76aa20aac4c..e8d7dc52101a 100644 --- a/src/utils/pgwire/src/types.rs +++ b/src/utils/pgwire/src/types.rs @@ -94,7 +94,7 @@ where default_format: Format, } -impl<'a, 'b> FormatIterator<'a, 'b> { +impl<'a> FormatIterator<'a, '_> { pub fn new(provided_formats: &'a [Format], actual_len: usize) -> Result { if !provided_formats.is_empty() && provided_formats.len() != 1