Skip to content

refactor(ci): bump rust version #9540

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

Merged
merged 16 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2022-11-14"
components = ["rustfmt", "clippy", "rust-src"]
channel = "nightly-2022-12-15"
components = ["rustfmt", "clippy", "rust-src", "miri"]
2 changes: 2 additions & 0 deletions src/binaries/meta/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

use std::env;
use std::ops::Deref;
use std::sync::Arc;
Expand Down
2 changes: 2 additions & 0 deletions src/binaries/metabench/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

use std::fmt::Debug;
use std::fmt::Display;
use std::sync::Arc;
Expand Down
2 changes: 2 additions & 0 deletions src/binaries/metactl/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

mod grpc;
use grpc::export_meta;

Expand Down
2 changes: 2 additions & 0 deletions src/binaries/query/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

mod local;

use std::env;
Expand Down
2 changes: 2 additions & 0 deletions src/common/auth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

pub mod auth;
pub use auth::RefreshableToken;
pub use auth::TokenFile;
3 changes: 2 additions & 1 deletion src/common/base/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]
#![allow(incomplete_features)]
#![feature(allocator_api)]
#![feature(thread_local)]
#![feature(ptr_metadata)]
#![feature(result_flattening)]
#![feature(try_trait_v2)]
#![feature(thread_id_value)]
#![feature(backtrace_frames)]
#![allow(incomplete_features)]
#![feature(alloc_error_hook)]

pub mod base;
Expand Down
1 change: 1 addition & 0 deletions src/common/building/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

#![deny(unused_crate_dependencies)]
#![allow(clippy::uninlined_format_args)]

mod git;

Expand Down
1 change: 1 addition & 0 deletions src/common/cache/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]
#[cfg(feature = "heapsize")]
#[cfg(not(target_os = "macos"))]
extern crate heapsize_;
Expand Down
2 changes: 2 additions & 0 deletions src/common/cache/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

mod cache;
1 change: 1 addition & 0 deletions src/common/exception/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]
pub mod exception;
mod exception_code;
mod exception_flight;
Expand Down
2 changes: 2 additions & 0 deletions src/common/grpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

pub use client_conf::RpcClientConf;
pub use client_conf::RpcClientTlsConfig;
pub use dns_resolver::ConnectionFactory;
Expand Down
2 changes: 2 additions & 0 deletions src/common/http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

