Skip to content

Commit 3f6cb47

Browse files
committed
Use GeneratorKind::descr() instead of it's Display impl
Those are basically the same but the first one seems to fit better
1 parent 7e4f433 commit 3f6cb47

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_infer/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub struct AmbigousReturn<'a> {
7373
pub struct NeedTypeInfoInGenerator<'a> {
7474
#[primary_span]
7575
pub span: Span,
76-
pub generator_kind: String,
76+
pub generator_kind: &'static str,
7777
#[subdiagnostic]
7878
pub bad_label: InferenceBadError<'a>,
7979
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
568568
NeedTypeInfoInGenerator {
569569
bad_label: data.make_bad_error(span),
570570
span,
571-
generator_kind: kind.to_string(),
571+
generator_kind: kind.descr(),
572572
}
573573
.into_diagnostic(&self.tcx.sess.parse_sess)
574574
}

0 commit comments

Comments
 (0)