}
hir::TyTraitObject(bounds, lifetime_bound)
}
- TyKind::ImplTrait(exist_ty_node_id, ref bounds) => {
+ TyKind::ImplTrait(def_node_id, ref bounds) => {
let span = t.span;
match itctx {
ImplTraitContext::Existential(fn_def_id) => {
self.lower_existential_impl_trait(
- span, fn_def_id, exist_ty_node_id,
+ span, fn_def_id, def_node_id,
|this| this.lower_param_bounds(bounds, itctx),
)
}
ImplTraitContext::Universal(def_id) => {
- let def_node_id = self.next_id().node_id;
-
+ self.lower_node_id(def_node_id);
// Add a definition for the in-band TyParam
let def_index = self.resolver.definitions().create_def_with_parent(
def_id.index,
// Make sure that the DepNode of some node coincides with the HirId
// owner of that node.
if cfg!(debug_assertions) {
- let hir_id_owner = self.definitions.node_to_hir_id(id).owner;
+ let hir_id = self.definitions.node_to_hir_id(id);
- if hir_id_owner != self.current_dep_node_owner {
+ if hir_id.owner != self.current_dep_node_owner {
let node_str = match self.definitions.opt_def_index(id) {
Some(def_index) => {
self.definitions.def_path(def_index).to_string_no_crate()
None => format!("{:?}", node)
};
+ if hir_id == ::hir::DUMMY_HIR_ID {
+ println!("Maybe you forgot to lower the node id {:?}?", id);
+ }
+
bug!("inconsistent DepNode for `{}`: \
current_dep_node_owner={}, hir_id.owner={}",
node_str,
self.definitions
.def_path(self.current_dep_node_owner)
.to_string_no_crate(),
- self.definitions.def_path(hir_id_owner).to_string_no_crate())
+ self.definitions.def_path(hir_id.owner).to_string_no_crate())
}
}