diff options
| author | Wesley Wiser <wwiser@gmail.com> | 2018-04-15 19:41:33 -0400 |
|---|---|---|
| committer | Wesley Wiser <wwiser@gmail.com> | 2018-04-19 20:33:18 -0400 |
| commit | 4a77d35c1ed89310a0ed128ce931cd4b85ca4cd4 (patch) | |
| tree | c9d0f8283478baf25c2e7facb505031181db4787 /src/librustdoc/clean | |
| parent | 8830a0304327ba8c983555ac5d42cec0569c31bb (diff) | |
Remove HIR inlining
Fixes #49690
Diffstat (limited to 'src/librustdoc/clean')
| -rw-r--r-- | src/librustdoc/clean/inline.rs | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 090adc27ef0..32f23e923d9 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -10,10 +10,7 @@ //! Support for inlining external documentation into the current AST. -use std::collections::BTreeMap; -use std::io; use std::iter::once; -use rustc_data_structures::sync::Lrc; use syntax::ast; use rustc::hir; @@ -408,27 +405,8 @@ fn build_module(cx: &DocContext, did: DefId) -> clean::Module { } } -struct InlinedConst { - nested_bodies: Lrc<BTreeMap<hir::BodyId, hir::Body>> -} - -impl hir::print::PpAnn for InlinedConst { - fn nested(&self, state: &mut hir::print::State, nested: hir::print::Nested) - -> io::Result<()> { - if let hir::print::Nested::Body(body) = nested { - state.print_expr(&self.nested_bodies[&body].value) - } else { - Ok(()) - } - } -} - pub fn print_inlined_const(cx: &DocContext, did: DefId) -> String { - let body = cx.tcx.extern_const_body(did).body; - let inlined = InlinedConst { - nested_bodies: cx.tcx.item_body_nested_bodies(did).nested_bodies - }; - hir::print::to_string(&inlined, |s| s.print_expr(&body.value)) + cx.tcx.rendered_const(did) } fn build_const(cx: &DocContext, did: DefId) -> clean::Constant { |
