Skip to content

Commit 458d044

Browse files
committed
Upgrade memmap to memmap2 in other crates.
1 parent 0ce0fed commit 458d044

File tree

7 files changed

+18
-8
lines changed

7 files changed

+18
-8
lines changed

Cargo.lock

+11-2
Original file line numberDiff line numberDiff line change
@@ -2158,6 +2158,15 @@ dependencies = [
21582158
"winapi 0.3.9",
21592159
]
21602160

2161+
[[package]]
2162+
name = "memmap2"
2163+
version = "0.2.1"
2164+
source = "registry+https://github.com/rust-lang/crates.io-index"
2165+
checksum = "04e3e85b970d650e2ae6d70592474087051c11c54da7f7b4949725c5735fbcc6"
2166+
dependencies = [
2167+
"libc",
2168+
]
2169+
21612170
[[package]]
21622171
name = "memoffset"
21632172
version = "0.5.5"
@@ -3776,7 +3785,7 @@ dependencies = [
37763785
"itertools 0.9.0",
37773786
"jobserver",
37783787
"libc",
3779-
"memmap",
3788+
"memmap2",
37803789
"pathdiff",
37813790
"rustc_apfloat",
37823791
"rustc_ast",
@@ -4110,7 +4119,7 @@ name = "rustc_metadata"
41104119
version = "0.0.0"
41114120
dependencies = [
41124121
"libc",
4113-
"memmap",
4122+
"memmap2",
41144123
"rustc_ast",
41154124
"rustc_attr",
41164125
"rustc_data_structures",

compiler/rustc_codegen_ssa/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test = false
1111
bitflags = "1.2.1"
1212
cc = "1.0.1"
1313
itertools = "0.9"
14-
memmap = "0.7"
14+
memmap2 = "0.2.1"
1515
tracing = "0.1"
1616
libc = "0.2.50"
1717
jobserver = "0.1.11"

compiler/rustc_codegen_ssa/src/back/lto.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl<B: WriteBackendMethods> LtoModuleCodegen<B> {
9393
pub enum SerializedModule<M: ModuleBufferMethods> {
9494
Local(M),
9595
FromRlib(Vec<u8>),
96-
FromUncompressedFile(memmap::Mmap),
96+
FromUncompressedFile(memmap2::Mmap),
9797
}
9898

9999
impl<M: ModuleBufferMethods> SerializedModule<M> {

compiler/rustc_codegen_ssa/src/back/write.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ pub fn submit_pre_lto_module_to_llvm<B: ExtraBackendMethods>(
19581958
.unwrap_or_else(|e| panic!("failed to open bitcode file `{}`: {}", bc_path.display(), e));
19591959

19601960
let mmap = unsafe {
1961-
memmap::Mmap::map(&file).unwrap_or_else(|e| {
1961+
memmap2::Mmap::map(&file).unwrap_or_else(|e| {
19621962
panic!("failed to mmap bitcode file `{}`: {}", bc_path.display(), e)
19631963
})
19641964
};

compiler/rustc_metadata/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ doctest = false
1111
libc = "0.2"
1212
snap = "1"
1313
tracing = "0.1"
14-
memmap = "0.7"
14+
memmap2 = "0.2.1"
1515
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
1616
rustc_middle = { path = "../rustc_middle" }
1717
rustc_attr = { path = "../rustc_attr" }

compiler/rustc_metadata/src/locator.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ impl<'a> CrateLocator<'a> {
728728
}
729729

730730
/// A trivial wrapper for `Mmap` that implements `StableDeref`.
731-
struct StableDerefMmap(memmap::Mmap);
731+
struct StableDerefMmap(memmap2::Mmap);
732732

733733
impl Deref for StableDerefMmap {
734734
type Target = [u8];
@@ -779,7 +779,7 @@ fn get_metadata_section(
779779
// mmap the file, because only a small fraction of it is read.
780780
let file = std::fs::File::open(filename)
781781
.map_err(|_| format!("failed to open rmeta metadata: '{}'", filename.display()))?;
782-
let mmap = unsafe { memmap::Mmap::map(&file) };
782+
let mmap = unsafe { memmap2::Mmap::map(&file) };
783783
let mmap = mmap
784784
.map_err(|_| format!("failed to mmap rmeta metadata: '{}'", filename.display()))?;
785785

src/tools/tidy/src/deps.rs

+1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ const PERMITTED_DEPENDENCIES: &[&str] = &[
123123
"measureme",
124124
"memchr",
125125
"memmap",
126+
"memmap2",
126127
"memoffset",
127128
"miniz_oxide",
128129
"num_cpus",

0 commit comments

Comments
 (0)