Skip to content

Commit

Permalink
opaque_types: more nits
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Jul 2, 2019
1 parent 0c8ebea commit 3ba1e19
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/librustc/infer/opaque_types/mod.rs
Expand Up @@ -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);
Expand Down Expand Up @@ -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`:
//
Expand Down

0 comments on commit 3ba1e19

Please sign in to comment.