mod debug;
mod health;
mod http_shutdown_handlers;
Expand Down
8 changes: 4 additions & 4 deletions src/common/io/src/cursor_ext/cursor_read_datetime_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ where T: AsRef<[u8]>
let mut times = Vec::with_capacity(3);
loop {
buf.clear();
let size = self.keep_read(&mut buf, |f| (b'0'..=b'9').contains(&f));
let size = self.keep_read(&mut buf, |f| f.is_ascii_digit());
if size == 0 {
break;
} else {
Expand Down Expand Up @@ -145,7 +145,7 @@ where T: AsRef<[u8]>
// ms .microseconds
let dt = if self.ignore_byte(b'.') {
buf.clear();
let size = self.keep_read(&mut buf, |f| (b'0'..=b'9').contains(&f));
let size = self.keep_read(&mut buf, |f| f.is_ascii_digit());
if size == 0 {
return Err(ErrorCode::BadBytes(
"err with parse micros second, format like this:[.123456]",
Expand Down Expand Up @@ -215,7 +215,7 @@ where T: AsRef<[u8]>
west_tz: bool,
calc_offset: impl Fn(i64, i64, &DateTime<Tz>) -> Result<DateTime<Tz>>,
) -> Result<DateTime<Tz>> {
let n = self.keep_read(buf, |f| (b'0'..=b'9').contains(&f));
let n = self.keep_read(buf, |f| f.is_ascii_digit());
if n != 2 {
// +0800 will err in there
return Err(ErrorCode::BadBytes(
Expand All @@ -226,7 +226,7 @@ where T: AsRef<[u8]>
if (0..15).contains(&hour_offset) {
buf.clear();
self.ignore_byte(b':');
if self.keep_read(buf, |f| (b'0'..=b'9').contains(&f)) != 2 {
if self.keep_read(buf, |f| f.is_ascii_digit()) != 2 {
// +08[other byte]00 will err in there, e.g. +08-00
return Err(ErrorCode::BadBytes(
"err with parse timezone, format like this:[+08:00]",
Expand Down
4 changes: 2 additions & 2 deletions src/common/io/src/cursor_ext/cursor_read_number_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn collect_number(buffer: &[u8]) -> (usize, usize) {
index += 1;
}
if point_pos < len {
while index < len && (b'0'..=b'9').contains(&buffer[index]) {
while index < len && buffer[index].is_ascii_digit() {
index += 1;
}
}
Expand All @@ -67,7 +67,7 @@ pub fn collect_number(buffer: &[u8]) -> (usize, usize) {
if index < len && (buffer[index] == b'-' || buffer[index] == b'+') {
index += 1
}
while index < len && (b'0'..=b'9').contains(&buffer[index]) {
while index < len && buffer[index].is_ascii_digit() {
index += 1;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/common/io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

// https://github.com/rust-lang/rust-clippy/issues/8334
#![allow(clippy::ptr_arg)]
#![allow(clippy::uninlined_format_args)]
#![feature(can_vector)]
#![feature(read_buf)]
#![feature(slice_internals)]
Expand Down
1 change: 1 addition & 0 deletions src/common/io/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#![allow(clippy::uninlined_format_args)]

mod binary_read;
mod binary_write;
Expand Down
2 changes: 2 additions & 0 deletions src/common/jsonb/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

mod constants;
mod de;
mod error;
Expand Down
2 changes: 2 additions & 0 deletions src/common/metrics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

pub mod counter;
mod dump;
mod recorder;
Expand Down
1 change: 1 addition & 0 deletions src/common/storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
//! - Table snapshots, segments cache must be stored accessed via cache operator.
//! - Intermediate data generated by query could be stored by temporary operator.

#![allow(clippy::uninlined_format_args)]
#![feature(no_sanitize)]
#![feature(io_error_other)]

Expand Down
1 change: 1 addition & 0 deletions src/common/tracing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]
#![deny(unused_crate_dependencies)]

#[macro_use]
Expand Down
1 change: 1 addition & 0 deletions src/meta/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]
#![deny(unused_crate_dependencies)]
extern crate common_meta_types;

Expand Down
1 change: 1 addition & 0 deletions src/meta/app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
//! Types in this crate will not be used directly by databend-meta.
//! But instead, they are used by the caller of meta-client, e.g, databend-query.

#![allow(clippy::uninlined_format_args)]
#![deny(unused_crate_dependencies)]

pub mod schema;
Expand Down
2 changes: 2 additions & 0 deletions src/meta/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

mod grpc_action;
mod grpc_client;
mod kv_api_impl;
Expand Down
2 changes: 2 additions & 0 deletions src/meta/client/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#![allow(clippy::uninlined_format_args)]

mod grpc_client;
mod grpc_server;

Expand Down
2 changes: 2 additions & 0 deletions src/meta/embedded/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
//! `MetaEmbedded` behave exactly the same as a metasrv without distributed logs(raft), since it is driven by
//! a embedded raft `StateMachine`.

#![allow(clippy::uninlined_format_args)]

mod kv_api_impl;
mod meta_embedded;

Expand Down
1 change: 1 addition & 0 deletions src/meta/proto-conv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

// For use of const fn: `Option::<T>::unwrap` at compile time.
#![feature(const_option)]
#![allow(clippy::uninlined_format_args)]

//! Provides conversion from and to protobuf defined meta data, which is used for transport.
//!
Expand Down
2 changes: 2 additions & 0 deletions src/meta/proto-conv/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

#[macro_use]
pub(crate) mod common;
mod datatype;
Expand Down
2 changes: 2 additions & 0 deletions src/meta/protos/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
//
// https://github.com/rust-lang/rustfmt/blob/e1ab878ccb24cda1b9e1c48865b375230385fede/build.rs

#![allow(clippy::uninlined_format_args)]

use std::env;
use std::fs;
use std::io::Error;
Expand Down
2 changes: 2 additions & 0 deletions src/meta/raft-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

pub mod config;
pub mod key_spaces;
pub mod log;
Expand Down
2 changes: 2 additions & 0 deletions src/meta/raft-store/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

mod log;
#[macro_use]
mod testing;
Expand Down
2 changes: 2 additions & 0 deletions src/meta/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

pub mod api;
pub mod configs;
pub mod export;
Expand Down
1 change: 1 addition & 0 deletions src/meta/service/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// Because the compiler complains about recursion limit for a trait requirement check...
// error[[E0275](https://doc.rust-lang.org/error-index.html#E0275)]: overflow evaluating the requirement `(...)`
// When compiling `impl KVApiBuilder<MetaGrpcClient> for Builder`.
#![allow(clippy::uninlined_format_args)]
#![recursion_limit = "1024"]
#![feature(extend_one)]
mod api;
Expand Down
2 changes: 2 additions & 0 deletions src/meta/sled-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

//! sled_store implement a key-value like store backed by sled::Tree.
//!
//! It is used by raft for log and state machine storage.
Expand Down
2 changes: 2 additions & 0 deletions src/meta/sled-store/tests/it/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]

mod sled_tree;
mod sled_txn_tree;
mod testing;
1 change: 1 addition & 0 deletions src/meta/types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(clippy::uninlined_format_args)]
#![feature(provide_any)]

//! This crate defines data types used in meta data storage service.
Expand Down
2 changes: 2 additions & 0 deletions src/query/ast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

// TODO(xuanwo): Add crate level documents here.

#![allow(clippy::uninlined_format_args)]

mod error;

pub use error::Backtrace;
Expand Down
Loading