Skip to content

Commit 16033d1

Browse files
committed
Rename OpaqueTyOrigin variants
1 parent b4fe555 commit 16033d1

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Diff for: src/librustc/hir/lowering.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@ impl<'a> LoweringContext<'a> {
17631763
},
17641764
bounds: hir_bounds,
17651765
impl_trait_fn: fn_def_id,
1766-
origin: hir::OpaqueTyOrigin::ReturnImplTrait,
1766+
origin: hir::OpaqueTyOrigin::FnReturn,
17671767
};
17681768

17691769
trace!("exist ty from impl trait def-index: {:#?}", opaque_ty_def_index);
@@ -3451,7 +3451,7 @@ impl<'a> LoweringContext<'a> {
34513451
bounds: self.lower_param_bounds(b,
34523452
ImplTraitContext::OpaqueTy(None)),
34533453
impl_trait_fn: None,
3454-
origin: hir::OpaqueTyOrigin::TraitAliasImplTrait,
3454+
origin: hir::OpaqueTyOrigin::TypeAlias,
34553455
},
34563456
),
34573457
ItemKind::Enum(ref enum_definition, ref generics) => {

Diff for: src/librustc/hir/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1933,9 +1933,9 @@ pub struct OpaqueTy {
19331933
#[derive(Copy, Clone, RustcEncodable, RustcDecodable, Debug, HashStable)]
19341934
pub enum OpaqueTyOrigin {
19351935
/// `type Foo = impl Trait;`
1936-
TraitAliasImplTrait,
1936+
TypeAlias,
19371937
/// `-> impl Trait`
1938-
ReturnImplTrait,
1938+
FnReturn,
19391939
/// `async fn`
19401940
AsyncFn,
19411941
}

Diff for: src/librustc/infer/opaque_types/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
495495
hir::OpaqueTyOrigin::AsyncFn => return false,
496496

497497
// Otherwise, generate the label we'll use in the error message.
498-
hir::OpaqueTyOrigin::TraitAliasImplTrait => "impl Trait",
499-
hir::OpaqueTyOrigin::ReturnImplTrait => "impl Trait",
498+
hir::OpaqueTyOrigin::TypeAlias => "impl Trait",
499+
hir::OpaqueTyOrigin::FnReturn => "impl Trait",
500500
};
501501
let msg = format!("ambiguous lifetime bound in `{}`", context_name);
502502
let mut err = self.tcx.sess.struct_span_err(span, &msg);
@@ -1052,7 +1052,7 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
10521052
origin,
10531053
),
10541054
_ => {
1055-
(def_scope_default(), hir::OpaqueTyOrigin::TraitAliasImplTrait)
1055+
(def_scope_default(), hir::OpaqueTyOrigin::TypeAlias)
10561056
}
10571057
},
10581058
Some(Node::ImplItem(item)) => match item.node {
@@ -1062,10 +1062,10 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
10621062
self.parent_def_id,
10631063
opaque_hir_id,
10641064
),
1065-
hir::OpaqueTyOrigin::TraitAliasImplTrait,
1065+
hir::OpaqueTyOrigin::TypeAlias,
10661066
),
10671067
_ => {
1068-
(def_scope_default(), hir::OpaqueTyOrigin::TraitAliasImplTrait)
1068+
(def_scope_default(), hir::OpaqueTyOrigin::TypeAlias)
10691069
}
10701070
},
10711071
_ => bug!(

0 commit comments

Comments
 (0)