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-08 09:17:49 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2022-06-08 09:50:44 +1000
commitb983e42936feab29f6333e9835913afc6b4a394e (patch)
tree5d7fc6c27501a3647f4b4c3e81ecb24ec26a51ce /src/librustdoc/scrape_examples.rs
parentdc08bc51f2c58a0f5f815a07f9bb3d671153b5a1 (diff)
downloadrust-b983e42936feab29f6333e9835913afc6b4a394e.tar.gz
rust-b983e42936feab29f6333e9835913afc6b4a394e.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).
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 81ce56b3342..f6c599297fc 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,
 };
 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() {