diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2022-05-28 10:43:51 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2022-11-26 19:35:32 +0000 |
| commit | be6708428fdf6693188e2c2f10f05d1b1aaa5750 (patch) | |
| tree | d4a02ed59895692fe4ade067fceb1c92575e3bb3 /compiler/rustc_data_structures/src | |
| parent | c3a1c023c0784ffbcf4dd57cf4618d208bccae69 (diff) | |
| download | rust-be6708428fdf6693188e2c2f10f05d1b1aaa5750.tar.gz rust-be6708428fdf6693188e2c2f10f05d1b1aaa5750.zip | |
Rewrite LLVM's archive writer in Rust
This allows it to be used by other codegen backends
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/memmap.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_data_structures/src/memmap.rs b/compiler/rustc_data_structures/src/memmap.rs index 917416df6b8..47d5d88363b 100644 --- a/compiler/rustc_data_structures/src/memmap.rs +++ b/compiler/rustc_data_structures/src/memmap.rs @@ -40,6 +40,12 @@ impl Deref for Mmap { } } +impl AsRef<[u8]> for Mmap { + fn as_ref(&self) -> &[u8] { + &*self.0 + } +} + // SAFETY: On architectures other than WASM, mmap is used as backing storage. The address of this // memory map is stable. On WASM, `Vec<u8>` is used as backing storage. The `Mmap` type doesn't // export any function that can cause the `Vec` to be re-allocated. As such the address of the |
