diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2022-06-15 12:02:04 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-15 12:02:04 +0900 |
| commit | 97b9347c93726e6f27b7d45d1d3bda62d6cff2b4 (patch) | |
| tree | 2bc1d8c4e7fb3b9127a446961acb17b63d410c06 /compiler/rustc_codegen_ssa | |
| parent | 2722c2aa33d947789904694fcde4bb556e278952 (diff) | |
| parent | abe45a9ffa6a0af65a58427b475203b301b07be8 (diff) | |
| download | rust-97b9347c93726e6f27b7d45d1d3bda62d6cff2b4.tar.gz rust-97b9347c93726e6f27b7d45d1d3bda62d6cff2b4.zip | |
Rollup merge of #98083 - nnethercote:rename-Encoder, r=bjorn3
Rename rustc_serialize::opaque::Encoder as MemEncoder. This avoids the name clash with `rustc_serialize::Encoder` (a trait), and allows lots qualifiers to be removed and imports to be simplified (e.g. fewer `as` imports). (This was previously merged as commit 5 in #94732 and then was reverted in #97905 because of a perf regression caused by commit 4 in #94732.) r? ```@bjorn3```
Diffstat (limited to 'compiler/rustc_codegen_ssa')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/lib.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_ssa/src/lib.rs b/compiler/rustc_codegen_ssa/src/lib.rs index 771157dcad9..750432b0b26 100644 --- a/compiler/rustc_codegen_ssa/src/lib.rs +++ b/compiler/rustc_codegen_ssa/src/lib.rs @@ -29,7 +29,8 @@ use rustc_middle::dep_graph::WorkProduct; use rustc_middle::middle::dependency_format::Dependencies; use rustc_middle::middle::exported_symbols::SymbolExportKind; use rustc_middle::ty::query::{ExternProviders, Providers}; -use rustc_serialize::{opaque, Decodable, Decoder, Encodable, Encoder}; +use rustc_serialize::opaque::{MemDecoder, MemEncoder}; +use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use rustc_session::config::{CrateType, OutputFilenames, OutputType, RUST_CGU_EXT}; use rustc_session::cstore::{self, CrateSource}; use rustc_session::utils::NativeLibKind; @@ -203,7 +204,7 @@ const RUSTC_VERSION: Option<&str> = option_env!("CFG_VERSION"); impl CodegenResults { pub fn serialize_rlink(codegen_results: &CodegenResults) -> Vec<u8> { - let mut encoder = opaque::Encoder::new(); + let mut encoder = MemEncoder::new(); encoder.emit_raw_bytes(RLINK_MAGIC); // `emit_raw_bytes` is used to make sure that the version representation does not depend on // Encoder's inner representation of `u32`. @@ -230,7 +231,7 @@ impl CodegenResults { return Err(".rlink file was produced with encoding version {version_array}, but the current version is {RLINK_VERSION}".to_string()); } - let mut decoder = opaque::Decoder::new(&data[4..], 0); + let mut decoder = MemDecoder::new(&data[4..], 0); let rustc_version = decoder.read_str(); let current_version = RUSTC_VERSION.unwrap(); if rustc_version != current_version { |
