Skip to content

Commit

Permalink
Rename OpaqueTyOrigin variants
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Aug 2, 2019
1 parent b4fe555 commit 16033d1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/librustc/hir/lowering.rs
Expand Up @@ -1763,7 +1763,7 @@ impl<'a> LoweringContext<'a> {
},
bounds: hir_bounds,
impl_trait_fn: fn_def_id,
origin: hir::OpaqueTyOrigin::ReturnImplTrait,
origin: hir::OpaqueTyOrigin::FnReturn,
};

trace!("exist ty from impl trait def-index: {:#?}", opaque_ty_def_index);
Expand Down Expand Up @@ -3451,7 +3451,7 @@ impl<'a> LoweringContext<'a> {
bounds: self.lower_param_bounds(b,
ImplTraitContext::OpaqueTy(None)),
impl_trait_fn: None,
origin: hir::OpaqueTyOrigin::TraitAliasImplTrait,
origin: hir::OpaqueTyOrigin::TypeAlias,
},
),
ItemKind::Enum(ref enum_definition, ref generics) => {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/hir/mod.rs
Expand Up @@ -1933,9 +1933,9 @@ pub struct OpaqueTy {
#[derive(Copy, Clone, RustcEncodable, RustcDecodable, Debug, HashStable)]
pub enum OpaqueTyOrigin {
/// `type Foo = impl Trait;`
TraitAliasImplTrait,
TypeAlias,
/// `-> impl Trait`
ReturnImplTrait,
FnReturn,
/// `async fn`
AsyncFn,
}
Expand Down
10 changes: 5 additions & 5 deletions src/librustc/infer/opaque_types/mod.rs
Expand Up @@ -495,8 +495,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
hir::OpaqueTyOrigin::AsyncFn => return false,

// Otherwise, generate the label we'll use in the error message.
hir::OpaqueTyOrigin::TraitAliasImplTrait => "impl Trait",
hir::OpaqueTyOrigin::ReturnImplTrait => "impl Trait",
hir::OpaqueTyOrigin::TypeAlias => "impl Trait",
hir::OpaqueTyOrigin::FnReturn => "impl Trait",
};
let msg = format!("ambiguous lifetime bound in `{}`", context_name);
let mut err = self.tcx.sess.struct_span_err(span, &msg);
Expand Down Expand Up @@ -1052,7 +1052,7 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
origin,
),
_ => {
(def_scope_default(), hir::OpaqueTyOrigin::TraitAliasImplTrait)
(def_scope_default(), hir::OpaqueTyOrigin::TypeAlias)
}
},
Some(Node::ImplItem(item)) => match item.node {
Expand All @@ -1062,10 +1062,10 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
self.parent_def_id,
opaque_hir_id,
),
hir::OpaqueTyOrigin::TraitAliasImplTrait,
hir::OpaqueTyOrigin::TypeAlias,
),
_ => {
(def_scope_default(), hir::OpaqueTyOrigin::TraitAliasImplTrait)
(def_scope_default(), hir::OpaqueTyOrigin::TypeAlias)
}
},
_ => bug!(
Expand Down

0 comments on commit 16033d1

Please sign in to comment.