// reachable as well.
use dep_graph::DepNode;
-use front::map as ast_map;
-use middle::def::Def;
-use middle::def_id::DefId;
-use middle::ty;
+use hir::map as ast_map;
+use hir::def::Def;
+use hir::def_id::DefId;
+use ty::{self, TyCtxt};
use middle::privacy;
use session::config;
use util::nodemap::NodeSet;
use syntax::abi::Abi;
use syntax::ast;
use syntax::attr;
-use rustc_front::hir;
-use rustc_front::intravisit::Visitor;
-use rustc_front::intravisit;
+use hir;
+use hir::intravisit::Visitor;
+use hir::intravisit;
// Returns true if the given set of generics implies that the item it's
// associated with must be inlined.
}
}
-fn method_might_be_inlined(tcx: &ty::ctxt, sig: &hir::MethodSig,
+fn method_might_be_inlined(tcx: &TyCtxt, sig: &hir::MethodSig,
impl_item: &hir::ImplItem,
impl_src: DefId) -> bool {
if attr::requests_inline(&impl_item.attrs) ||
Some(ast_map::NodeItem(item)) =>
item_might_be_inlined(&item),
Some(..) | None =>
- tcx.sess.span_bug(impl_item.span, "impl did is not an item")
+ span_bug!(impl_item.span, "impl did is not an item")
}
} else {
- tcx.sess.span_bug(impl_item.span, "found a foreign impl as a parent of a local method")
+ span_bug!(impl_item.span, "found a foreign impl as a parent of a local method")
}
}
// Information needed while computing reachability.
struct ReachableContext<'a, 'tcx: 'a> {
// The type context.
- tcx: &'a ty::ctxt<'tcx>,
+ tcx: &'a TyCtxt<'tcx>,
// The set of items which must be exported in the linkage sense.
reachable_symbols: NodeSet,
// A worklist of item IDs. Each item ID in this worklist will be inlined
let def = match self.tcx.def_map.borrow().get(&expr.id) {
Some(d) => d.full_def(),
None => {
- self.tcx.sess.span_bug(expr.span,
- "def ID not in def map?!")
+ span_bug!(expr.span, "def ID not in def map?!")
}
};
impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
// Creates a new reachability computation context.
- fn new(tcx: &'a ty::ctxt<'tcx>) -> ReachableContext<'a, 'tcx> {
+ fn new(tcx: &'a TyCtxt<'tcx>) -> ReachableContext<'a, 'tcx> {
let any_library = tcx.sess.crate_types.borrow().iter().any(|ty| {
*ty != config::CrateTypeExecutable
});
ast_map::NodeVariant(_) |
ast_map::NodeStructCtor(_) => {}
_ => {
- self.tcx
- .sess
- .bug(&format!("found unexpected thingy in worklist: {}",
- self.tcx
- .map
- .node_to_string(search_item)))
+ bug!("found unexpected thingy in worklist: {}",
+ self.tcx.map.node_to_string(search_item))
}
}
}
}
}
-pub fn find_reachable(tcx: &ty::ctxt,
+pub fn find_reachable(tcx: &TyCtxt,
access_levels: &privacy::AccessLevels)
-> NodeSet {
let _task = tcx.dep_graph.in_task(DepNode::Reachability);