From 3ba1e19a87ca1be091df894ca288e679b8159d2f Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Mon, 24 Jun 2019 15:21:25 -0400 Subject: [PATCH] opaque_types: more nits --- src/librustc/infer/opaque_types/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/librustc/infer/opaque_types/mod.rs b/src/librustc/infer/opaque_types/mod.rs index b1ede2ae2cd4..55eb29638751 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`: //