mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
Upgrade to Rust 1.22.1
Summary: This diff upgrades the version of rustc in fbcode to version 1.22.1, including the requisite third-party2 symlink updates for the `rust` and `rust-crates-io` projects, config.py changes in the third-party2 and third-party-buck directories, and code fixes for Rust targets in common/rust and scm/mononoke. Reviewed By: jsgf Differential Revision: D6489808 fbshipit-source-id: 48377ea937916beb7dae7a3806de1fce1e29dd24
This commit is contained in:
parent
dc5e78c1c1
commit
40339c1f89
@ -29,7 +29,7 @@ use mercurial_types::RepoPath;
|
||||
use mercurial_types_mocks::nodehash::*;
|
||||
|
||||
fn add_and_get<L: Linknodes>(linknodes: L) {
|
||||
let path = RepoPath::file("abc").unwrap();
|
||||
let path = RepoPath::file("abc".as_ref()).unwrap();
|
||||
linknodes
|
||||
.add(path.clone(), &NULL_HASH, &ONES_HASH)
|
||||
.wait()
|
||||
@ -64,7 +64,7 @@ fn add_and_get<L: Linknodes>(linknodes: L) {
|
||||
}
|
||||
|
||||
fn not_found<L: Linknodes>(linknodes: L) {
|
||||
let path = RepoPath::dir("abc").unwrap();
|
||||
let path = RepoPath::dir("abc".as_ref()).unwrap();
|
||||
assert_matches!(
|
||||
linknodes
|
||||
.get(path.clone(), &NULL_HASH)
|
||||
|
@ -9,7 +9,6 @@
|
||||
//! part headers and puts together chunks for inner codecs to parse.
|
||||
|
||||
use std::mem;
|
||||
use std::str;
|
||||
|
||||
use ascii::AsciiString;
|
||||
use async_compression::Decompressor;
|
||||
|
@ -361,7 +361,7 @@ fn parse_wirepack(read_ops: PartialWithErrors<GenWouldBlock>) {
|
||||
assert_eq!(parts.next().unwrap(), Bundle2Item::Header(header));
|
||||
|
||||
// These are a few identifiers present in the bundle.
|
||||
let baz_dir = RepoPath::dir("baz").unwrap();
|
||||
let baz_dir = RepoPath::dir("baz".as_ref()).unwrap();
|
||||
let baz_hash = NodeHash::from_str("dcb9fa4bb7cdb673cd5752088b48d4c3f9c1fc23").unwrap();
|
||||
let root_hash = NodeHash::from_str("7d315c7a04cce5404f7ef16bf55eb7f4e90d159f").unwrap();
|
||||
let root_p1 = NodeHash::from_str("e313fc172615835d205f5881f8f34dd9bb0f0092").unwrap();
|
||||
|
@ -29,7 +29,7 @@ pub struct MockManifest {
|
||||
impl MockManifest {
|
||||
fn p(p: &'static str) -> RepoPath {
|
||||
// This should also allow directory paths eventually.
|
||||
RepoPath::file(p).expect(&format!("invalid path {}", p))
|
||||
RepoPath::file(p.as_ref()).expect(&format!("invalid path {}", p))
|
||||
}
|
||||
|
||||
pub fn new(paths: Vec<&'static str>) -> Self {
|
||||
|
@ -13,9 +13,7 @@ use std::io::{self, Write};
|
||||
use std::iter::{once, Once};
|
||||
use std::os::unix::ffi::OsStrExt;
|
||||
use std::path::PathBuf;
|
||||
use std::result;
|
||||
use std::slice::Iter;
|
||||
use std::str;
|
||||
|
||||
use bincode;
|
||||
|
||||
@ -332,22 +330,14 @@ impl<'a> From<&'a MPath> for Vec<u8> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<P: AsRef<[u8]>> TryFrom<P> for MPath {
|
||||
impl<'a> TryFrom<&'a [u8]> for MPath {
|
||||
type Error = Error;
|
||||
|
||||
fn try_from(value: P) -> Result<Self> {
|
||||
fn try_from(value: &[u8]) -> Result<Self> {
|
||||
MPath::new(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<MPath> for MPath {
|
||||
type Error = !;
|
||||
|
||||
fn try_from(value: MPath) -> result::Result<Self, !> {
|
||||
Ok(value)
|
||||
}
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
static ref COMPONENT_CHARS: Vec<u8> = (1..b'/').chain((b'/' + 1)..255).collect();
|
||||
}
|
||||
@ -676,9 +666,12 @@ mod test {
|
||||
let path = MPath::new(b"abc").unwrap();
|
||||
assert_eq!(
|
||||
RepoPath::dir(path.clone()).unwrap(),
|
||||
RepoPath::dir("abc").unwrap()
|
||||
RepoPath::dir("abc".as_ref()).unwrap()
|
||||
);
|
||||
assert_ne!(
|
||||
RepoPath::dir(path).unwrap(),
|
||||
RepoPath::file("abc".as_ref()).unwrap()
|
||||
);
|
||||
assert_ne!(RepoPath::dir(path).unwrap(), RepoPath::file("abc").unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -692,7 +685,7 @@ mod test {
|
||||
),
|
||||
};
|
||||
|
||||
match RepoPath::dir(b"") {
|
||||
match RepoPath::dir(b"".as_ref()) {
|
||||
Ok(bad) => panic!("unexpected success {:?}", bad),
|
||||
Err(err) => assert_matches!(
|
||||
err.downcast::<ErrorKind>().unwrap(),
|
||||
|
@ -5,7 +5,6 @@
|
||||
// GNU General Public License version 2 or any later version.
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
use std::str;
|
||||
|
||||
use quickcheck::{QuickCheck, TestResult};
|
||||
|
||||
|
@ -32,7 +32,6 @@ use std::io::prelude::*;
|
||||
use std::marker::PhantomData;
|
||||
use std::os::unix::io::AsRawFd;
|
||||
use std::path::PathBuf;
|
||||
use std::str;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use bincode::{deserialize, serialize, Infinite};
|
||||
|
Loading…
Reference in New Issue
Block a user