Skip to content

Commit 19e305f

Browse files
committed
*: bulk upgrade
* upgrade stable feature `return_position_impl_trait_in_trait` * upgrade lazy_cell rust-lang/rust/pull/105587 * upgrade core_io_borrowed_buf rust-lang/rust/pull/117694 * fix return position lifetime annotation Signed-off-by: Neil Shen <overvenus@gmail.com>
1 parent 8bddd71 commit 19e305f

File tree

9 files changed

+15
-18
lines changed

9 files changed

+15
-18
lines changed

cmd/tikv-ctl/src/executor.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use engine_traits::{
1313
CF_WRITE, DATA_CFS,
1414
};
1515
use file_system::read_dir;
16-
use futures::{executor::block_on, future, stream, Stream, StreamExt, TryStreamExt};
16+
use futures::{executor::block_on, future, stream::{self, BoxStream}, Stream, StreamExt, TryStreamExt};
1717
use grpcio::{ChannelBuilder, Environment};
1818
use kvproto::{
1919
debugpb::{Db as DbType, *},
@@ -55,7 +55,7 @@ pub const METRICS_ROCKSDB_RAFT: &str = "rocksdb_raft";
5555
pub const METRICS_JEMALLOC: &str = "jemalloc";
5656
pub const LOCK_FILE_ERROR: &str = "IO error: While lock file";
5757

58-
type MvccInfoStream = Pin<Box<dyn Stream<Item = result::Result<(Vec<u8>, MvccInfo), String>>>>;
58+
type MvccInfoStream = BoxStream<'static, result::Result<(Vec<u8>, MvccInfo), String>>;
5959

6060
fn get_engine_type(dir: &str) -> EngineType {
6161
let mut entries = read_dir(dir).unwrap();

cmd/tikv-ctl/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2016 TiKV Project Authors. Licensed under Apache-2.0.
22

3-
#![feature(once_cell)]
3+
#![feature(lazy_cell)]
44
#![feature(let_chains)]
55

66
#[macro_use]

components/test_raftstore-v2/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright 2022 TiKV Project Authors. Licensed under Apache-2.0.
22
#![allow(incomplete_features)]
33
#![feature(type_alias_impl_trait)]
4-
#![feature(return_position_impl_trait_in_trait)]
54
#![feature(let_chains)]
65

76
mod cluster;

components/test_raftstore-v2/src/transport_simulate.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::sync::{Arc, RwLock};
44

55
use engine_traits::{KvEngine, RaftEngine};
6-
use futures::Future;
6+
use futures::future::{FutureExt, BoxFuture};
77
use kvproto::{
88
raft_cmdpb::{RaftCmdRequest, RaftCmdResponse},
99
raft_serverpb::RaftMessage,
@@ -64,30 +64,30 @@ impl<C: Transport> Transport for SimulateTransport<C> {
6464
}
6565
}
6666

67-
pub trait SnapshotRouter<E: KvEngine> {
67+
pub trait SnapshotRouter<EK: KvEngine> {
6868
fn snapshot(
6969
&mut self,
7070
req: RaftCmdRequest,
71-
) -> impl Future<Output = std::result::Result<RegionSnapshot<E::Snapshot>, RaftCmdResponse>> + Send;
71+
) -> BoxFuture<'static, std::result::Result<RegionSnapshot<EK::Snapshot>, RaftCmdResponse>>;
7272
}
7373

7474
impl<EK: KvEngine, ER: RaftEngine> SnapshotRouter<EK> for RaftRouter<EK, ER> {
7575
fn snapshot(
7676
&mut self,
7777
req: RaftCmdRequest,
78-
) -> impl Future<Output = std::result::Result<RegionSnapshot<EK::Snapshot>, RaftCmdResponse>> + Send
78+
) -> BoxFuture<'static, std::result::Result<RegionSnapshot<EK::Snapshot>, RaftCmdResponse>>
7979
{
80-
self.snapshot(req)
80+
self.snapshot(req).boxed()
8181
}
8282
}
8383

84-
impl<E: KvEngine, C: SnapshotRouter<E>> SnapshotRouter<E> for SimulateTransport<C> {
84+
impl<EK: KvEngine, C: SnapshotRouter<EK>> SnapshotRouter<EK> for SimulateTransport<C> {
8585
fn snapshot(
8686
&mut self,
8787
req: RaftCmdRequest,
88-
) -> impl Future<Output = std::result::Result<RegionSnapshot<E::Snapshot>, RaftCmdResponse>> + Send
88+
) -> BoxFuture<'static, std::result::Result<RegionSnapshot<EK::Snapshot>, RaftCmdResponse>>
8989
{
90-
self.ch.snapshot(req)
90+
self.ch.snapshot(req).boxed()
9191
}
9292
}
9393

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#![feature(type_alias_impl_trait)]
3131
#![feature(impl_trait_in_assoc_type)]
3232
#![allow(incomplete_features)]
33-
#![feature(return_position_impl_trait_in_trait)]
33+
#![feature(core_io_borrowed_buf)]
3434

3535
#[macro_use(fail_point)]
3636
extern crate fail;

src/server/debug.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ pub trait Debugger {
155155
start: &[u8],
156156
end: &[u8],
157157
limit: u64,
158-
) -> Result<impl Iterator<Item = raftstore::Result<(Vec<u8>, MvccInfo)>> + Send>;
158+
) -> Result<impl Iterator<Item = raftstore::Result<(Vec<u8>, MvccInfo)>> + Send + 'static>;
159159

160160
/// Compact the cf[start..end) in the db.
161161
fn compact(
@@ -887,7 +887,7 @@ where
887887
start: &[u8],
888888
end: &[u8],
889889
limit: u64,
890-
) -> Result<impl Iterator<Item = raftstore::Result<(Vec<u8>, MvccInfo)>> + Send> {
890+
) -> Result<impl Iterator<Item = raftstore::Result<(Vec<u8>, MvccInfo)>> + Send + 'static> {
891891
if end.is_empty() && limit == 0 {
892892
return Err(Error::InvalidArgument("no limit and to_key".to_owned()));
893893
}

src/server/debug2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ impl<ER: RaftEngine> Debugger for DebuggerImplV2<ER> {
721721
start: &[u8],
722722
end: &[u8],
723723
limit: u64,
724-
) -> Result<impl Iterator<Item = raftstore::Result<(Vec<u8>, MvccInfo)>> + Send> {
724+
) -> Result<impl Iterator<Item = raftstore::Result<(Vec<u8>, MvccInfo)>> + Send + 'static> {
725725
if end.is_empty() && limit == 0 {
726726
return Err(Error::InvalidArgument("no limit and to_key".to_owned()));
727727
}

src/server/service/debug.rs

-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ where
300300
let debugger = self.debugger.clone();
301301

302302
let res = self.pool.spawn(async move {
303-
let req = req;
304303
debugger
305304
.compact(
306305
req.get_db(),

src/storage/txn/actions/prewrite.rs

-1
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,6 @@ fn async_commit_timestamps(
766766
#[cfg(not(feature = "failpoints"))]
767767
let injected_fallback = false;
768768

769-
let max_commit_ts = max_commit_ts;
770769
if (!max_commit_ts.is_zero() && min_commit_ts > max_commit_ts) || injected_fallback {
771770
warn!("commit_ts is too large, fallback to normal 2PC";
772771
"key" => log_wrappers::Value::key(key.as_encoded()),

0 commit comments

Comments
 (0)