Skip to content

Commit 286a502

Browse files
committed
Prepare for layout use only params
1 parent be529e9 commit 286a502

File tree

29 files changed

+56
-37
lines changed

29 files changed

+56
-37
lines changed

src/librustc/ich/impls_ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ for ty::TypeVariants<'gcx>
834834
TyStr |
835835
TyError |
836836
TyNever |
837-
TyUnusedParam => {
837+
TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => {
838838
// Nothing more to hash.
839839
}
840840
TyInt(int_ty) => {

src/librustc/infer/canonical.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,8 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Canonicalizer<'cx, 'gcx, 'tcx>
635635
| ty::TyForeign(..)
636636
| ty::TyParam(..)
637637
| ty::TyAnon(..)
638-
| ty::TyUnusedParam => {
638+
| ty::TyUnusedParam
639+
| ty::TyLayoutOnlyParam(..) => {
639640
if t.flags.intersects(self.needs_canonical_flags) {
640641
t.super_fold_with(self)
641642
} else {

src/librustc/infer/freshen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for TypeFreshener<'a, 'gcx, 'tcx> {
200200
ty::TyAnon(..) => {
201201
t.super_fold_with(self)
202202
}
203-
ty::TyUnusedParam => bug!("Unexpected TyUnusedParam in TypeFreshener"),
203+
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => bug!("Unexpected TyUnusedParam in TypeFreshener"),
204204
}
205205
}
206206
}

src/librustc/traits/coherence.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ fn ty_is_local_constructor(ty: Ty, in_crate: InCrate) -> bool {
481481
ty::TyGenerator(..) |
482482
ty::TyGeneratorWitness(..) |
483483
ty::TyAnon(..) |
484-
ty::TyUnusedParam => {
484+
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => {
485485
bug!("ty_is_local invoked on unexpected type: {:?}", ty)
486486
}
487487
}

src/librustc/traits/error_reporting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
264264
ty::TyForeign(..) => Some(19),
265265
ty::TyGeneratorWitness(..) => Some(20),
266266
ty::TyInfer(..) | ty::TyError => None,
267-
ty::TyUnusedParam => bug!("unexpected TyUnusedParam in fuzzy_match_tys"),
267+
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => bug!("unexpected TyUnusedParam in fuzzy_match_tys"),
268268
}
269269
}
270270

src/librustc/traits/query/dropck_outlives.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ fn trivial_dropck_outlives<'cx, 'tcx>(tcx: TyCtxt<'cx, '_, 'tcx>, ty: Ty<'tcx>)
262262
| ty::TyInfer(_)
263263
| ty::TyGenerator(..) => false,
264264

265-
ty::TyUnusedParam => bug!("Unexpected TyUnusedParam in trivial_dropck_outlives"),
265+
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => {
266+
bug!("Unexpected {:?} in trivial_dropck_outlives", ty)
267+
}
266268
}
267269
}

src/librustc/traits/select.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
20372037
))
20382038
}
20392039

2040-
ty::TyProjection(_) | ty::TyParam(_) | ty::TyUnusedParam | ty::TyAnon(..) => None,
2040+
ty::TyProjection(_) | ty::TyParam(_) | ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) | ty::TyAnon(..) => None,
20412041
ty::TyInfer(ty::TyVar(_)) => Ambiguous,
20422042

20432043
ty::TyInfer(ty::CanonicalTy(_)) |
@@ -2114,7 +2114,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
21142114
bug!("asked to assemble builtin bounds of unexpected type: {:?}",
21152115
self_ty);
21162116
}
2117-
ty::TyUnusedParam => bug!("Unexpected TyUnusedParam in copy_clone_conditions"),
2117+
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => bug!("Unexpected TyUnusedParam in copy_clone_conditions"),
21182118
}
21192119
}
21202120

@@ -2152,6 +2152,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
21522152
ty::TyProjection(..) |
21532153
ty::TyInfer(ty::CanonicalTy(_)) |
21542154
ty::TyUnusedParam |
2155+
ty::TyLayoutOnlyParam(_, _) |
21552156
ty::TyInfer(ty::TyVar(_)) |
21562157
ty::TyInfer(ty::FreshTy(_)) |
21572158
ty::TyInfer(ty::FreshIntTy(_)) |

src/librustc/ty/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
18291829
self,
18301830
TyAdt, TyArray, TySlice, TyRawPtr, TyRef, TyFnDef, TyFnPtr,
18311831
TyGenerator, TyGeneratorWitness, TyDynamic, TyClosure, TyTuple,
1832-
TyParam, TyInfer, TyProjection, TyAnon, TyForeign);
1832+
TyParam, TyLayoutOnlyParam, TyInfer, TyProjection, TyAnon, TyForeign);
18331833

18341834
println!("Substs interner: #{}", self.interners.substs.borrow().len());
18351835
println!("Region interner: #{}", self.interners.region.borrow().len());

src/librustc/ty/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl<'a, 'gcx, 'lcx, 'tcx> ty::TyS<'tcx> {
232232
"type parameter".to_string()
233233
}
234234
}
235-
ty::TyUnusedParam => "unused type parameter".to_string(),
235+
ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => "unused type parameter".to_string(),
236236
ty::TyAnon(..) => "anonymized type".to_string(),
237237
ty::TyError => "type error".to_string(),
238238
}

src/librustc/ty/fast_reject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub fn simplify_type<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
121121
ty::TyForeign(def_id) => {
122122
Some(ForeignSimplifiedType(def_id))
123123
}
124-
ty::TyInfer(_) | ty::TyError | ty::TyUnusedParam => None,
124+
ty::TyInfer(_) | ty::TyError | ty::TyUnusedParam | ty::TyLayoutOnlyParam(_, _) => None,
125125
}
126126
}
127127

0 commit comments

Comments
 (0)