Skip to content

Commit b24330f

Browse files
committed
Auto merge of rust-lang#53705 - ms2300:tmp, r=oli-obk
rust-lang#53576 Renaming TyAnon -> TyOpaque Fixes rust-lang#53576
2 parents 05cb29e + f4d4faa commit b24330f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+228
-224
lines changed

src/librustc/ich/impls_ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ for ty::TyKind<'gcx>
878878
Projection(ref projection_ty) => {
879879
projection_ty.hash_stable(hcx, hasher);
880880
}
881-
Anon(def_id, substs) => {
881+
Opaque(def_id, substs) => {
882882
def_id.hash_stable(hcx, hasher);
883883
substs.hash_stable(hcx, hasher);
884884
}

src/librustc/infer/canonical/canonicalizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Canonicalizer<'cx, 'gcx, 'tcx>
285285
| ty::Projection(..)
286286
| ty::Foreign(..)
287287
| ty::Param(..)
288-
| ty::Anon(..) => {
288+
| ty::Opaque(..) => {
289289
if t.flags.intersects(self.needs_canonical_flags) {
290290
t.super_fold_with(self)
291291
} else {

src/librustc/infer/freshen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for TypeFreshener<'a, 'gcx, 'tcx> {
197197
ty::Param(..) |
198198
ty::Closure(..) |
199199
ty::GeneratorWitness(..) |
200-
ty::Anon(..) => {
200+
ty::Opaque(..) => {
201201
t.super_fold_with(self)
202202
}
203203
}

src/librustc/infer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ use self::outlives::env::OutlivesEnvironment;
4848
use self::type_variable::TypeVariableOrigin;
4949
use self::unify_key::ToType;
5050

51-
pub mod anon_types;
51+
pub mod opaque_types;
5252
pub mod at;
5353
pub mod canonical;
5454
mod combine;

src/librustc/infer/anon_types/mod.rs renamed to src/librustc/infer/opaque_types/mod.rs

Lines changed: 87 additions & 84 deletions
Large diffs are not rendered by default.

src/librustc/traits/coherence.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ fn ty_is_local_constructor(ty: Ty, in_crate: InCrate) -> bool {
483483
ty::Closure(..) |
484484
ty::Generator(..) |
485485
ty::GeneratorWitness(..) |
486-
ty::Anon(..) => {
486+
ty::Opaque(..) => {
487487
bug!("ty_is_local invoked on unexpected type: {:?}", ty)
488488
}
489489
}

src/librustc/traits/error_reporting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
258258
ty::Tuple(..) => Some(10),
259259
ty::Projection(..) => Some(11),
260260
ty::Param(..) => Some(12),
261-
ty::Anon(..) => Some(13),
261+
ty::Opaque(..) => Some(13),
262262
ty::Never => Some(14),
263263
ty::Adt(adt, ..) => match adt.adt_kind() {
264264
AdtKind::Struct => Some(15),

src/librustc/traits/project.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ impl<'a, 'b, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for AssociatedTypeNormalizer<'a,
366366

367367
let ty = ty.super_fold_with(self);
368368
match ty.sty {
369-
ty::Anon(def_id, substs) if !substs.has_escaping_regions() => { // (*)
369+
ty::Opaque(def_id, substs) if !substs.has_escaping_regions() => { // (*)
370370
// Only normalize `impl Trait` after type-checking, usually in codegen.
371371
match self.param_env.reveal {
372372
Reveal::UserFacing => ty,
@@ -986,7 +986,7 @@ fn assemble_candidates_from_trait_def<'cx, 'gcx, 'tcx>(
986986
ty::Projection(ref data) => {
987987
(data.trait_ref(tcx).def_id, data.substs)
988988
}
989-
ty::Anon(def_id, substs) => (def_id, substs),
989+
ty::Opaque(def_id, substs) => (def_id, substs),
990990
ty::Infer(ty::TyVar(_)) => {
991991
// If the self-type is an inference variable, then it MAY wind up
992992
// being a projected type, so induce an ambiguity.
@@ -1518,7 +1518,7 @@ fn confirm_impl_candidate<'cx, 'gcx, 'tcx>(
15181518
let substs = translate_substs(selcx.infcx(), param_env, impl_def_id, substs, assoc_ty.node);
15191519
let ty = if let ty::AssociatedKind::Existential = assoc_ty.item.kind {
15201520
let item_substs = Substs::identity_for_item(tcx, assoc_ty.item.def_id);
1521-
tcx.mk_anon(assoc_ty.item.def_id, item_substs)
1521+
tcx.mk_opaque(assoc_ty.item.def_id, item_substs)
15221522
} else {
15231523
tcx.type_of(assoc_ty.item.def_id)
15241524
};

src/librustc/traits/query/dropck_outlives.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ pub fn trivial_dropck_outlives<'tcx>(tcx: TyCtxt<'_, '_, 'tcx>, ty: Ty<'tcx>) ->
258258
ty::Dynamic(..)
259259
| ty::Projection(..)
260260
| ty::Param(_)
261-
| ty::Anon(..)
261+
| ty::Opaque(..)
262262
| ty::Infer(_)
263263
| ty::Generator(..) => false,
264264
}

src/librustc/traits/query/normalize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for QueryNormalizer<'cx, 'gcx, 'tcx
9999
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
100100
let ty = ty.super_fold_with(self);
101101
match ty.sty {
102-
ty::Anon(def_id, substs) if !substs.has_escaping_regions() => {
102+
ty::Opaque(def_id, substs) if !substs.has_escaping_regions() => {
103103
// (*)
104104
// Only normalize `impl Trait` after type-checking, usually in codegen.
105105
match self.param_env.reveal {

0 commit comments

Comments
 (0)