Unverified Commit 42a4d130 authored by qupeng's avatar qupeng Committed by GitHub

update rust toolchain (#607)

Signed-off-by: 's avatarqupeng <qupeng@pingcap.com>
parent 26f1cf59
...@@ -17,7 +17,7 @@ extern crate cmake; ...@@ -17,7 +17,7 @@ extern crate cmake;
use cc::Build; use cc::Build;
use cmake::Config; use cmake::Config;
use std::path::PathBuf; use std::path::{Path, PathBuf};
use std::{env, str}; use std::{env, str};
// On these platforms jemalloc-sys will use a prefixed jemalloc which cannot be linked together // On these platforms jemalloc-sys will use a prefixed jemalloc which cannot be linked together
...@@ -27,7 +27,7 @@ const NO_JEMALLOC_TARGETS: &[&str] = &["android", "dragonfly", "musl", "darwin"] ...@@ -27,7 +27,7 @@ const NO_JEMALLOC_TARGETS: &[&str] = &["android", "dragonfly", "musl", "darwin"]
// Generate the bindings to rocksdb C-API. // Generate the bindings to rocksdb C-API.
// Try to disable the generation of platform-related bindings. // Try to disable the generation of platform-related bindings.
fn bindgen_rocksdb(file_path: &PathBuf) { fn bindgen_rocksdb(file_path: &Path) {
let bindings = bindgen::Builder::default() let bindings = bindgen::Builder::default()
.header("crocksdb/crocksdb/c.h") .header("crocksdb/crocksdb/c.h")
.ctypes_prefix("libc") .ctypes_prefix("libc")
......
nightly-2020-07-01 nightly-2021-01-25
...@@ -61,7 +61,7 @@ pub unsafe extern "C" fn full_merge_callback( ...@@ -61,7 +61,7 @@ pub unsafe extern "C" fn full_merge_callback(
let buf = buf as *mut u8; let buf = buf as *mut u8;
assert!(!buf.is_null()); assert!(!buf.is_null());
*new_value_length = result.len() as size_t; *new_value_length = result.len() as size_t;
*success = 1 as u8; *success = 1_u8;
ptr::copy(result.as_ptr(), &mut *buf, result.len()); ptr::copy(result.as_ptr(), &mut *buf, result.len());
buf as *const c_char buf as *const c_char
} }
...@@ -86,7 +86,7 @@ pub unsafe extern "C" fn partial_merge_callback( ...@@ -86,7 +86,7 @@ pub unsafe extern "C" fn partial_merge_callback(
let buf = buf as *mut u8; let buf = buf as *mut u8;
assert!(!buf.is_null()); assert!(!buf.is_null());
*new_value_length = result.len() as size_t; *new_value_length = result.len() as size_t;
*success = 1 as u8; *success = 1_u8;
ptr::copy(result.as_ptr(), &mut *buf, result.len()); ptr::copy(result.as_ptr(), &mut *buf, result.len());
buf as *const c_char buf as *const c_char
} }
......
...@@ -84,10 +84,10 @@ fn ensure_default_cf_exists<'a>( ...@@ -84,10 +84,10 @@ fn ensure_default_cf_exists<'a>(
} }
} }
fn split_descriptors<'a>( fn split_descriptors(
list: Vec<ColumnFamilyDescriptor<'a>>, list: Vec<ColumnFamilyDescriptor>,
is_titan: bool, is_titan: bool,
) -> (Vec<&'a str>, Vec<ColumnFamilyOptions>) { ) -> (Vec<&str>, Vec<ColumnFamilyOptions>) {
let mut v1 = Vec::with_capacity(list.len()); let mut v1 = Vec::with_capacity(list.len());
let mut v2 = Vec::with_capacity(list.len()); let mut v2 = Vec::with_capacity(list.len());
for mut d in list { for mut d in list {
...@@ -345,7 +345,6 @@ impl<D> DBIterator<D> { ...@@ -345,7 +345,6 @@ impl<D> DBIterator<D> {
#[deprecated] #[deprecated]
pub type Kv = (Vec<u8>, Vec<u8>); pub type Kv = (Vec<u8>, Vec<u8>);
#[deprecated]
impl<'b, D> Iterator for &'b mut DBIterator<D> { impl<'b, D> Iterator for &'b mut DBIterator<D> {
#[allow(deprecated)] #[allow(deprecated)]
type Item = Kv; type Item = Kv;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment