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.)
This commit is contained in:
Nicholas Nethercote
2022-06-14 14:52:01 +10:00
parent ca122c7ebb
commit abe45a9ffa
22 changed files with 124 additions and 141 deletions

View File

@@ -17,7 +17,7 @@ use rustc_middle::hir::map::Map;
use rustc_middle::hir::nested_filter;
use rustc_middle::ty::{self, TyCtxt};
use rustc_serialize::{
opaque::{Decoder, FileEncoder},
opaque::{FileEncoder, MemDecoder},
Decodable, Encodable, Encoder,
};
use rustc_session::getopts;
@@ -336,7 +336,7 @@ pub(crate) fn load_call_locations(
let mut all_calls: AllCallLocations = FxHashMap::default();
for path in with_examples {
let bytes = fs::read(&path).map_err(|e| format!("{} (for path {})", e, path))?;
let mut decoder = Decoder::new(&bytes, 0);
let mut decoder = MemDecoder::new(&bytes, 0);
let calls = AllCallLocations::decode(&mut decoder);
for (function, fn_calls) in calls.into_iter() {