mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
remove use of ast_ty_to_ty_cache
from librustdoc
This commit is contained in:
parent
5efc86a838
commit
196c98d314
1
src/Cargo.lock
generated
1
src/Cargo.lock
generated
@ -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",
|
||||
|
@ -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" }
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user