about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-04-02 14:13:25 -0400
committerMichael Goulet <michael@errs.io>2024-04-02 14:13:25 -0400
commitcc5105d246c77d54cabb4f595d4e87c14358073d (patch)
tree6c757639ebb26ce7a3559db867cbf25796bc1d75
parentb4e2d75d3598a4f9e89d918255e84053c68a4583 (diff)
downloadrust-cc5105d246c77d54cabb4f595d4e87c14358073d.tar.gz
rust-cc5105d246c77d54cabb4f595d4e87c14358073d.zip
Don't create an FnDef of a DefKind::Variant, use the ctor def id
-rw-r--r--compiler/rustc_hir_analysis/src/collect/type_of.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_hir_analysis/src/collect/type_of.rs b/compiler/rustc_hir_analysis/src/collect/type_of.rs
index 722def2563c..9d7deebac48 100644
--- a/compiler/rustc_hir_analysis/src/collect/type_of.rs
+++ b/compiler/rustc_hir_analysis/src/collect/type_of.rs
@@ -474,9 +474,9 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
             VariantData::Unit(..) | VariantData::Struct { .. } => {
                 tcx.type_of(tcx.hir().get_parent_item(hir_id)).instantiate_identity()
             }
-            VariantData::Tuple(..) => {
+            VariantData::Tuple(_, _, ctor) => {
                 let args = ty::GenericArgs::identity_for_item(tcx, def_id);
-                Ty::new_fn_def(tcx, def_id.to_def_id(), args)
+                Ty::new_fn_def(tcx, ctor.to_def_id(), args)
             }
         },