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

build(toolchain): bump to 2022-10-16 #5119

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from 12 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
8 changes: 4 additions & 4 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 ci/build-ci-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export RUST_TOOLCHAIN=$(cat ../rust-toolchain)
# !!! CHANGE THIS WHEN YOU WANT TO BUMP CI IMAGE !!! #
# AND ALSO docker-compose.yml #
######################################################
export BUILD_ENV_VERSION=v20221007
export BUILD_ENV_VERSION=v20221016

export BUILD_TAG="public.ecr.aws/x5u3w5h6/rw-build-env:${BUILD_ENV_VERSION}"

Expand Down
4 changes: 2 additions & 2 deletions ci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ services:
retries: 5

rw-build-env:
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20221007
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20221016
volumes:
- ..:/risingwave

regress-test-env:
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20221007
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20221016
depends_on:
db:
condition: service_healthy
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2022-07-29
nightly-2022-10-16
4 changes: 2 additions & 2 deletions src/batch/src/executor/join/lookup_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl<C: BatchTaskContext> LookupExecutorBuilder for InnerSideExecutorBuilder<C>
let list = self
.pu_to_scan_range_mapping
.entry(parallel_unit_id)
.or_insert(vec![]);
.or_default();
list.push((scan_range, vnode));

Ok(())
Expand Down Expand Up @@ -585,7 +585,7 @@ impl BoxedExecutorBuilder for LookupJoinExecutorBuilder {

let inner_side_key_types = inner_side_key_idxs
.iter()
.map(|&i| inner_side_schema.fields[i as usize].data_type.clone())
.map(|&i| inner_side_schema.fields[i].data_type.clone())
.collect_vec();

let null_safe = lookup_join_node.get_null_safe().to_vec();
Expand Down
2 changes: 1 addition & 1 deletion src/batch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#![expect(dead_code)]
#![allow(clippy::derive_partial_eq_without_eq)]
#![feature(trait_alias)]
#![feature(generic_associated_types)]
#![feature(binary_heap_drain_sorted)]
#![feature(exact_size_is_empty)]
#![feature(type_alias_impl_trait)]
Expand All @@ -26,6 +25,7 @@
#![feature(lint_reasons)]
#![feature(binary_heap_into_iter_sorted)]
#![recursion_limit = "256"]
#![feature(let_chains)]

mod error;
pub mod exchange_source;
Expand Down
1 change: 0 additions & 1 deletion src/batch/src/task/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ impl BatchEnvironment {
self.task_manager.clone()
}

#[expect(clippy::explicit_auto_deref)]
pub fn source_manager(&self) -> &dyn SourceManager {
&*self.source_manager
}
Expand Down
1 change: 1 addition & 0 deletions src/cmd_all/src/bin/risingwave.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

#![cfg_attr(coverage, feature(no_coverage))]
#![feature(let_chains)]

use tikv_jemallocator::Jemalloc;

Expand Down
4 changes: 2 additions & 2 deletions src/common/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ mod tests {
fn test_filter() {
let mut builder = PrimitiveArrayBuilder::<i32>::new(0);
for i in 0..=60 {
builder.append(Some(i as i32));
builder.append(Some(i));
}
let array = filter(&builder.finish(), |x| x.unwrap_or(0) >= 60).unwrap();
assert_eq!(array.iter().collect::<Vec<Option<i32>>>(), vec![Some(60)]);
Expand Down Expand Up @@ -692,7 +692,7 @@ mod tests {
fn test_vectorized_add() {
let mut builder = PrimitiveArrayBuilder::<i32>::new(0);
for i in 0..=60 {
builder.append(Some(i as i32));
builder.append(Some(i));
}
let array1 = builder.finish();

Expand Down
2 changes: 1 addition & 1 deletion src/common/src/buffer/bitmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl Bitmap {
}

fn num_bytes(num_bits: usize) -> usize {
num_bits / 8 + if num_bits % 8 > 0 { 1 } else { 0 }
num_bits / 8 + usize::from(num_bits % 8 > 0)
}

/// Returns the number of valid bits in the bitmap,
Expand Down
4 changes: 2 additions & 2 deletions src/common/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,12 @@ unsafe impl<K: LruKey, T: LruValue> Send for LruCacheShard<K, T> {}

impl<K: LruKey, T: LruValue> LruCacheShard<K, T> {
fn new(capacity: usize, object_capacity: usize) -> Self {
let mut lru = Box::new(LruHandle::default());
let mut lru = Box::<LruHandle<K, T>>::default();
lru.prev = lru.as_mut();
lru.next = lru.as_mut();
let mut object_pool = Vec::with_capacity(object_capacity);
for _ in 0..object_capacity {
object_pool.push(Box::new(LruHandle::default()));
object_pool.push(Box::default());
}
Self {
capacity,
Expand Down
4 changes: 3 additions & 1 deletion src/common/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ impl Debug for RwError {
"{}\n{}",
self.inner,
// Use inner error's backtrace by default, otherwise use the generated one in `From`.
self.inner.backtrace().unwrap_or(&*self.backtrace)
(&self.inner as &dyn std::error::Error)
.request_ref::<Backtrace>()
.unwrap_or(&*self.backtrace)
xxchan marked this conversation as resolved.
Show resolved Hide resolved
)
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#![allow(rustdoc::private_intra_doc_links)]
#![allow(clippy::derive_partial_eq_without_eq)]
#![feature(trait_alias)]
#![feature(generic_associated_types)]
#![feature(binary_heap_drain_sorted)]
#![feature(is_sorted)]
#![feature(backtrace)]
#![feature(fn_traits)]
#![feature(type_alias_impl_trait)]
#![feature(test)]
Expand All @@ -28,6 +26,9 @@
#![feature(generators)]
#![feature(map_try_insert)]
#![feature(once_cell)]
#![feature(let_chains)]
#![feature(error_generic_member_access)]
#![feature(provide_any)]

#[macro_use]
pub mod error;
Expand Down
9 changes: 4 additions & 5 deletions src/common/src/types/chrono_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl NaiveDateWrapper {
pub fn with_days_value(days: i32) -> value_encoding::Result<Self> {
Ok(NaiveDateWrapper::new(
NaiveDate::from_num_days_from_ce_opt(days)
.ok_or(ValueEncodingError::InvalidNaiveDateEncoding(days))?,
.ok_or_else(|| ValueEncodingError::InvalidNaiveDateEncoding(days))?,
))
}

Expand Down Expand Up @@ -116,7 +116,7 @@ impl NaiveTimeWrapper {
pub fn with_secs_nano_value(secs: u32, nano: u32) -> value_encoding::Result<Self> {
Ok(NaiveTimeWrapper::new(
NaiveTime::from_num_seconds_from_midnight_opt(secs, nano)
.ok_or(ValueEncodingError::InvalidNaiveTimeEncoding(secs, nano))?,
.ok_or_else(|| ValueEncodingError::InvalidNaiveTimeEncoding(secs, nano))?,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There shouldn't be any difference for enum construction.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

))
}

Expand Down Expand Up @@ -163,9 +163,8 @@ impl NaiveDateTimeWrapper {

pub fn with_secs_nsecs_value(secs: i64, nsecs: u32) -> value_encoding::Result<Self> {
Ok(NaiveDateTimeWrapper::new({
NaiveDateTime::from_timestamp_opt(secs, nsecs).ok_or(
ValueEncodingError::InvalidNaiveDateTimeEncoding(secs, nsecs),
)?
NaiveDateTime::from_timestamp_opt(secs, nsecs)
.ok_or_else(|| ValueEncodingError::InvalidNaiveDateTimeEncoding(secs, nsecs))?
}))
}

Expand Down
16 changes: 8 additions & 8 deletions src/common/src/types/interval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl IntervalUnit {
IntervalUnit {
months: (months as i32),
days: (days as i32),
ms: (remaining_ms as i64),
ms: remaining_ms,
}
}

Expand Down Expand Up @@ -856,8 +856,8 @@ mod tests {
];

for (lhs, rhs, expected) in cases {
let lhs = IntervalUnit::new(lhs.0 as i32, lhs.1 as i32, lhs.2 as i64);
let rhs = IntervalUnit::new(rhs.0 as i32, rhs.1 as i32, rhs.2 as i64);
let lhs = IntervalUnit::new(lhs.0, lhs.1, lhs.2 as i64);
let rhs = IntervalUnit::new(rhs.0, rhs.1, rhs.2 as i64);
let result = std::panic::catch_unwind(|| {
let actual = lhs.exact_div(&rhs);
assert_eq!(actual, expected);
Expand Down Expand Up @@ -886,22 +886,22 @@ mod tests {
];

for (lhs, rhs, expected) in cases_int {
let lhs = IntervalUnit::new(lhs.0 as i32, lhs.1 as i32, lhs.2 as i64);
let expected = expected.map(|x| IntervalUnit::new(x.0 as i32, x.1 as i32, x.2 as i64));
let lhs = IntervalUnit::new(lhs.0, lhs.1, lhs.2 as i64);
let expected = expected.map(|x| IntervalUnit::new(x.0, x.1, x.2 as i64));

let actual = lhs.div_float(rhs as i16);
assert_eq!(actual, expected);

let actual = lhs.div_float(rhs as i32);
let actual = lhs.div_float(rhs);
assert_eq!(actual, expected);

let actual = lhs.div_float(rhs as i64);
assert_eq!(actual, expected);
}

for (lhs, rhs, expected) in cases_float {
let lhs = IntervalUnit::new(lhs.0 as i32, lhs.1 as i32, lhs.2 as i64);
let expected = expected.map(|x| IntervalUnit::new(x.0 as i32, x.1 as i32, x.2 as i64));
let lhs = IntervalUnit::new(lhs.0, lhs.1, lhs.2 as i64);
let expected = expected.map(|x| IntervalUnit::new(x.0, x.1, x.2 as i64));

let actual = lhs.div_float(OrderedFloat::<f32>(rhs));
assert_eq!(actual, expected);
Expand Down
6 changes: 3 additions & 3 deletions src/common/src/types/ordered_float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use core::str::FromStr;
pub use num_traits::Float;
use num_traits::{
AsPrimitive, Bounded, CheckedAdd, CheckedDiv, CheckedMul, CheckedNeg, CheckedRem, CheckedSub,
FromPrimitive, Num, NumCast, One, Signed, ToPrimitive, Zero,
FromPrimitive, Num, One, Signed, ToPrimitive, Zero,
};

// masks for the parts of the IEEE 754 float
Expand Down Expand Up @@ -566,7 +566,7 @@ impl<T: One> One for OrderedFloat<T> {
}
}

impl<T: NumCast> NumCast for OrderedFloat<T> {
impl<T: num_traits::NumCast> num_traits::NumCast for OrderedFloat<T> {
#[inline]
fn from<F: ToPrimitive>(n: F) -> Option<Self> {
T::from(n).map(OrderedFloat)
Expand Down Expand Up @@ -944,7 +944,7 @@ fn raw_double_bits<F: Float>(f: &F) -> u64 {
}

let exp_u64 = exp as u16 as u64;
let sign_u64 = if sign > 0 { 1u64 } else { 0u64 };
let sign_u64 = u64::from(sign > 0);
(man & MAN_MASK) | ((exp_u64 << 52) & EXP_MASK) | ((sign_u64 << 63) & SIGN_MASK)
}

Expand Down
2 changes: 0 additions & 2 deletions src/compute/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

#![feature(trait_alias)]
#![feature(binary_heap_drain_sorted)]
#![feature(generic_associated_types)]
#![feature(let_else)]
#![feature(generators)]
#![feature(type_alias_impl_trait)]
#![cfg_attr(coverage, feature(no_coverage))]
Expand Down
2 changes: 1 addition & 1 deletion src/connector/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
#![feature(stmt_expr_attributes)]
#![feature(box_patterns)]
#![feature(trait_alias)]
#![feature(generic_associated_types)]
#![feature(binary_heap_drain_sorted)]
#![feature(lint_reasons)]
#![feature(once_cell)]
#![feature(result_option_inspect)]
#![feature(let_chains)]

pub mod aws_utils;
pub mod error;
Expand Down
2 changes: 1 addition & 1 deletion src/expr/src/expr/expr_unary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ mod tests {
for i in 0..100i16 {
if i % 2 == 0 {
target.push(Some(i as i32));
input.push(Some(i as i16));
input.push(Some(i));
} else {
input.push(None);
target.push(None);
Expand Down
4 changes: 1 addition & 3 deletions src/expr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@

#![allow(rustdoc::private_intra_doc_links)]
#![feature(trait_alias)]
#![feature(generic_associated_types)]
#![feature(binary_heap_drain_sorted)]
#![feature(binary_heap_into_iter_sorted)]
#![feature(is_sorted)]
#![feature(backtrace)]
#![feature(fn_traits)]
#![feature(assert_matches)]
#![feature(let_else)]
#![feature(let_chains)]
#![feature(lint_reasons)]
#![feature(type_alias_impl_trait)]
#![feature(generators)]
Expand Down
4 changes: 2 additions & 2 deletions src/expr/src/vector_op/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fn parse_naive_datetime(s: &str) -> Result<NaiveDateTime> {
res.time.hour as u32,
res.time.minute as u32,
res.time.second as u32,
res.time.microsecond as u32,
res.time.microsecond,
);
Ok(NaiveDateTime::new(date, time))
} else {
Expand Down Expand Up @@ -94,7 +94,7 @@ fn parse_naive_time(s: &str) -> Result<NaiveTime> {
res.hour as u32,
res.minute as u32,
res.second as u32,
res.microsecond as u32,
res.microsecond,
))
}

Expand Down
2 changes: 1 addition & 1 deletion src/frontend/planner_test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![feature(label_break_value)]
#![feature(let_chains)]
#![allow(clippy::derive_partial_eq_without_eq)]
//! Data-driven tests.

Expand Down
6 changes: 3 additions & 3 deletions src/frontend/src/catalog/schema_catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl SchemaCatalog {

/// Iterate all indices
pub fn iter_index(&self) -> impl Iterator<Item = &IndexCatalog> {
self.index_by_name.iter().map(|(_, v)| v)
self.index_by_name.values()
}

/// Iterate all sources, including the materialized sources.
Expand All @@ -172,11 +172,11 @@ impl SchemaCatalog {
}

pub fn iter_sink(&self) -> impl Iterator<Item = &SinkCatalog> {
self.sink_by_name.iter().map(|(_, v)| v)
self.sink_by_name.values()
}

pub fn iter_system_tables(&self) -> impl Iterator<Item = &SystemCatalog> {
self.system_table_by_name.iter().map(|(_, v)| v)
self.system_table_by_name.values()
}

pub fn get_table_by_name(&self, table_name: &str) -> Option<&TableCatalog> {
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/catalog/table_catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl TableCatalog {

pub fn to_prost(&self, schema_id: SchemaId, database_id: DatabaseId) -> ProstTable {
ProstTable {
id: self.id.table_id as u32,
id: self.id.table_id,
schema_id,
database_id,
name: self.name.clone(),
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/handler/drop_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub async fn handle_drop_schema(
};
let schema_id = {
// If the mode is `Restrict` or `None`, the `schema` need to be empty.
if Some(DropMode::Restrict) == mode || None == mode {
if Some(DropMode::Restrict) == mode || mode.is_none() {
if let Some(table) = schema.iter_table().next() {
return Err(CatalogError::NotEmpty(
"schema",
Expand Down
Loading