Skip to content

Commit 75de33c

Browse files
authored
Rollup merge of #110531 - lcnr:type-system-stuff, r=aliemjay
small type system cleanup
2 parents 9a13f4f + 16d061e commit 75de33c

File tree

2 files changed

+15
-24
lines changed
  • compiler

2 files changed

+15
-24
lines changed

compiler/rustc_middle/src/ty/flags.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ impl FlagComputation {
178178

179179
&ty::Alias(ty::Projection, data) => {
180180
self.add_flags(TypeFlags::HAS_TY_PROJECTION);
181-
self.add_projection_ty(data);
181+
self.add_alias_ty(data);
182182
}
183183

184184
&ty::Alias(ty::Opaque, ty::AliasTy { substs, .. }) => {
@@ -267,7 +267,7 @@ impl FlagComputation {
267267
projection_ty,
268268
term,
269269
})) => {
270-
self.add_projection_ty(projection_ty);
270+
self.add_alias_ty(projection_ty);
271271
self.add_term(term);
272272
}
273273
ty::PredicateKind::WellFormed(arg) => {
@@ -372,8 +372,8 @@ impl FlagComputation {
372372
}
373373
}
374374

375-
fn add_projection_ty(&mut self, projection_ty: ty::AliasTy<'_>) {
376-
self.add_substs(projection_ty.substs);
375+
fn add_alias_ty(&mut self, alias_ty: ty::AliasTy<'_>) {
376+
self.add_substs(alias_ty.substs);
377377
}
378378

379379
fn add_substs(&mut self, substs: &[GenericArg<'_>]) {

compiler/rustc_trait_selection/src/traits/wf.rs

+11-20
Original file line numberDiff line numberDiff line change
@@ -170,29 +170,20 @@ pub fn predicate_obligations<'tcx>(
170170
ty::PredicateKind::WellFormed(arg) => {
171171
wf.compute(arg);
172172
}
173-
ty::PredicateKind::ObjectSafe(_) => {}
174-
ty::PredicateKind::ClosureKind(..) => {}
175-
ty::PredicateKind::Subtype(ty::SubtypePredicate { a, b, a_is_expected: _ }) => {
176-
wf.compute(a.into());
177-
wf.compute(b.into());
178-
}
179-
ty::PredicateKind::Coerce(ty::CoercePredicate { a, b }) => {
180-
wf.compute(a.into());
181-
wf.compute(b.into());
182-
}
173+
183174
ty::PredicateKind::ConstEvaluatable(ct) => {
184175
wf.compute(ct.into());
185176
}
186-
ty::PredicateKind::ConstEquate(c1, c2) => {
187-
wf.compute(c1.into());
188-
wf.compute(c2.into());
189-
}
190-
ty::PredicateKind::Ambiguous => {}
191-
ty::PredicateKind::TypeWellFormedFromEnv(..) => {
192-
bug!("TypeWellFormedFromEnv is only used for Chalk")
193-
}
194-
ty::PredicateKind::AliasRelate(..) => {
195-
bug!("We should only wf check where clauses and `AliasRelate` is not a `Clause`")
177+
178+
ty::PredicateKind::ObjectSafe(_)
179+
| ty::PredicateKind::ClosureKind(..)
180+
| ty::PredicateKind::Subtype(..)
181+
| ty::PredicateKind::Coerce(..)
182+
| ty::PredicateKind::ConstEquate(..)
183+
| ty::PredicateKind::Ambiguous
184+
| ty::PredicateKind::AliasRelate(..)
185+
| ty::PredicateKind::TypeWellFormedFromEnv(..) => {
186+
bug!("We should only wf check where clauses, unexpected predicate: {predicate:?}")
196187
}
197188
}
198189

0 commit comments

Comments
 (0)