remove use of ast_ty_to_ty_cache from librustdoc

This commit is contained in:
Niko Matsakis 2017-05-03 11:53:06 -04:00
parent 5efc86a838
commit 196c98d314
4 changed files with 7 additions and 4 deletions

1
src/Cargo.lock generated
View File

@ -793,6 +793,7 @@ dependencies = [
"rustc_metadata 0.0.0",
"rustc_resolve 0.0.0",
"rustc_trans 0.0.0",
"rustc_typeck 0.0.0",
"serialize 0.0.0",
"syntax 0.0.0",
"syntax_pos 0.0.0",

View File

@ -21,6 +21,7 @@ rustc_errors = { path = "../librustc_errors" }
rustc_lint = { path = "../librustc_lint" }
rustc_metadata = { path = "../librustc_metadata" }
rustc_resolve = { path = "../librustc_resolve" }
rustc_typeck = { path = "../librustc_typeck" }
rustc_trans = { path = "../librustc_trans" }
serialize = { path = "../libserialize" }
syntax = { path = "../libsyntax" }

View File

@ -36,6 +36,7 @@ use rustc::ty::subst::Substs;
use rustc::ty::{self, AdtKind};
use rustc::middle::stability;
use rustc::util::nodemap::{FxHashMap, FxHashSet};
use rustc_typeck::hir_ty_to_ty;
use rustc::hir;
@ -1779,11 +1780,10 @@ impl Clean<Type> for hir::Ty {
}
TyPath(hir::QPath::TypeRelative(ref qself, ref segment)) => {
let mut def = Def::Err;
if let Some(ty) = cx.tcx.ast_ty_to_ty_cache.borrow().get(&self.id) {
let ty = hir_ty_to_ty(cx.tcx, self);
if let ty::TyProjection(proj) = ty.sty {
def = Def::Trait(proj.trait_ref.def_id);
}
}
let trait_path = hir::Path {
span: self.span,
def: def,

View File

@ -41,6 +41,7 @@ extern crate rustc_resolve;
extern crate rustc_lint;
extern crate rustc_back;
extern crate rustc_metadata;
extern crate rustc_typeck;
extern crate serialize;
#[macro_use] extern crate syntax;
extern crate syntax_pos;