Skip to content

Commit 196c98d

Browse files
committed
remove use of ast_ty_to_ty_cache from librustdoc
1 parent 5efc86a commit 196c98d

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/librustdoc/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ rustc_errors = { path = "../librustc_errors" }
2121
rustc_lint = { path = "../librustc_lint" }
2222
rustc_metadata = { path = "../librustc_metadata" }
2323
rustc_resolve = { path = "../librustc_resolve" }
24+
rustc_typeck = { path = "../librustc_typeck" }
2425
rustc_trans = { path = "../librustc_trans" }
2526
serialize = { path = "../libserialize" }
2627
syntax = { path = "../libsyntax" }

src/librustdoc/clean/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ use rustc::ty::subst::Substs;
3636
use rustc::ty::{self, AdtKind};
3737
use rustc::middle::stability;
3838
use rustc::util::nodemap::{FxHashMap, FxHashSet};
39+
use rustc_typeck::hir_ty_to_ty;
3940

4041
use rustc::hir;
4142

@@ -1779,10 +1780,9 @@ impl Clean<Type> for hir::Ty {
17791780
}
17801781
TyPath(hir::QPath::TypeRelative(ref qself, ref segment)) => {
17811782
let mut def = Def::Err;
1782-
if let Some(ty) = cx.tcx.ast_ty_to_ty_cache.borrow().get(&self.id) {
1783-
if let ty::TyProjection(proj) = ty.sty {
1784-
def = Def::Trait(proj.trait_ref.def_id);
1785-
}
1783+
let ty = hir_ty_to_ty(cx.tcx, self);
1784+
if let ty::TyProjection(proj) = ty.sty {
1785+
def = Def::Trait(proj.trait_ref.def_id);
17861786
}
17871787
let trait_path = hir::Path {
17881788
span: self.span,

src/librustdoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ extern crate rustc_resolve;
4141
extern crate rustc_lint;
4242
extern crate rustc_back;
4343
extern crate rustc_metadata;
44+
extern crate rustc_typeck;
4445
extern crate serialize;
4546
#[macro_use] extern crate syntax;
4647
extern crate syntax_pos;

0 commit comments

Comments
 (0)