about summary refs log tree commit diff
path: root/src/librustdoc/scrape_examples.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-06-14 14:52:01 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2022-06-14 14:52:01 +1000
commitabe45a9ffa6a0af65a58427b475203b301b07be8 (patch)
tree9906d3f3fe33467061db1c9b4688bf71eab38ebb /src/librustdoc/scrape_examples.rs
parentca122c7ebb3ab50149c9d3d24ddb59c252b32272 (diff)
downloadrust-abe45a9ffa6a0af65a58427b475203b301b07be8.tar.gz
rust-abe45a9ffa6a0af65a58427b475203b301b07be8.zip
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.)
Diffstat (limited to 'src/librustdoc/scrape_examples.rs')
-rw-r--r--src/librustdoc/scrape_examples.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/scrape_examples.rs b/src/librustdoc/scrape_examples.rs
index 242f926967c..da09ae9dd06 100644
--- a/src/librustdoc/scrape_examples.rs
+++ b/src/librustdoc/scrape_examples.rs
@@ -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() {