report_unexpected_variant_def(tcx, &def, pat.span, qpath);
return tcx.types.err;
}
- Def::VariantCtor(_, CtorKind::Fictive) => {
+ Def::VariantCtor(_, CtorKind::Fictive) |
+ Def::VariantCtor(_, CtorKind::Fn) => {
report_unexpected_variant_def(tcx, &def, pat.span, qpath);
return tcx.types.err;
}
--- /dev/null
+error[E0533]: expected unit struct/variant or constant, found tuple variant `<Self>::A`
+ --> $DIR/issue-58006.rs:9:13
+ |
+LL | Self::A => (),
+ | ^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0533`.