Skip to content

Commit cc5105d

Browse files
Don't create an FnDef of a DefKind::Variant, use the ctor def id
1 parent b4e2d75 commit cc5105d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_hir_analysis/src/collect/type_of.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,9 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
474474
VariantData::Unit(..) | VariantData::Struct { .. } => {
475475
tcx.type_of(tcx.hir().get_parent_item(hir_id)).instantiate_identity()
476476
}
477-
VariantData::Tuple(..) => {
477+
VariantData::Tuple(_, _, ctor) => {
478478
let args = ty::GenericArgs::identity_for_item(tcx, def_id);
479-
Ty::new_fn_def(tcx, def_id.to_def_id(), args)
479+
Ty::new_fn_def(tcx, ctor.to_def_id(), args)
480480
}
481481
},
482482

0 commit comments

Comments
 (0)