Skip to content

Commit 9986f24

Browse files
committed
Remove dead error code.
1 parent 19efedb commit 9986f24

File tree

3 files changed

+5
-47
lines changed

3 files changed

+5
-47
lines changed

compiler/rustc_error_codes/src/error_codes/E0698.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
#### Note: this error code is no longer emitted by the compiler.
2+
13
When using generators (or async) all type variables must be bound so a
24
generator can be constructed.
35

46
Erroneous code example:
57

6-
```edition2018,compile_fail,E0698
8+
```edition2018,compile_fail,E0282
79
async fn bar<T>() -> () {}
810
911
async fn foo() {

compiler/rustc_infer/src/errors/mod.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ use rustc_span::{symbol::Ident, BytePos, Span};
1414

1515
use crate::fluent_generated as fluent;
1616
use crate::infer::error_reporting::{
17-
need_type_info::{GeneratorKindAsDiagArg, UnderspecifiedArgKind},
18-
nice_region_error::placeholder_error::Highlighted,
17+
need_type_info::UnderspecifiedArgKind, nice_region_error::placeholder_error::Highlighted,
1918
ObligationCauseAsDiagArg,
2019
};
2120

@@ -86,16 +85,6 @@ pub struct AmbiguousReturn<'a> {
8685
pub multi_suggestions: Vec<SourceKindMultiSuggestion<'a>>,
8786
}
8887

89-
#[derive(Diagnostic)]
90-
#[diag(infer_need_type_info_in_generator, code = "E0698")]
91-
pub struct NeedTypeInfoInGenerator<'a> {
92-
#[primary_span]
93-
pub span: Span,
94-
pub generator_kind: GeneratorKindAsDiagArg,
95-
#[subdiagnostic]
96-
pub bad_label: InferenceBadError<'a>,
97-
}
98-
9988
// Used when a better one isn't available
10089
#[derive(Subdiagnostic)]
10190
#[label(infer_label_bad)]

compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::errors::{
2-
AmbiguousImpl, AmbiguousReturn, AnnotationRequired, InferenceBadError, NeedTypeInfoInGenerator,
2+
AmbiguousImpl, AmbiguousReturn, AnnotationRequired, InferenceBadError,
33
SourceKindMultiSuggestion, SourceKindSubdiag,
44
};
55
use crate::infer::error_reporting::TypeErrCtxt;
@@ -595,39 +595,6 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
595595
}
596596
}
597597

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-
631598
#[derive(Debug)]
632599
struct InferSource<'tcx> {
633600
span: Span,

0 commit comments

Comments
 (0)