Skip to content

Commit 7f711b3

Browse files
committed
Remove bool from hir::OpaqueDef.
1 parent 658e100 commit 7f711b3

File tree

13 files changed

+16
-16
lines changed

13 files changed

+16
-16
lines changed

compiler/rustc_ast_lowering/src/lib.rs

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

17511751
fn lower_precise_capturing_args(

compiler/rustc_borrowck/src/diagnostics/region_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, '_, 'tcx> {
830830
///
831831
/// [`OpaqueDef`]: hir::TyKind::OpaqueDef
832832
fn get_future_inner_return_ty(&self, hir_ty: &'tcx hir::Ty<'tcx>) -> &'tcx hir::Ty<'tcx> {
833-
let hir::TyKind::OpaqueDef(opaque_ty, _, _) = hir_ty.kind else {
833+
let hir::TyKind::OpaqueDef(opaque_ty, _) = hir_ty.kind else {
834834
span_bug!(
835835
hir_ty.span,
836836
"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
@@ -335,7 +335,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
335335
// and the duplicated parameter, to ensure that they do not get out of sync.
336336
if let Node::OpaqueTy(..) = node {
337337
let opaque_ty_node = tcx.parent_hir_node(hir_id);
338-
let Node::Ty(&hir::Ty { kind: TyKind::OpaqueDef(_, lifetimes, _), .. }) = opaque_ty_node
338+
let Node::Ty(&hir::Ty { kind: TyKind::OpaqueDef(_, lifetimes), .. }) = opaque_ty_node
339339
else {
340340
bug!("unexpected {opaque_ty_node:?}")
341341
};

compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs

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

689689
// 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
@@ -2068,17 +2068,17 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
20682068
let opt_self_ty = maybe_qself.as_ref().map(|qself| self.lower_ty(qself));
20692069
self.lower_path(opt_self_ty, path, hir_ty.hir_id, false)
20702070
}
2071-
&hir::TyKind::OpaqueDef(opaque_ty, lifetimes, in_trait) => {
2071+
&hir::TyKind::OpaqueDef(opaque_ty, lifetimes) => {
20722072
let local_def_id = opaque_ty.def_id;
20732073
// If this is an RPITIT and we are using the new RPITIT lowering scheme, we
20742074
// generate the def_id of an associated type for the trait and return as
20752075
// type a projection.
2076-
let def_id = if in_trait {
2076+
let def_id = if opaque_ty.in_trait {
20772077
tcx.associated_type_for_impl_trait_in_trait(local_def_id).to_def_id()
20782078
} else {
20792079
local_def_id.to_def_id()
20802080
};
2081-
self.lower_opaque_ty(def_id, lifetimes, in_trait)
2081+
self.lower_opaque_ty(def_id, lifetimes, opaque_ty.in_trait)
20822082
}
20832083
hir::TyKind::Path(hir::QPath::TypeRelative(qself, segment)) => {
20842084
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_trait_selection/src/error_reporting/infer/nice_region_error/static_impl_trait.rs

+1-1
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(opaque, _, _) => {
287+
TyKind::OpaqueDef(opaque, _) => {
288288
// Get the identity type for this RPIT
289289
let did = opaque.def_id.to_def_id();
290290
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
@@ -859,7 +859,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
859859
}
860860

861861
fn visit_ty(&mut self, ty: &'hir hir::Ty<'hir>) {
862-
let hir::TyKind::OpaqueDef(opaque_ty, _, _) = ty.kind else {
862+
let hir::TyKind::OpaqueDef(opaque_ty, _) = ty.kind else {
863863
return hir::intravisit::walk_ty(self, ty);
864864
};
865865
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
@@ -1839,7 +1839,7 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
18391839
Array(Box::new(clean_ty(ty, cx)), length.into())
18401840
}
18411841
TyKind::Tup(tys) => Tuple(tys.iter().map(|ty| clean_ty(ty, cx)).collect()),
1842-
TyKind::OpaqueDef(ty, _, _) => {
1842+
TyKind::OpaqueDef(ty, _) => {
18431843
ImplTrait(ty.bounds.iter().filter_map(|x| clean_generic_bound(x, cx)).collect())
18441844
}
18451845
TyKind::Path(_) => clean_qpath(ty, cx),

0 commit comments

Comments
 (0)