Use GeneratorKind::descr() instead of it's Display impl

Those are basically the same but the first one seems to fit better
This commit is contained in:
Nikita Tomashevich 2022-08-22 00:17:46 +03:00
parent 7e4f433720
commit 3f6cb475f7
No known key found for this signature in database
GPG key ID: B29791D4D878E345
2 changed files with 2 additions and 2 deletions

View file

@ -73,7 +73,7 @@ pub struct AmbigousReturn<'a> {
pub struct NeedTypeInfoInGenerator<'a> {
#[primary_span]
pub span: Span,
pub generator_kind: String,
pub generator_kind: &'static str,
#[subdiagnostic]
pub bad_label: InferenceBadError<'a>,
}

View file

@ -568,7 +568,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
NeedTypeInfoInGenerator {
bad_label: data.make_bad_error(span),
span,
generator_kind: kind.to_string(),
generator_kind: kind.descr(),
}
.into_diagnostic(&self.tcx.sess.parse_sess)
}