hir: remove NodeId from TraitRef
This commit is contained in:
parent
aa6a9c3f41
commit
01cf66bb30
7 changed files with 7 additions and 15 deletions
|
@ -2338,13 +2338,12 @@ impl<'a> LoweringContext<'a> {
|
|||
let future_path =
|
||||
this.std_path(span, &["future", "Future"], Some(future_params), false);
|
||||
|
||||
let LoweredNodeId { node_id, hir_id } = this.next_id();
|
||||
let LoweredNodeId { node_id: _, hir_id } = this.next_id();
|
||||
let mut bounds = vec![
|
||||
hir::GenericBound::Trait(
|
||||
hir::PolyTraitRef {
|
||||
trait_ref: hir::TraitRef {
|
||||
path: future_path,
|
||||
ref_id: node_id,
|
||||
hir_ref_id: hir_id,
|
||||
},
|
||||
bound_generic_params: hir_vec![],
|
||||
|
@ -2714,10 +2713,9 @@ impl<'a> LoweringContext<'a> {
|
|||
hir::QPath::Resolved(None, path) => path.and_then(|path| path),
|
||||
qpath => bug!("lower_trait_ref: unexpected QPath `{:?}`", qpath),
|
||||
};
|
||||
let LoweredNodeId { node_id, hir_id } = self.lower_node_id(p.ref_id);
|
||||
let LoweredNodeId { node_id: _, hir_id } = self.lower_node_id(p.ref_id);
|
||||
hir::TraitRef {
|
||||
path,
|
||||
ref_id: node_id,
|
||||
hir_ref_id: hir_id,
|
||||
}
|
||||
}
|
||||
|
@ -5056,7 +5054,6 @@ impl<'a> LoweringContext<'a> {
|
|||
bound_generic_params: hir::HirVec::new(),
|
||||
trait_ref: hir::TraitRef {
|
||||
path: path.and_then(|path| path),
|
||||
ref_id: id.node_id,
|
||||
hir_ref_id: id.hir_id,
|
||||
},
|
||||
span,
|
||||
|
|
|
@ -2062,7 +2062,6 @@ pub enum UseKind {
|
|||
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
|
||||
pub struct TraitRef {
|
||||
pub path: Path,
|
||||
pub ref_id: NodeId,
|
||||
pub hir_ref_id: HirId,
|
||||
}
|
||||
|
||||
|
|
|
@ -385,8 +385,7 @@ impl_stable_hash_for!(enum hir::ImplicitSelfKind {
|
|||
});
|
||||
|
||||
impl_stable_hash_for!(struct hir::TraitRef {
|
||||
// Don't hash the ref_id. It is tracked via the thing it is used to access
|
||||
ref_id -> _,
|
||||
// Don't hash the hir_ref_id. It is tracked via the thing it is used to access
|
||||
hir_ref_id -> _,
|
||||
path,
|
||||
});
|
||||
|
|
|
@ -718,7 +718,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
|
|||
// specify type to assert that error was already reported in Err case:
|
||||
let predicate: Result<_, ErrorReported> =
|
||||
self.ast_type_binding_to_poly_projection_predicate(
|
||||
trait_ref.ref_id, poly_trait_ref, binding, speculative, &mut dup_bindings);
|
||||
trait_ref.hir_ref_id, poly_trait_ref, binding, speculative, &mut dup_bindings);
|
||||
// okay to ignore Err because of ErrorReported (see above)
|
||||
Some((predicate.ok()?, binding.span))
|
||||
}));
|
||||
|
@ -802,7 +802,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
|
|||
|
||||
fn ast_type_binding_to_poly_projection_predicate(
|
||||
&self,
|
||||
ref_id: ast::NodeId,
|
||||
hir_ref_id: hir::HirId,
|
||||
trait_ref: ty::PolyTraitRef<'tcx>,
|
||||
binding: &ConvertedBinding<'tcx>,
|
||||
speculative: bool,
|
||||
|
@ -874,7 +874,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
|
|||
binding.item_name, binding.span)
|
||||
}?;
|
||||
|
||||
let hir_ref_id = self.tcx().hir().node_to_hir_id(ref_id);
|
||||
let (assoc_ident, def_scope) =
|
||||
tcx.adjust_ident(binding.item_name, candidate.def_id(), hir_ref_id);
|
||||
let assoc_ty = tcx.associated_items(candidate.def_id()).find(|i| {
|
||||
|
|
|
@ -386,8 +386,8 @@ pub fn hir_trait_to_predicates<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, hir_trait:
|
|||
// In case there are any projections etc, find the "environment"
|
||||
// def-id that will be used to determine the traits/predicates in
|
||||
// scope. This is derived from the enclosing item-like thing.
|
||||
let env_node_id = tcx.hir().get_parent(hir_trait.ref_id);
|
||||
let env_def_id = tcx.hir().local_def_id(env_node_id);
|
||||
let env_hir_id = tcx.hir().get_parent_item(hir_trait.hir_ref_id);
|
||||
let env_def_id = tcx.hir().local_def_id_from_hir_id(env_hir_id);
|
||||
let item_cx = self::collect::ItemCtxt::new(tcx, env_def_id);
|
||||
let mut projections = Vec::new();
|
||||
let (principal, _) = astconv::AstConv::instantiate_poly_trait_ref_inner(
|
||||
|
|
|
@ -115,7 +115,6 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
|
|||
if result.is_auto() {
|
||||
let trait_ = hir::TraitRef {
|
||||
path: get_path_for_type(self.cx.tcx, trait_def_id, hir::def::Def::Trait),
|
||||
ref_id: ast::DUMMY_NODE_ID,
|
||||
hir_ref_id: hir::DUMMY_HIR_ID,
|
||||
};
|
||||
|
||||
|
|
|
@ -123,7 +123,6 @@ impl<'a, 'tcx, 'rcx> BlanketImplFinder <'a, 'tcx, 'rcx> {
|
|||
path: get_path_for_type(infcx.tcx,
|
||||
trait_def_id,
|
||||
hir::def::Def::Trait),
|
||||
ref_id: ast::DUMMY_NODE_ID,
|
||||
hir_ref_id: hir::DUMMY_HIR_ID,
|
||||
};
|
||||
let provided_trait_methods =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue