Convert DefId to use DefIndex, which is an index into a list of

paths, and construct paths for all definitions. Also, stop rewriting
DefIds for closures, and instead just load the closure data from
the original def-id, which may be in another crate.
This commit is contained in:
Niko Matsakis
2015-09-17 14:29:59 -04:00
parent a6fee06741
commit 01f32ace03
40 changed files with 1125 additions and 783 deletions

View File

@@ -19,9 +19,8 @@ use std::fmt;
use std::iter::repeat;
use rustc::metadata::cstore::LOCAL_CRATE;
use rustc::middle::def_id::DefId;
use rustc::middle::def_id::{CRATE_DEF_INDEX, DefId};
use syntax::abi::Abi;
use syntax::ast;
use rustc_front::hir;
use clean;
@@ -387,7 +386,7 @@ fn primitive_link(f: &mut fmt::Formatter,
Some(&cnum) => {
let path = &m.paths[&DefId {
krate: cnum,
xxx_node: ast::CRATE_NODE_ID,
index: CRATE_DEF_INDEX,
}];
let loc = match m.extern_locations[&cnum] {
(_, render::Remote(ref s)) => Some(s.to_string()),