about summary refs log tree commit diff
path: root/compiler/rustc_infer/src
diff options
context:
space:
mode:
authorNikita Tomashevich <quant3234@gmail.com>2022-08-22 00:17:46 +0300
committerNikita Tomashevich <quant3234@gmail.com>2022-08-23 14:47:08 +0300
commit3f6cb475f7aa1f4475fdb313316a7df644113376 (patch)
treee4013abec9af54d14d7039fa2ac3e2a78f41da34 /compiler/rustc_infer/src
parent7e4f4337203b247bdbfbb0661e59ab1aa3bee3f1 (diff)
downloadrust-3f6cb475f7aa1f4475fdb313316a7df644113376.tar.gz
rust-3f6cb475f7aa1f4475fdb313316a7df644113376.zip
Use GeneratorKind::descr() instead of it's Display impl
Those are basically the same but the first one seems to fit better
Diffstat (limited to 'compiler/rustc_infer/src')
-rw-r--r--compiler/rustc_infer/src/errors.rs2
-rw-r--r--compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_infer/src/errors.rs b/compiler/rustc_infer/src/errors.rs
index 7bd418ddf5f..51993f37bb3 100644
--- a/compiler/rustc_infer/src/errors.rs
+++ b/compiler/rustc_infer/src/errors.rs
@@ -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>,
 }
diff --git a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
index da0035d2519..daf64aeb053 100644
--- a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
+++ b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs
@@ -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)
     }