|
1 | 1 | use crate::errors::{ |
2 | | - AmbiguousImpl, AmbiguousReturn, AnnotationRequired, InferenceBadError, NeedTypeInfoInGenerator, |
| 2 | + AmbiguousImpl, AmbiguousReturn, AnnotationRequired, InferenceBadError, |
3 | 3 | SourceKindMultiSuggestion, SourceKindSubdiag, |
4 | 4 | }; |
5 | 5 | use crate::infer::error_reporting::TypeErrCtxt; |
@@ -595,39 +595,6 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { |
595 | 595 | } |
596 | 596 | } |
597 | 597 |
|
598 | | -impl<'tcx> InferCtxt<'tcx> { |
599 | | - pub fn need_type_info_err_in_generator( |
600 | | - &self, |
601 | | - kind: hir::GeneratorKind, |
602 | | - span: Span, |
603 | | - ty: ty::Term<'tcx>, |
604 | | - ) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> { |
605 | | - let ty = self.resolve_vars_if_possible(ty); |
606 | | - let data = self.extract_inference_diagnostics_data(ty.into(), None); |
607 | | - |
608 | | - NeedTypeInfoInGenerator { |
609 | | - bad_label: data.make_bad_error(span), |
610 | | - span, |
611 | | - generator_kind: GeneratorKindAsDiagArg(kind), |
612 | | - } |
613 | | - .into_diagnostic(&self.tcx.sess.parse_sess.span_diagnostic) |
614 | | - } |
615 | | -} |
616 | | - |
617 | | -pub struct GeneratorKindAsDiagArg(pub hir::GeneratorKind); |
618 | | - |
619 | | -impl IntoDiagnosticArg for GeneratorKindAsDiagArg { |
620 | | - fn into_diagnostic_arg(self) -> rustc_errors::DiagnosticArgValue<'static> { |
621 | | - let kind = match self.0 { |
622 | | - hir::GeneratorKind::Async(hir::AsyncGeneratorKind::Block) => "async_block", |
623 | | - hir::GeneratorKind::Async(hir::AsyncGeneratorKind::Closure) => "async_closure", |
624 | | - hir::GeneratorKind::Async(hir::AsyncGeneratorKind::Fn) => "async_fn", |
625 | | - hir::GeneratorKind::Gen => "generator", |
626 | | - }; |
627 | | - rustc_errors::DiagnosticArgValue::Str(kind.into()) |
628 | | - } |
629 | | -} |
630 | | - |
631 | 598 | #[derive(Debug)] |
632 | 599 | struct InferSource<'tcx> { |
633 | 600 | span: Span, |
|
0 commit comments