about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2019-06-24 15:21:25 -0400
committerNiko Matsakis <niko@alum.mit.edu>2019-07-02 12:25:23 -0400
commit3ba1e19a87ca1be091df894ca288e679b8159d2f (patch)
tree9674683fa763a37264495802d2d6a9c8296a956f
parent0c8ebea227306704b98aaee362c89ae951cab89b (diff)
downloadrust-3ba1e19a87ca1be091df894ca288e679b8159d2f.tar.gz
rust-3ba1e19a87ca1be091df894ca288e679b8159d2f.zip
opaque_types: more nits
-rw-r--r--src/librustc/infer/opaque_types/mod.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc/infer/opaque_types/mod.rs b/src/librustc/infer/opaque_types/mod.rs
index b1ede2ae2cd..55eb2963875 100644
--- a/src/librustc/infer/opaque_types/mod.rs
+++ b/src/librustc/infer/opaque_types/mod.rs
@@ -488,14 +488,14 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
 
         let span = self.tcx.def_span(opaque_type_def_id);
 
-        // Otherwise, we allow for async-await but not otherwise.
+        // Without a feature-gate, we only generate member-constraints for async-await.
         let context_name = match opaque_defn.origin {
+            // No feature-gate required for `async fn`.
+            hir::ExistTyOrigin::AsyncFn => return false,
+
+            // Otherwise, generate the label we'll use in the error message.
             hir::ExistTyOrigin::ExistentialType => "existential type",
             hir::ExistTyOrigin::ReturnImplTrait => "impl Trait",
-            hir::ExistTyOrigin::AsyncFn => {
-                // we permit
-                return false;
-            }
         };
         let msg = format!("ambiguous lifetime bound in `{}`", context_name);
         let mut err = self.tcx.sess.struct_span_err(span, &msg);
@@ -624,7 +624,7 @@ pub fn unexpected_hidden_region_diagnostic(
         );
     } else {
         // Ugh. This is a painful case: the hidden region is not one
-        // that we can easily summarize or explain. This can happens
+        // that we can easily summarize or explain. This can happen
         // in a case like
         // `src/test/ui/multiple-lifetimes/ordinary-bounds-unsuited.rs`:
         //