Skip to content

Commit 4cf4741

Browse files
committed
Remove bool from hir::OpaqueDef.
1 parent 31174e5 commit 4cf4741

File tree

14 files changed

+17
-17
lines changed

14 files changed

+17
-17
lines changed

compiler/rustc_ast_lowering/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1768,7 +1768,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
17681768
// Foo = impl Trait` is, internally, created as a child of the
17691769
// async fn, so the *type parameters* are inherited. It's
17701770
// only the lifetime parameters that we must supply.
1771-
hir::TyKind::OpaqueDef(opaque_ty_def, generic_args, in_trait)
1771+
hir::TyKind::OpaqueDef(opaque_ty_def, generic_args)
17721772
}
17731773

17741774
fn lower_precise_capturing_args(

compiler/rustc_borrowck/src/diagnostics/region_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, '_, 'tcx> {
829829
///
830830
/// [`OpaqueDef`]: hir::TyKind::OpaqueDef
831831
fn get_future_inner_return_ty(&self, hir_ty: &'tcx hir::Ty<'tcx>) -> &'tcx hir::Ty<'tcx> {
832-
let hir::TyKind::OpaqueDef(opaque_ty, _, _) = hir_ty.kind else {
832+
let hir::TyKind::OpaqueDef(opaque_ty, _) = hir_ty.kind else {
833833
span_bug!(
834834
hir_ty.span,
835835
"lowered return type of async fn is not OpaqueDef: {:?}",

compiler/rustc_hir/src/hir.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2610,7 +2610,7 @@ impl<'hir> Ty<'hir> {
26102610
}
26112611
TyKind::Tup(tys) => tys.iter().any(Self::is_suggestable_infer_ty),
26122612
TyKind::Ptr(mut_ty) | TyKind::Ref(_, mut_ty) => mut_ty.ty.is_suggestable_infer_ty(),
2613-
TyKind::OpaqueDef(_, generic_args, _) => are_suggestable_generic_args(generic_args),
2613+
TyKind::OpaqueDef(_, generic_args) => are_suggestable_generic_args(generic_args),
26142614
TyKind::Path(QPath::TypeRelative(ty, segment)) => {
26152615
ty.is_suggestable_infer_ty() || are_suggestable_generic_args(segment.args().args)
26162616
}
@@ -2837,7 +2837,7 @@ pub enum TyKind<'hir> {
28372837
/// possibly parameters) that are actually bound on the `impl Trait`.
28382838
///
28392839
/// The last parameter specifies whether this opaque appears in a trait definition.
2840-
OpaqueDef(&'hir OpaqueTy<'hir>, &'hir [GenericArg<'hir>], bool),
2840+
OpaqueDef(&'hir OpaqueTy<'hir>, &'hir [GenericArg<'hir>]),
28412841
/// A trait object type `Bound1 + Bound2 + Bound3`
28422842
/// where `Bound` is a trait or a lifetime.
28432843
TraitObject(

compiler/rustc_hir/src/intravisit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) -> V::Resul
896896
TyKind::Path(ref qpath) => {
897897
try_visit!(visitor.visit_qpath(qpath, typ.hir_id, typ.span));
898898
}
899-
TyKind::OpaqueDef(opaque, lifetimes, _in_trait) => {
899+
TyKind::OpaqueDef(opaque, lifetimes) => {
900900
try_visit!(visitor.visit_opaque_ty(opaque));
901901
walk_list!(visitor, visit_generic_arg, lifetimes);
902902
}

compiler/rustc_hir_analysis/src/collect/predicates_of.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
317317
// and the duplicated parameter, to ensure that they do not get out of sync.
318318
if let Node::OpaqueTy(..) = node {
319319
let opaque_ty_node = tcx.parent_hir_node(hir_id);
320-
let Node::Ty(&hir::Ty { kind: TyKind::OpaqueDef(_, lifetimes, _), .. }) = opaque_ty_node
320+
let Node::Ty(&hir::Ty { kind: TyKind::OpaqueDef(_, lifetimes), .. }) = opaque_ty_node
321321
else {
322322
bug!("unexpected {opaque_ty_node:?}")
323323
};

compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ impl<'a, 'tcx> Visitor<'tcx> for BoundVarContext<'a, 'tcx> {
682682
};
683683
self.with(scope, |this| this.visit_ty(mt.ty));
684684
}
685-
hir::TyKind::OpaqueDef(opaque_ty, lifetimes, _in_trait) => {
685+
hir::TyKind::OpaqueDef(opaque_ty, lifetimes) => {
686686
self.visit_opaque_ty(opaque_ty);
687687

688688
// Resolve the lifetimes in the bounds to the lifetime defs in the generics.

compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2082,17 +2082,17 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
20822082
let opt_self_ty = maybe_qself.as_ref().map(|qself| self.lower_ty(qself));
20832083
self.lower_path(opt_self_ty, path, hir_ty.hir_id, false)
20842084
}
2085-
&hir::TyKind::OpaqueDef(opaque_ty, lifetimes, in_trait) => {
2085+
&hir::TyKind::OpaqueDef(opaque_ty, lifetimes) => {
20862086
let local_def_id = opaque_ty.def_id;
20872087
// If this is an RPITIT and we are using the new RPITIT lowering scheme, we
20882088
// generate the def_id of an associated type for the trait and return as
20892089
// type a projection.
2090-
let def_id = if in_trait {
2090+
let def_id = if opaque_ty.in_trait {
20912091
tcx.associated_type_for_impl_trait_in_trait(local_def_id).to_def_id()
20922092
} else {
20932093
local_def_id.to_def_id()
20942094
};
2095-
self.lower_opaque_ty(def_id, lifetimes, in_trait)
2095+
self.lower_opaque_ty(def_id, lifetimes, opaque_ty.in_trait)
20962096
}
20972097
hir::TyKind::Path(hir::QPath::TypeRelative(qself, segment)) => {
20982098
debug!(?qself, ?segment);

compiler/rustc_lint/src/non_local_def.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ fn ty_has_local_parent(
445445
| TyKind::Path(_)
446446
| TyKind::Pat(..)
447447
| TyKind::AnonAdt(_)
448-
| TyKind::OpaqueDef(_, _, _)
448+
| TyKind::OpaqueDef(_, _)
449449
| TyKind::Typeof(_)
450450
| TyKind::Infer
451451
| TyKind::Err(_) => false,

compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ declare_lint_pass!(OpaqueHiddenInferredBound => [OPAQUE_HIDDEN_INFERRED_BOUND]);
6969

7070
impl<'tcx> LateLintPass<'tcx> for OpaqueHiddenInferredBound {
7171
fn check_ty(&mut self, cx: &LateContext<'tcx>, ty: &'tcx hir::Ty<'tcx>) {
72-
let hir::TyKind::OpaqueDef(opaque, _, _) = &ty.kind else {
72+
let hir::TyKind::OpaqueDef(opaque, _) = &ty.kind else {
7373
return;
7474
};
7575
let def_id = opaque.def_id.to_def_id();

compiler/rustc_middle/src/ty/diagnostics.rs

+1-1
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(opaq, _, _) => {
513+
hir::TyKind::OpaqueDef(opaq, _) => {
514514
self.0.push(ty);
515515
hir::intravisit::walk_opaque_ty(self, opaq);
516516
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ pub fn suggest_new_region_bound(
283283
}
284284
match fn_return.kind {
285285
// FIXME(precise_captures): Suggest adding to `use<...>` list instead.
286-
TyKind::OpaqueDef(opaque, _, _) => {
286+
TyKind::OpaqueDef(opaque, _) => {
287287
// Get the identity type for this RPIT
288288
let did = opaque.def_id.to_def_id();
289289
let ty = Ty::new_opaque(tcx, did, ty::GenericArgs::identity_for_item(tcx, did));

compiler/rustc_trait_selection/src/error_reporting/infer/region.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
838838
}
839839

840840
fn visit_ty(&mut self, ty: &'hir hir::Ty<'hir>) {
841-
let hir::TyKind::OpaqueDef(opaque_ty, _, _) = ty.kind else {
841+
let hir::TyKind::OpaqueDef(opaque_ty, _) = ty.kind else {
842842
return hir::intravisit::walk_ty(self, ty);
843843
};
844844
if let Some(&(_, b)) =

compiler/rustc_ty_utils/src/assoc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ fn associated_types_for_impl_traits_in_associated_fn(
322322

323323
impl<'tcx> Visitor<'tcx> for RPITVisitor {
324324
fn visit_ty(&mut self, ty: &'tcx hir::Ty<'tcx>) {
325-
if let hir::TyKind::OpaqueDef(opaq, _, _) = ty.kind
325+
if let hir::TyKind::OpaqueDef(opaq, _) = ty.kind
326326
&& self.rpits.insert(opaq.def_id)
327327
{
328328
for bound in opaq.bounds {

src/librustdoc/clean/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,7 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
18411841
Array(Box::new(clean_ty(ty, cx)), length.into())
18421842
}
18431843
TyKind::Tup(tys) => Tuple(tys.iter().map(|ty| clean_ty(ty, cx)).collect()),
1844-
TyKind::OpaqueDef(ty, _, _) => {
1844+
TyKind::OpaqueDef(ty, _) => {
18451845
ImplTrait(ty.bounds.iter().filter_map(|x| clean_generic_bound(x, cx)).collect())
18461846
}
18471847
TyKind::Path(_) => clean_qpath(ty, cx),

0 commit comments

Comments
 (0)