1
Fork 0

Remove {ast,hir}::WhereEqPredicate::id.

These fields are unused.
This commit is contained in:
Nicholas Nethercote 2022-07-29 10:16:25 +10:00
parent 40336865fe
commit 3e04fed6fa
7 changed files with 4 additions and 16 deletions

View file

@ -497,7 +497,6 @@ pub struct WhereRegionPredicate {
/// E.g., `T = int`. /// E.g., `T = int`.
#[derive(Clone, Encodable, Decodable, Debug)] #[derive(Clone, Encodable, Decodable, Debug)]
pub struct WhereEqPredicate { pub struct WhereEqPredicate {
pub id: NodeId,
pub span: Span, pub span: Span,
pub lhs_ty: P<Ty>, pub lhs_ty: P<Ty>,
pub rhs_ty: P<Ty>, pub rhs_ty: P<Ty>,

View file

@ -933,8 +933,7 @@ pub fn noop_visit_where_predicate<T: MutVisitor>(pred: &mut WherePredicate, vis:
visit_vec(bounds, |bound| noop_visit_param_bound(bound, vis)); visit_vec(bounds, |bound| noop_visit_param_bound(bound, vis));
} }
WherePredicate::EqPredicate(ep) => { WherePredicate::EqPredicate(ep) => {
let WhereEqPredicate { id, span, lhs_ty, rhs_ty } = ep; let WhereEqPredicate { span, lhs_ty, rhs_ty } = ep;
vis.visit_id(id);
vis.visit_span(span); vis.visit_span(span);
vis.visit_ty(lhs_ty); vis.visit_ty(lhs_ty);
vis.visit_ty(rhs_ty); vis.visit_ty(rhs_ty);

View file

@ -1498,9 +1498,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
), ),
in_where_clause: true, in_where_clause: true,
}), }),
WherePredicate::EqPredicate(WhereEqPredicate { id, ref lhs_ty, ref rhs_ty, span }) => { WherePredicate::EqPredicate(WhereEqPredicate { ref lhs_ty, ref rhs_ty, span }) => {
hir::WherePredicate::EqPredicate(hir::WhereEqPredicate { hir::WherePredicate::EqPredicate(hir::WhereEqPredicate {
hir_id: self.lower_node_id(id),
lhs_ty: self lhs_ty: self
.lower_ty(lhs_ty, ImplTraitContext::Disallowed(ImplTraitPosition::Type)), .lower_ty(lhs_ty, ImplTraitContext::Disallowed(ImplTraitPosition::Type)),
rhs_ty: self rhs_ty: self

View file

@ -640,11 +640,7 @@ impl<'a> TraitDef<'a> {
} }
ast::WherePredicate::EqPredicate(we) => { ast::WherePredicate::EqPredicate(we) => {
let span = we.span.with_ctxt(ctxt); let span = we.span.with_ctxt(ctxt);
ast::WherePredicate::EqPredicate(ast::WhereEqPredicate { ast::WherePredicate::EqPredicate(ast::WhereEqPredicate { span, ..we.clone() })
id: ast::DUMMY_NODE_ID,
span,
..we.clone()
})
} }
} }
})); }));

View file

@ -778,7 +778,6 @@ impl<'hir> WhereRegionPredicate<'hir> {
/// An equality predicate (e.g., `T = int`); currently unsupported. /// An equality predicate (e.g., `T = int`); currently unsupported.
#[derive(Debug, HashStable_Generic)] #[derive(Debug, HashStable_Generic)]
pub struct WhereEqPredicate<'hir> { pub struct WhereEqPredicate<'hir> {
pub hir_id: HirId,
pub span: Span, pub span: Span,
pub lhs_ty: &'hir Ty<'hir>, pub lhs_ty: &'hir Ty<'hir>,
pub rhs_ty: &'hir Ty<'hir>, pub rhs_ty: &'hir Ty<'hir>,

View file

@ -876,10 +876,7 @@ pub fn walk_where_predicate<'v, V: Visitor<'v>>(
visitor.visit_lifetime(lifetime); visitor.visit_lifetime(lifetime);
walk_list!(visitor, visit_param_bound, bounds); walk_list!(visitor, visit_param_bound, bounds);
} }
WherePredicate::EqPredicate(WhereEqPredicate { WherePredicate::EqPredicate(WhereEqPredicate { ref lhs_ty, ref rhs_ty, .. }) => {
hir_id, ref lhs_ty, ref rhs_ty, ..
}) => {
visitor.visit_id(hir_id);
visitor.visit_ty(lhs_ty); visitor.visit_ty(lhs_ty);
visitor.visit_ty(rhs_ty); visitor.visit_ty(rhs_ty);
} }

View file

@ -314,7 +314,6 @@ impl<'a> Parser<'a> {
span: lo.to(self.prev_token.span), span: lo.to(self.prev_token.span),
lhs_ty: ty, lhs_ty: ty,
rhs_ty, rhs_ty,
id: ast::DUMMY_NODE_ID,
})) }))
} else { } else {
self.maybe_recover_bounds_doubled_colon(&ty)?; self.maybe_recover_bounds_doubled_colon(&ty)?;