Skip to content

Commit 3ba1e19

Browse files
committed
opaque_types: more nits
1 parent 0c8ebea commit 3ba1e19

File tree

1 file changed

+6
-6
lines changed
  • src/librustc/infer/opaque_types

1 file changed

+6
-6
lines changed

src/librustc/infer/opaque_types/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,14 +488,14 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
488488

489489
let span = self.tcx.def_span(opaque_type_def_id);
490490

491-
// Otherwise, we allow for async-await but not otherwise.
491+
// Without a feature-gate, we only generate member-constraints for async-await.
492492
let context_name = match opaque_defn.origin {
493+
// No feature-gate required for `async fn`.
494+
hir::ExistTyOrigin::AsyncFn => return false,
495+
496+
// Otherwise, generate the label we'll use in the error message.
493497
hir::ExistTyOrigin::ExistentialType => "existential type",
494498
hir::ExistTyOrigin::ReturnImplTrait => "impl Trait",
495-
hir::ExistTyOrigin::AsyncFn => {
496-
// we permit
497-
return false;
498-
}
499499
};
500500
let msg = format!("ambiguous lifetime bound in `{}`", context_name);
501501
let mut err = self.tcx.sess.struct_span_err(span, &msg);
@@ -624,7 +624,7 @@ pub fn unexpected_hidden_region_diagnostic(
624624
);
625625
} else {
626626
// Ugh. This is a painful case: the hidden region is not one
627-
// that we can easily summarize or explain. This can happens
627+
// that we can easily summarize or explain. This can happen
628628
// in a case like
629629
// `src/test/ui/multiple-lifetimes/ordinary-bounds-unsuited.rs`:
630630
//

0 commit comments

Comments
 (0)