about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Mansi <markm@cs.wisc.edu>2019-11-24 18:47:15 -0600
committerMark Mansi <markm@cs.wisc.edu>2019-11-29 11:07:06 -0600
commit59a768ce14ca8b439107dce0b575ee1c36244758 (patch)
tree326f5073055703d5e73eadb69e49dbda1df7c5b2
parent1f853d25b8465e61209035393eebb765968e6173 (diff)
downloadrust-59a768ce14ca8b439107dce0b575ee1c36244758.tar.gz
rust-59a768ce14ca8b439107dce0b575ee1c36244758.zip
rename to AnonRegionFromAsyncFn
-rw-r--r--src/librustc_mir/borrow_check/nll/region_infer/error_reporting/outlives_suggestion.rs2
-rw-r--r--src/librustc_mir/borrow_check/nll/region_infer/error_reporting/region_name.rs17
2 files changed, 9 insertions, 10 deletions
diff --git a/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/outlives_suggestion.rs b/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/outlives_suggestion.rs
index 907119dd203..938059c2a92 100644
--- a/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/outlives_suggestion.rs
+++ b/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/outlives_suggestion.rs
@@ -89,7 +89,7 @@ impl OutlivesSuggestionBuilder<'a> {
             | RegionNameSource::AnonRegionFromUpvar(..)
             | RegionNameSource::AnonRegionFromOutput(..)
             | RegionNameSource::AnonRegionFromYieldTy(..)
-            | RegionNameSource::AnonRegionFromTraitObjAsync(..) => {
+            | RegionNameSource::AnonRegionFromAsyncFn(..) => {
                 debug!("Region {:?} is NOT suggestable", name);
                 false
             }
diff --git a/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/region_name.rs b/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/region_name.rs
index 519991e815b..46c87db7af1 100644
--- a/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/region_name.rs
+++ b/src/librustc_mir/borrow_check/nll/region_infer/error_reporting/region_name.rs
@@ -57,8 +57,8 @@ crate enum RegionNameSource {
     AnonRegionFromOutput(Span, String, String),
     /// The region from a type yielded by a generator.
     AnonRegionFromYieldTy(Span, String),
-    /// An anonymous region from a trait object in an async fn.
-    AnonRegionFromTraitObjAsync(Span),
+    /// An anonymous region from an async fn.
+    AnonRegionFromAsyncFn(Span),
 }
 
 /// Records region names that have been assigned before so that we can use the same ones in later
@@ -117,7 +117,7 @@ impl RegionName {
             RegionNameSource::AnonRegionFromUpvar(..) |
             RegionNameSource::AnonRegionFromOutput(..) |
             RegionNameSource::AnonRegionFromYieldTy(..) |
-            RegionNameSource::AnonRegionFromTraitObjAsync(..) => false,
+            RegionNameSource::AnonRegionFromAsyncFn(..) => false,
         }
     }
 
@@ -142,7 +142,7 @@ impl RegionName {
                 diag.span_label(*span, format!("has type `{}`", type_name));
             }
             RegionNameSource::MatchedHirTy(span) |
-            RegionNameSource::AnonRegionFromTraitObjAsync(span) => {
+            RegionNameSource::AnonRegionFromAsyncFn(span) => {
                 diag.span_label(
                     *span,
                     format!("let's call the lifetime of this reference `{}`", self),
@@ -306,14 +306,13 @@ impl<'tcx> RegionInferenceContext<'tcx> {
                     } else {
                         // If we spuriously thought that the region is named, we should let the
                         // system generate a true name for error messages. Currently this can
-                        // happen if we have an elided name in a trait object used in an async fn
-                        // for example: the compiler will generate a region named `'_`, but
-                        // reporting such a name is not actually useful, so we synthesize a name
-                        // for it instead.
+                        // happen if we have an elided name in an async fn for example: the
+                        // compiler will generate a region named `'_`, but reporting such a name is
+                        // not actually useful, so we synthesize a name for it instead.
                         let name = self.synthesize_region_name(renctx);
                         Some(RegionName {
                             name,
-                            source: RegionNameSource::AnonRegionFromTraitObjAsync(span),
+                            source: RegionNameSource::AnonRegionFromAsyncFn(span),
                         })
                     }
                 }