Upgrade memmap to memmap2 in other crates.
This commit is contained in:
parent
0ce0fedb67
commit
458d044c5b
7 changed files with 18 additions and 8 deletions
13
Cargo.lock
13
Cargo.lock
|
@ -2158,6 +2158,15 @@ dependencies = [
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "memmap2"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "04e3e85b970d650e2ae6d70592474087051c11c54da7f7b4949725c5735fbcc6"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memoffset"
|
name = "memoffset"
|
||||||
version = "0.5.5"
|
version = "0.5.5"
|
||||||
|
@ -3776,7 +3785,7 @@ dependencies = [
|
||||||
"itertools 0.9.0",
|
"itertools 0.9.0",
|
||||||
"jobserver",
|
"jobserver",
|
||||||
"libc",
|
"libc",
|
||||||
"memmap",
|
"memmap2",
|
||||||
"pathdiff",
|
"pathdiff",
|
||||||
"rustc_apfloat",
|
"rustc_apfloat",
|
||||||
"rustc_ast",
|
"rustc_ast",
|
||||||
|
@ -4110,7 +4119,7 @@ name = "rustc_metadata"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"memmap",
|
"memmap2",
|
||||||
"rustc_ast",
|
"rustc_ast",
|
||||||
"rustc_attr",
|
"rustc_attr",
|
||||||
"rustc_data_structures",
|
"rustc_data_structures",
|
||||||
|
|
|
@ -11,7 +11,7 @@ test = false
|
||||||
bitflags = "1.2.1"
|
bitflags = "1.2.1"
|
||||||
cc = "1.0.1"
|
cc = "1.0.1"
|
||||||
itertools = "0.9"
|
itertools = "0.9"
|
||||||
memmap = "0.7"
|
memmap2 = "0.2.1"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
libc = "0.2.50"
|
libc = "0.2.50"
|
||||||
jobserver = "0.1.11"
|
jobserver = "0.1.11"
|
||||||
|
|
|
@ -93,7 +93,7 @@ impl<B: WriteBackendMethods> LtoModuleCodegen<B> {
|
||||||
pub enum SerializedModule<M: ModuleBufferMethods> {
|
pub enum SerializedModule<M: ModuleBufferMethods> {
|
||||||
Local(M),
|
Local(M),
|
||||||
FromRlib(Vec<u8>),
|
FromRlib(Vec<u8>),
|
||||||
FromUncompressedFile(memmap::Mmap),
|
FromUncompressedFile(memmap2::Mmap),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<M: ModuleBufferMethods> SerializedModule<M> {
|
impl<M: ModuleBufferMethods> SerializedModule<M> {
|
||||||
|
|
|
@ -1958,7 +1958,7 @@ pub fn submit_pre_lto_module_to_llvm<B: ExtraBackendMethods>(
|
||||||
.unwrap_or_else(|e| panic!("failed to open bitcode file `{}`: {}", bc_path.display(), e));
|
.unwrap_or_else(|e| panic!("failed to open bitcode file `{}`: {}", bc_path.display(), e));
|
||||||
|
|
||||||
let mmap = unsafe {
|
let mmap = unsafe {
|
||||||
memmap::Mmap::map(&file).unwrap_or_else(|e| {
|
memmap2::Mmap::map(&file).unwrap_or_else(|e| {
|
||||||
panic!("failed to mmap bitcode file `{}`: {}", bc_path.display(), e)
|
panic!("failed to mmap bitcode file `{}`: {}", bc_path.display(), e)
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,7 +11,7 @@ doctest = false
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
snap = "1"
|
snap = "1"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
memmap = "0.7"
|
memmap2 = "0.2.1"
|
||||||
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
|
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
|
||||||
rustc_middle = { path = "../rustc_middle" }
|
rustc_middle = { path = "../rustc_middle" }
|
||||||
rustc_attr = { path = "../rustc_attr" }
|
rustc_attr = { path = "../rustc_attr" }
|
||||||
|
|
|
@ -728,7 +728,7 @@ impl<'a> CrateLocator<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A trivial wrapper for `Mmap` that implements `StableDeref`.
|
/// A trivial wrapper for `Mmap` that implements `StableDeref`.
|
||||||
struct StableDerefMmap(memmap::Mmap);
|
struct StableDerefMmap(memmap2::Mmap);
|
||||||
|
|
||||||
impl Deref for StableDerefMmap {
|
impl Deref for StableDerefMmap {
|
||||||
type Target = [u8];
|
type Target = [u8];
|
||||||
|
@ -779,7 +779,7 @@ fn get_metadata_section(
|
||||||
// mmap the file, because only a small fraction of it is read.
|
// mmap the file, because only a small fraction of it is read.
|
||||||
let file = std::fs::File::open(filename)
|
let file = std::fs::File::open(filename)
|
||||||
.map_err(|_| format!("failed to open rmeta metadata: '{}'", filename.display()))?;
|
.map_err(|_| format!("failed to open rmeta metadata: '{}'", filename.display()))?;
|
||||||
let mmap = unsafe { memmap::Mmap::map(&file) };
|
let mmap = unsafe { memmap2::Mmap::map(&file) };
|
||||||
let mmap = mmap
|
let mmap = mmap
|
||||||
.map_err(|_| format!("failed to mmap rmeta metadata: '{}'", filename.display()))?;
|
.map_err(|_| format!("failed to mmap rmeta metadata: '{}'", filename.display()))?;
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,7 @@ const PERMITTED_DEPENDENCIES: &[&str] = &[
|
||||||
"measureme",
|
"measureme",
|
||||||
"memchr",
|
"memchr",
|
||||||
"memmap",
|
"memmap",
|
||||||
|
"memmap2",
|
||||||
"memoffset",
|
"memoffset",
|
||||||
"miniz_oxide",
|
"miniz_oxide",
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
|
|
Loading…
Add table
Reference in a new issue