1
Fork 0

Rollup merge of #110531 - lcnr:type-system-stuff, r=aliemjay

small type system cleanup
This commit is contained in:
Matthias Krüger 2023-04-19 17:54:42 +02:00 committed by GitHub
commit 75de33cd1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 24 deletions

View file

@ -170,29 +170,20 @@ pub fn predicate_obligations<'tcx>(
ty::PredicateKind::WellFormed(arg) => {
wf.compute(arg);
}
ty::PredicateKind::ObjectSafe(_) => {}
ty::PredicateKind::ClosureKind(..) => {}
ty::PredicateKind::Subtype(ty::SubtypePredicate { a, b, a_is_expected: _ }) => {
wf.compute(a.into());
wf.compute(b.into());
}
ty::PredicateKind::Coerce(ty::CoercePredicate { a, b }) => {
wf.compute(a.into());
wf.compute(b.into());
}
ty::PredicateKind::ConstEvaluatable(ct) => {
wf.compute(ct.into());
}
ty::PredicateKind::ConstEquate(c1, c2) => {
wf.compute(c1.into());
wf.compute(c2.into());
}
ty::PredicateKind::Ambiguous => {}
ty::PredicateKind::TypeWellFormedFromEnv(..) => {
bug!("TypeWellFormedFromEnv is only used for Chalk")
}
ty::PredicateKind::AliasRelate(..) => {
bug!("We should only wf check where clauses and `AliasRelate` is not a `Clause`")
ty::PredicateKind::ObjectSafe(_)
| ty::PredicateKind::ClosureKind(..)
| ty::PredicateKind::Subtype(..)
| ty::PredicateKind::Coerce(..)
| ty::PredicateKind::ConstEquate(..)
| ty::PredicateKind::Ambiguous
| ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::TypeWellFormedFromEnv(..) => {
bug!("We should only wf check where clauses, unexpected predicate: {predicate:?}")
}
}