Skip to content

Commit f95bdf4

Browse files
Remove redundant in_trait from hir::TyKind::OpaqueDef
1 parent 360f7d7 commit f95bdf4

File tree

17 files changed

+18
-20
lines changed

17 files changed

+18
-20
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1776,7 +1776,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
17761776
hir::TyKind::OpaqueDef(
17771777
hir::ItemId { owner_id: hir::OwnerId { def_id: opaque_ty_def_id } },
17781778
generic_args,
1779-
in_trait,
17801779
)
17811780
}
17821781

compiler/rustc_borrowck/src/diagnostics/region_name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
832832
fn get_future_inner_return_ty(&self, hir_ty: &'tcx hir::Ty<'tcx>) -> &'tcx hir::Ty<'tcx> {
833833
let hir = self.infcx.tcx.hir();
834834

835-
let hir::TyKind::OpaqueDef(id, _, _) = hir_ty.kind else {
835+
let hir::TyKind::OpaqueDef(id, _) = hir_ty.kind else {
836836
span_bug!(
837837
hir_ty.span,
838838
"lowered return type of async fn is not OpaqueDef: {:?}",

compiler/rustc_hir/src/hir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,7 +2632,7 @@ impl<'hir> Ty<'hir> {
26322632
}
26332633
TyKind::Tup(tys) => tys.iter().any(Self::is_suggestable_infer_ty),
26342634
TyKind::Ptr(mut_ty) | TyKind::Ref(_, mut_ty) => mut_ty.ty.is_suggestable_infer_ty(),
2635-
TyKind::OpaqueDef(_, generic_args, _) => are_suggestable_generic_args(generic_args),
2635+
TyKind::OpaqueDef(_, generic_args) => are_suggestable_generic_args(generic_args),
26362636
TyKind::Path(QPath::TypeRelative(ty, segment)) => {
26372637
ty.is_suggestable_infer_ty() || are_suggestable_generic_args(segment.args().args)
26382638
}
@@ -2856,7 +2856,7 @@ pub enum TyKind<'hir> {
28562856
/// possibly parameters) that are actually bound on the `impl Trait`.
28572857
///
28582858
/// The last parameter specifies whether this opaque appears in a trait definition.
2859-
OpaqueDef(ItemId, &'hir [GenericArg<'hir>], bool),
2859+
OpaqueDef(ItemId, &'hir [GenericArg<'hir>]),
28602860
/// A trait object type `Bound1 + Bound2 + Bound3`
28612861
/// where `Bound` is a trait or a lifetime.
28622862
TraitObject(

compiler/rustc_hir/src/intravisit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) -> V::Resul
894894
TyKind::Path(ref qpath) => {
895895
try_visit!(visitor.visit_qpath(qpath, typ.hir_id, typ.span));
896896
}
897-
TyKind::OpaqueDef(item_id, lifetimes, _in_trait) => {
897+
TyKind::OpaqueDef(item_id, lifetimes) => {
898898
try_visit!(visitor.visit_nested_item(item_id));
899899
walk_list!(visitor, visit_generic_arg, lifetimes);
900900
}

compiler/rustc_hir_analysis/src/collect/predicates_of.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
332332
// and the duplicated parameter, to ensure that they do not get out of sync.
333333
if let Node::Item(&Item { kind: ItemKind::OpaqueTy(..), .. }) = node {
334334
let opaque_ty_node = tcx.parent_hir_node(hir_id);
335-
let Node::Ty(&hir::Ty { kind: TyKind::OpaqueDef(_, lifetimes, _), .. }) = opaque_ty_node
335+
let Node::Ty(&hir::Ty { kind: TyKind::OpaqueDef(_, lifetimes), .. }) = opaque_ty_node
336336
else {
337337
bug!("unexpected {opaque_ty_node:?}")
338338
};

compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
689689
};
690690
self.with(scope, |this| this.visit_ty(mt.ty));
691691
}
692-
hir::TyKind::OpaqueDef(item_id, lifetimes, _in_trait) => {
692+
hir::TyKind::OpaqueDef(item_id, lifetimes) => {
693693
// Resolve the lifetimes in the bounds to the lifetime defs in the generics.
694694
// `fn foo<'a>() -> impl MyTrait<'a> { ... }` desugars to
695695
// `type MyAnonTy<'b> = impl MyTrait<'b>;`

compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,11 +2087,11 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
20872087
let opt_self_ty = maybe_qself.as_ref().map(|qself| self.lower_ty(qself));
20882088
self.lower_path(opt_self_ty, path, hir_ty.hir_id, false)
20892089
}
2090-
&hir::TyKind::OpaqueDef(item_id, lifetimes, in_trait) => {
2090+
&hir::TyKind::OpaqueDef(item_id, lifetimes) => {
20912091
let opaque_ty = tcx.hir().item(item_id);
20922092

20932093
match opaque_ty.kind {
2094-
hir::ItemKind::OpaqueTy(&hir::OpaqueTy { .. }) => {
2094+
hir::ItemKind::OpaqueTy(&hir::OpaqueTy { in_trait, .. }) => {
20952095
let local_def_id = item_id.owner_id.def_id;
20962096
// If this is an RPITIT and we are using the new RPITIT lowering scheme, we
20972097
// generate the def_id of an associated type for the trait and return as

compiler/rustc_middle/src/ty/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ impl<'v> hir::intravisit::Visitor<'v> for TraitObjectVisitor<'v> {
510510
) => {
511511
self.0.push(ty);
512512
}
513-
hir::TyKind::OpaqueDef(item_id, _, _) => {
513+
hir::TyKind::OpaqueDef(item_id, _) => {
514514
self.0.push(ty);
515515
let item = self.1.item(item_id);
516516
hir::intravisit::walk_item(self, item);

compiler/rustc_passes/src/dead.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> {
656656
}
657657

658658
fn visit_ty(&mut self, ty: &'tcx hir::Ty<'tcx>) {
659-
if let TyKind::OpaqueDef(item_id, _, _) = ty.kind {
659+
if let TyKind::OpaqueDef(item_id, _) = ty.kind {
660660
let item = self.tcx.hir().item(item_id);
661661
intravisit::walk_item(self, item);
662662
}

compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/static_impl_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ pub fn suggest_new_region_bound(
284284
}
285285
match fn_return.kind {
286286
// FIXME(precise_captures): Suggest adding to `use<...>` list instead.
287-
TyKind::OpaqueDef(item_id, _, _) => {
287+
TyKind::OpaqueDef(item_id, _) => {
288288
let item = tcx.hir().item(item_id);
289289
let ItemKind::OpaqueTy(opaque) = &item.kind else {
290290
return;

0 commit comments

Comments
 (0)