1use std::fmt;
2
3use derive_where::derive_where;
4#[cfg(feature = "nightly")]
5use rustc_macros::{Decodable_NoContext, Encodable_NoContext, StableHash_NoContext};
6use rustc_type_ir_macros::{GenericTypeVisitable, TypeFoldable_Generic, TypeVisitable_Generic};
7
8use crate::{self as ty, Const, Interner, Region};
9
10#[automatically_derived]
impl<I: Interner> ::core::clone::Clone for ClauseKind<I> where I: Interner {
#[inline]
fn clone(&self) -> Self { *self }
}
#[automatically_derived]
impl<I: Interner> ::core::marker::Copy for ClauseKind<I> where I: Interner { }
#[automatically_derived]
impl<I: Interner> ::core::hash::Hash for ClauseKind<I> where I: Interner {
fn hash<__H: ::core::hash::Hasher>(&self, __state: &mut __H) {
match self {
ClauseKind::Trait(ref __field_0) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
}
ClauseKind::RegionOutlives(ref __field_0) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
}
ClauseKind::TypeOutlives(ref __field_0) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
}
ClauseKind::Projection(ref __field_0) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
}
ClauseKind::ConstArgHasType(ref __field_0, ref __field_1) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
::core::hash::Hash::hash(__field_1, __state);
}
ClauseKind::WellFormed(ref __field_0) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
}
ClauseKind::ConstEvaluatable(ref __field_0) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
}
ClauseKind::HostEffect(ref __field_0) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
}
ClauseKind::UnstableFeature(ref __field_0) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
}
ClauseKind::CompressedTrait(ref __field_0) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
}
}
}
}
#[automatically_derived]
impl<I: Interner> ::core::cmp::PartialEq for ClauseKind<I> where I: Interner {
#[inline]
fn eq(&self, __other: &Self) -> ::core::primitive::bool {
if ::core::mem::discriminant(self) ==
::core::mem::discriminant(__other) {
match (self, __other) {
(ClauseKind::Trait(ref __field_0),
ClauseKind::Trait(ref __other_field_0)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0),
(ClauseKind::RegionOutlives(ref __field_0),
ClauseKind::RegionOutlives(ref __other_field_0)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0),
(ClauseKind::TypeOutlives(ref __field_0),
ClauseKind::TypeOutlives(ref __other_field_0)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0),
(ClauseKind::Projection(ref __field_0),
ClauseKind::Projection(ref __other_field_0)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0),
(ClauseKind::ConstArgHasType(ref __field_0, ref __field_1),
ClauseKind::ConstArgHasType(ref __other_field_0,
ref __other_field_1)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0) &&
::core::cmp::PartialEq::eq(__field_1, __other_field_1),
(ClauseKind::WellFormed(ref __field_0),
ClauseKind::WellFormed(ref __other_field_0)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0),
(ClauseKind::ConstEvaluatable(ref __field_0),
ClauseKind::ConstEvaluatable(ref __other_field_0)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0),
(ClauseKind::HostEffect(ref __field_0),
ClauseKind::HostEffect(ref __other_field_0)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0),
(ClauseKind::UnstableFeature(ref __field_0),
ClauseKind::UnstableFeature(ref __other_field_0)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0),
(ClauseKind::CompressedTrait(ref __field_0),
ClauseKind::CompressedTrait(ref __other_field_0)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0),
_ => unsafe { ::core::hint::unreachable_unchecked() },
}
} else { false }
}
}#[derive_where(Clone, Copy, Hash, PartialEq; I: Interner)]
13#[derive(const _: () =
{
impl<I: Interner> ::rustc_type_ir::TypeVisitable<I> for ClauseKind<I>
where I: Interner,
ty::TraitClause<I>: ::rustc_type_ir::TypeVisitable<I>,
ty::OutlivesClause<I,
Region<I>>: ::rustc_type_ir::TypeVisitable<I>,
ty::OutlivesClause<I, I::Ty>: ::rustc_type_ir::TypeVisitable<I>,
ty::ProjectionClause<I>: ::rustc_type_ir::TypeVisitable<I>,
Const<I>: ::rustc_type_ir::TypeVisitable<I>,
I::Ty: ::rustc_type_ir::TypeVisitable<I>,
I::Term: ::rustc_type_ir::TypeVisitable<I>,
ty::HostEffectClause<I>: ::rustc_type_ir::TypeVisitable<I>,
ty::CompressedTraitClause<I>: ::rustc_type_ir::TypeVisitable<I> {
fn visit_with<__V: ::rustc_type_ir::TypeVisitor<I>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
ClauseKind::Trait(ref __binding_0) => {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
ClauseKind::RegionOutlives(ref __binding_0) => {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
ClauseKind::TypeOutlives(ref __binding_0) => {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
ClauseKind::Projection(ref __binding_0) => {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
ClauseKind::ConstArgHasType(ref __binding_0,
ref __binding_1) => {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
ClauseKind::WellFormed(ref __binding_0) => {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
ClauseKind::ConstEvaluatable(ref __binding_0) => {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
ClauseKind::HostEffect(ref __binding_0) => {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
ClauseKind::UnstableFeature(..) => {}
ClauseKind::CompressedTrait(ref __binding_0) => {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_type_ir::VisitorResult>::output()
}
}
};TypeVisitable_Generic, const _: () =
{
unsafe impl<I: Interner, __V>
::rustc_type_ir::GenericTypeVisitable<__V> for ClauseKind<I> where
ty::TraitClause<I>: ::rustc_type_ir::GenericTypeVisitable<__V>,
ty::OutlivesClause<I,
Region<I>>: ::rustc_type_ir::GenericTypeVisitable<__V>,
ty::OutlivesClause<I,
I::Ty>: ::rustc_type_ir::GenericTypeVisitable<__V>,
ty::ProjectionClause<I>: ::rustc_type_ir::GenericTypeVisitable<__V>,
Const<I>: ::rustc_type_ir::GenericTypeVisitable<__V>,
I::Ty: ::rustc_type_ir::GenericTypeVisitable<__V>,
I::Term: ::rustc_type_ir::GenericTypeVisitable<__V>,
Const<I>: ::rustc_type_ir::GenericTypeVisitable<__V>,
ty::HostEffectClause<I>: ::rustc_type_ir::GenericTypeVisitable<__V>,
I::Symbol: ::rustc_type_ir::GenericTypeVisitable<__V>,
ty::CompressedTraitClause<I>: ::rustc_type_ir::GenericTypeVisitable<__V>
{
fn generic_visit_with(&self, __visitor: &mut __V) {
match *self {
ClauseKind::Trait(ref __binding_0) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
}
ClauseKind::RegionOutlives(ref __binding_0) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
}
ClauseKind::TypeOutlives(ref __binding_0) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
}
ClauseKind::Projection(ref __binding_0) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
}
ClauseKind::ConstArgHasType(ref __binding_0,
ref __binding_1) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_1,
__visitor);
}
}
ClauseKind::WellFormed(ref __binding_0) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
}
ClauseKind::ConstEvaluatable(ref __binding_0) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
}
ClauseKind::HostEffect(ref __binding_0) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
}
ClauseKind::UnstableFeature(ref __binding_0) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
}
ClauseKind::CompressedTrait(ref __binding_0) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
}
}
}
}
};GenericTypeVisitable, const _: () =
{
impl<I: Interner> ::rustc_type_ir::TypeFoldable<I> for ClauseKind<I>
where I: Interner,
ty::TraitClause<I>: ::rustc_type_ir::TypeFoldable<I>,
ty::OutlivesClause<I,
Region<I>>: ::rustc_type_ir::TypeFoldable<I>,
ty::OutlivesClause<I, I::Ty>: ::rustc_type_ir::TypeFoldable<I>,
ty::ProjectionClause<I>: ::rustc_type_ir::TypeFoldable<I>,
Const<I>: ::rustc_type_ir::TypeFoldable<I>,
I::Ty: ::rustc_type_ir::TypeFoldable<I>,
I::Term: ::rustc_type_ir::TypeFoldable<I>,
ty::HostEffectClause<I>: ::rustc_type_ir::TypeFoldable<I>,
ty::CompressedTraitClause<I>: ::rustc_type_ir::TypeFoldable<I> {
fn try_fold_with<__F: ::rustc_type_ir::FallibleTypeFolder<I>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
ClauseKind::Trait(__binding_0) => {
ClauseKind::Trait(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ClauseKind::RegionOutlives(__binding_0) => {
ClauseKind::RegionOutlives(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ClauseKind::TypeOutlives(__binding_0) => {
ClauseKind::TypeOutlives(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ClauseKind::Projection(__binding_0) => {
ClauseKind::Projection(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ClauseKind::ConstArgHasType(__binding_0, __binding_1) => {
ClauseKind::ConstArgHasType(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
::rustc_type_ir::TypeFoldable::try_fold_with(__binding_1,
__folder)?)
}
ClauseKind::WellFormed(__binding_0) => {
ClauseKind::WellFormed(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ClauseKind::ConstEvaluatable(__binding_0) => {
ClauseKind::ConstEvaluatable(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ClauseKind::HostEffect(__binding_0) => {
ClauseKind::HostEffect(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ClauseKind::UnstableFeature(__binding_0) => {
ClauseKind::UnstableFeature(__binding_0)
}
ClauseKind::CompressedTrait(__binding_0) => {
ClauseKind::CompressedTrait(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
})
}
fn fold_with<__F: ::rustc_type_ir::TypeFolder<I>>(self,
__folder: &mut __F) -> Self {
match self {
ClauseKind::Trait(__binding_0) => {
ClauseKind::Trait(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder))
}
ClauseKind::RegionOutlives(__binding_0) => {
ClauseKind::RegionOutlives(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder))
}
ClauseKind::TypeOutlives(__binding_0) => {
ClauseKind::TypeOutlives(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder))
}
ClauseKind::Projection(__binding_0) => {
ClauseKind::Projection(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder))
}
ClauseKind::ConstArgHasType(__binding_0, __binding_1) => {
ClauseKind::ConstArgHasType(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder),
::rustc_type_ir::TypeFoldable::fold_with(__binding_1,
__folder))
}
ClauseKind::WellFormed(__binding_0) => {
ClauseKind::WellFormed(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder))
}
ClauseKind::ConstEvaluatable(__binding_0) => {
ClauseKind::ConstEvaluatable(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder))
}
ClauseKind::HostEffect(__binding_0) => {
ClauseKind::HostEffect(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder))
}
ClauseKind::UnstableFeature(__binding_0) => {
ClauseKind::UnstableFeature(__binding_0)
}
ClauseKind::CompressedTrait(__binding_0) => {
ClauseKind::CompressedTrait(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder))
}
}
}
}
};TypeFoldable_Generic)]
14#[cfg_attr(
15 feature = "nightly",
16 derive(const _: () =
{
impl<I: Interner, __E: ::rustc_serialize::Encoder>
::rustc_serialize::Encodable<__E> for ClauseKind<I> where
ty::TraitClause<I>: ::rustc_serialize::Encodable<__E>,
ty::OutlivesClause<I,
Region<I>>: ::rustc_serialize::Encodable<__E>,
ty::OutlivesClause<I, I::Ty>: ::rustc_serialize::Encodable<__E>,
ty::ProjectionClause<I>: ::rustc_serialize::Encodable<__E>,
Const<I>: ::rustc_serialize::Encodable<__E>,
I::Ty: ::rustc_serialize::Encodable<__E>,
I::Term: ::rustc_serialize::Encodable<__E>,
ty::HostEffectClause<I>: ::rustc_serialize::Encodable<__E>,
I::Symbol: ::rustc_serialize::Encodable<__E>,
ty::CompressedTraitClause<I>: ::rustc_serialize::Encodable<__E> {
fn encode(&self, __encoder: &mut __E) {
let disc =
match *self {
ClauseKind::Trait(ref __binding_0) => { 0usize }
ClauseKind::RegionOutlives(ref __binding_0) => { 1usize }
ClauseKind::TypeOutlives(ref __binding_0) => { 2usize }
ClauseKind::Projection(ref __binding_0) => { 3usize }
ClauseKind::ConstArgHasType(ref __binding_0,
ref __binding_1) => {
4usize
}
ClauseKind::WellFormed(ref __binding_0) => { 5usize }
ClauseKind::ConstEvaluatable(ref __binding_0) => { 6usize }
ClauseKind::HostEffect(ref __binding_0) => { 7usize }
ClauseKind::UnstableFeature(ref __binding_0) => { 8usize }
ClauseKind::CompressedTrait(ref __binding_0) => { 9usize }
};
::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
match *self {
ClauseKind::Trait(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ClauseKind::RegionOutlives(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ClauseKind::TypeOutlives(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ClauseKind::Projection(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ClauseKind::ConstArgHasType(ref __binding_0,
ref __binding_1) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
ClauseKind::WellFormed(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ClauseKind::ConstEvaluatable(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ClauseKind::HostEffect(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ClauseKind::UnstableFeature(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ClauseKind::CompressedTrait(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
}
}
}
};Encodable_NoContext, const _: () =
{
impl<I: Interner, __D: ::rustc_serialize::Decoder>
::rustc_serialize::Decodable<__D> for ClauseKind<I> where
ty::TraitClause<I>: ::rustc_serialize::Decodable<__D>,
ty::OutlivesClause<I,
Region<I>>: ::rustc_serialize::Decodable<__D>,
ty::OutlivesClause<I, I::Ty>: ::rustc_serialize::Decodable<__D>,
ty::ProjectionClause<I>: ::rustc_serialize::Decodable<__D>,
Const<I>: ::rustc_serialize::Decodable<__D>,
I::Ty: ::rustc_serialize::Decodable<__D>,
I::Term: ::rustc_serialize::Decodable<__D>,
ty::HostEffectClause<I>: ::rustc_serialize::Decodable<__D>,
I::Symbol: ::rustc_serialize::Decodable<__D>,
ty::CompressedTraitClause<I>: ::rustc_serialize::Decodable<__D> {
fn decode(__decoder: &mut __D) -> Self {
match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
{
0usize => {
ClauseKind::Trait(::rustc_serialize::Decodable::decode(__decoder))
}
1usize => {
ClauseKind::RegionOutlives(::rustc_serialize::Decodable::decode(__decoder))
}
2usize => {
ClauseKind::TypeOutlives(::rustc_serialize::Decodable::decode(__decoder))
}
3usize => {
ClauseKind::Projection(::rustc_serialize::Decodable::decode(__decoder))
}
4usize => {
ClauseKind::ConstArgHasType(::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder))
}
5usize => {
ClauseKind::WellFormed(::rustc_serialize::Decodable::decode(__decoder))
}
6usize => {
ClauseKind::ConstEvaluatable(::rustc_serialize::Decodable::decode(__decoder))
}
7usize => {
ClauseKind::HostEffect(::rustc_serialize::Decodable::decode(__decoder))
}
8usize => {
ClauseKind::UnstableFeature(::rustc_serialize::Decodable::decode(__decoder))
}
9usize => {
ClauseKind::CompressedTrait(::rustc_serialize::Decodable::decode(__decoder))
}
n => {
::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `ClauseKind`, expected 0..10, actual {0}",
n));
}
}
}
}
};Decodable_NoContext, const _: () =
{
impl<I: Interner> ::rustc_data_structures::stable_hash::StableHash for
ClauseKind<I> where
ty::TraitClause<I>: ::rustc_data_structures::stable_hash::StableHash,
ty::OutlivesClause<I,
Region<I>>: ::rustc_data_structures::stable_hash::StableHash,
ty::OutlivesClause<I,
I::Ty>: ::rustc_data_structures::stable_hash::StableHash,
ty::ProjectionClause<I>: ::rustc_data_structures::stable_hash::StableHash,
Const<I>: ::rustc_data_structures::stable_hash::StableHash,
I::Ty: ::rustc_data_structures::stable_hash::StableHash,
I::Term: ::rustc_data_structures::stable_hash::StableHash,
ty::HostEffectClause<I>: ::rustc_data_structures::stable_hash::StableHash,
I::Symbol: ::rustc_data_structures::stable_hash::StableHash,
ty::CompressedTraitClause<I>: ::rustc_data_structures::stable_hash::StableHash
{
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
ClauseKind::Trait(ref __binding_0) =>
0u8.stable_hash(__hcx, __hasher),
ClauseKind::RegionOutlives(ref __binding_0) =>
1u8.stable_hash(__hcx, __hasher),
ClauseKind::TypeOutlives(ref __binding_0) =>
2u8.stable_hash(__hcx, __hasher),
ClauseKind::Projection(ref __binding_0) =>
3u8.stable_hash(__hcx, __hasher),
ClauseKind::ConstArgHasType(ref __binding_0,
ref __binding_1) => 4u8.stable_hash(__hcx, __hasher),
ClauseKind::WellFormed(ref __binding_0) =>
5u8.stable_hash(__hcx, __hasher),
ClauseKind::ConstEvaluatable(ref __binding_0) =>
6u8.stable_hash(__hcx, __hasher),
ClauseKind::HostEffect(ref __binding_0) =>
7u8.stable_hash(__hcx, __hasher),
ClauseKind::UnstableFeature(ref __binding_0) =>
8u8.stable_hash(__hcx, __hasher),
ClauseKind::CompressedTrait(ref __binding_0) =>
9u8.stable_hash(__hcx, __hasher),
}
match *self {
ClauseKind::Trait(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ClauseKind::RegionOutlives(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ClauseKind::TypeOutlives(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ClauseKind::Projection(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ClauseKind::ConstArgHasType(ref __binding_0,
ref __binding_1) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
ClauseKind::WellFormed(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ClauseKind::ConstEvaluatable(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ClauseKind::HostEffect(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ClauseKind::UnstableFeature(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ClauseKind::CompressedTrait(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash_NoContext)
17)]
18pub enum ClauseKind<I: Interner> {
19 Trait(ty::TraitClause<I>),
23
24 RegionOutlives(ty::OutlivesClause<I, Region<I>>),
26
27 TypeOutlives(ty::OutlivesClause<I, I::Ty>),
29
30 Projection(ty::ProjectionClause<I>),
33
34 ConstArgHasType(Const<I>, I::Ty),
37
38 WellFormed(I::Term),
40
41 ConstEvaluatable(Const<I>),
43
44 HostEffect(ty::HostEffectClause<I>),
49
50 UnstableFeature(
52 #[type_foldable(identity)]
53 #[type_visitable(ignore)]
54 I::Symbol,
55 ),
56
57 CompressedTrait(ty::CompressedTraitClause<I>),
66}
67
68impl<I: Interner> Eq for ClauseKind<I> {}
69
70#[automatically_derived]
impl<I: Interner> ::core::clone::Clone for PredicateKind<I> where I: Interner
{
#[inline]
fn clone(&self) -> Self { *self }
}
#[automatically_derived]
impl<I: Interner> ::core::marker::Copy for PredicateKind<I> where I: Interner
{
}
#[automatically_derived]
impl<I: Interner> ::core::hash::Hash for PredicateKind<I> where I: Interner {
fn hash<__H: ::core::hash::Hasher>(&self, __state: &mut __H) {
match self {
PredicateKind::Clause(ref __field_0) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
}
PredicateKind::DynCompatible(ref __field_0) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
}
PredicateKind::Subtype(ref __field_0) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
}
PredicateKind::Coerce(ref __field_0) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
}
PredicateKind::ConstEquate(ref __field_0, ref __field_1) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
::core::hash::Hash::hash(__field_1, __state);
}
PredicateKind::Ambiguous => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
}
PredicateKind::NormalizesTo(ref __field_0) => {
::core::hash::Hash::hash(&::core::mem::discriminant(self),
__state);
::core::hash::Hash::hash(__field_0, __state);
}
}
}
}
#[automatically_derived]
impl<I: Interner> ::core::cmp::PartialEq for PredicateKind<I> where
I: Interner {
#[inline]
fn eq(&self, __other: &Self) -> ::core::primitive::bool {
if ::core::mem::discriminant(self) ==
::core::mem::discriminant(__other) {
match (self, __other) {
(PredicateKind::Clause(ref __field_0),
PredicateKind::Clause(ref __other_field_0)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0),
(PredicateKind::DynCompatible(ref __field_0),
PredicateKind::DynCompatible(ref __other_field_0)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0),
(PredicateKind::Subtype(ref __field_0),
PredicateKind::Subtype(ref __other_field_0)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0),
(PredicateKind::Coerce(ref __field_0),
PredicateKind::Coerce(ref __other_field_0)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0),
(PredicateKind::ConstEquate(ref __field_0, ref __field_1),
PredicateKind::ConstEquate(ref __other_field_0,
ref __other_field_1)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0) &&
::core::cmp::PartialEq::eq(__field_1, __other_field_1),
(PredicateKind::NormalizesTo(ref __field_0),
PredicateKind::NormalizesTo(ref __other_field_0)) =>
true &&
::core::cmp::PartialEq::eq(__field_0, __other_field_0),
_ => true,
}
} else { false }
}
}#[derive_where(Clone, Copy, Hash, PartialEq; I: Interner)]
71#[derive(const _: () =
{
impl<I: Interner> ::rustc_type_ir::TypeVisitable<I> for
PredicateKind<I> where I: Interner,
ClauseKind<I>: ::rustc_type_ir::TypeVisitable<I>,
I::TraitId: ::rustc_type_ir::TypeVisitable<I>,
ty::SubtypePredicate<I>: ::rustc_type_ir::TypeVisitable<I>,
ty::CoercePredicate<I>: ::rustc_type_ir::TypeVisitable<I>,
Const<I>: ::rustc_type_ir::TypeVisitable<I>,
ty::NormalizesTo<I>: ::rustc_type_ir::TypeVisitable<I> {
fn visit_with<__V: ::rustc_type_ir::TypeVisitor<I>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
PredicateKind::Clause(ref __binding_0) => {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
PredicateKind::DynCompatible(ref __binding_0) => {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
PredicateKind::Subtype(ref __binding_0) => {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
PredicateKind::Coerce(ref __binding_0) => {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
PredicateKind::ConstEquate(ref __binding_0, ref __binding_1)
=> {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
PredicateKind::Ambiguous => {}
PredicateKind::NormalizesTo(ref __binding_0) => {
{
match ::rustc_type_ir::VisitorResult::branch(::rustc_type_ir::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_type_ir::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_type_ir::VisitorResult>::output()
}
}
};TypeVisitable_Generic, const _: () =
{
unsafe impl<I: Interner, __V>
::rustc_type_ir::GenericTypeVisitable<__V> for PredicateKind<I>
where ClauseKind<I>: ::rustc_type_ir::GenericTypeVisitable<__V>,
I::TraitId: ::rustc_type_ir::GenericTypeVisitable<__V>,
ty::SubtypePredicate<I>: ::rustc_type_ir::GenericTypeVisitable<__V>,
ty::CoercePredicate<I>: ::rustc_type_ir::GenericTypeVisitable<__V>,
Const<I>: ::rustc_type_ir::GenericTypeVisitable<__V>,
Const<I>: ::rustc_type_ir::GenericTypeVisitable<__V>,
ty::NormalizesTo<I>: ::rustc_type_ir::GenericTypeVisitable<__V> {
fn generic_visit_with(&self, __visitor: &mut __V) {
match *self {
PredicateKind::Clause(ref __binding_0) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
}
PredicateKind::DynCompatible(ref __binding_0) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
}
PredicateKind::Subtype(ref __binding_0) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
}
PredicateKind::Coerce(ref __binding_0) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
}
PredicateKind::ConstEquate(ref __binding_0, ref __binding_1)
=> {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_1,
__visitor);
}
}
PredicateKind::Ambiguous => {}
PredicateKind::NormalizesTo(ref __binding_0) => {
{
::rustc_type_ir::GenericTypeVisitable::<__V>::generic_visit_with(__binding_0,
__visitor);
}
}
}
}
}
};GenericTypeVisitable, const _: () =
{
impl<I: Interner> ::rustc_type_ir::TypeFoldable<I> for
PredicateKind<I> where I: Interner,
ClauseKind<I>: ::rustc_type_ir::TypeFoldable<I>,
I::TraitId: ::rustc_type_ir::TypeFoldable<I>,
ty::SubtypePredicate<I>: ::rustc_type_ir::TypeFoldable<I>,
ty::CoercePredicate<I>: ::rustc_type_ir::TypeFoldable<I>,
Const<I>: ::rustc_type_ir::TypeFoldable<I>,
ty::NormalizesTo<I>: ::rustc_type_ir::TypeFoldable<I> {
fn try_fold_with<__F: ::rustc_type_ir::FallibleTypeFolder<I>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
PredicateKind::Clause(__binding_0) => {
PredicateKind::Clause(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
PredicateKind::DynCompatible(__binding_0) => {
PredicateKind::DynCompatible(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
PredicateKind::Subtype(__binding_0) => {
PredicateKind::Subtype(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
PredicateKind::Coerce(__binding_0) => {
PredicateKind::Coerce(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
PredicateKind::ConstEquate(__binding_0, __binding_1) => {
PredicateKind::ConstEquate(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
::rustc_type_ir::TypeFoldable::try_fold_with(__binding_1,
__folder)?)
}
PredicateKind::Ambiguous => { PredicateKind::Ambiguous }
PredicateKind::NormalizesTo(__binding_0) => {
PredicateKind::NormalizesTo(::rustc_type_ir::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
})
}
fn fold_with<__F: ::rustc_type_ir::TypeFolder<I>>(self,
__folder: &mut __F) -> Self {
match self {
PredicateKind::Clause(__binding_0) => {
PredicateKind::Clause(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder))
}
PredicateKind::DynCompatible(__binding_0) => {
PredicateKind::DynCompatible(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder))
}
PredicateKind::Subtype(__binding_0) => {
PredicateKind::Subtype(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder))
}
PredicateKind::Coerce(__binding_0) => {
PredicateKind::Coerce(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder))
}
PredicateKind::ConstEquate(__binding_0, __binding_1) => {
PredicateKind::ConstEquate(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder),
::rustc_type_ir::TypeFoldable::fold_with(__binding_1,
__folder))
}
PredicateKind::Ambiguous => { PredicateKind::Ambiguous }
PredicateKind::NormalizesTo(__binding_0) => {
PredicateKind::NormalizesTo(::rustc_type_ir::TypeFoldable::fold_with(__binding_0,
__folder))
}
}
}
}
};TypeFoldable_Generic)]
72#[cfg_attr(
73 feature = "nightly",
74 derive(const _: () =
{
impl<I: Interner, __E: ::rustc_serialize::Encoder>
::rustc_serialize::Encodable<__E> for PredicateKind<I> where
ClauseKind<I>: ::rustc_serialize::Encodable<__E>,
I::TraitId: ::rustc_serialize::Encodable<__E>,
ty::SubtypePredicate<I>: ::rustc_serialize::Encodable<__E>,
ty::CoercePredicate<I>: ::rustc_serialize::Encodable<__E>,
Const<I>: ::rustc_serialize::Encodable<__E>,
ty::NormalizesTo<I>: ::rustc_serialize::Encodable<__E> {
fn encode(&self, __encoder: &mut __E) {
let disc =
match *self {
PredicateKind::Clause(ref __binding_0) => { 0usize }
PredicateKind::DynCompatible(ref __binding_0) => { 1usize }
PredicateKind::Subtype(ref __binding_0) => { 2usize }
PredicateKind::Coerce(ref __binding_0) => { 3usize }
PredicateKind::ConstEquate(ref __binding_0, ref __binding_1)
=> {
4usize
}
PredicateKind::Ambiguous => { 5usize }
PredicateKind::NormalizesTo(ref __binding_0) => { 6usize }
};
::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
match *self {
PredicateKind::Clause(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
PredicateKind::DynCompatible(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
PredicateKind::Subtype(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
PredicateKind::Coerce(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
PredicateKind::ConstEquate(ref __binding_0, ref __binding_1)
=> {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
PredicateKind::Ambiguous => {}
PredicateKind::NormalizesTo(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
}
}
}
};Encodable_NoContext, const _: () =
{
impl<I: Interner, __D: ::rustc_serialize::Decoder>
::rustc_serialize::Decodable<__D> for PredicateKind<I> where
ClauseKind<I>: ::rustc_serialize::Decodable<__D>,
I::TraitId: ::rustc_serialize::Decodable<__D>,
ty::SubtypePredicate<I>: ::rustc_serialize::Decodable<__D>,
ty::CoercePredicate<I>: ::rustc_serialize::Decodable<__D>,
Const<I>: ::rustc_serialize::Decodable<__D>,
ty::NormalizesTo<I>: ::rustc_serialize::Decodable<__D> {
fn decode(__decoder: &mut __D) -> Self {
match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
{
0usize => {
PredicateKind::Clause(::rustc_serialize::Decodable::decode(__decoder))
}
1usize => {
PredicateKind::DynCompatible(::rustc_serialize::Decodable::decode(__decoder))
}
2usize => {
PredicateKind::Subtype(::rustc_serialize::Decodable::decode(__decoder))
}
3usize => {
PredicateKind::Coerce(::rustc_serialize::Decodable::decode(__decoder))
}
4usize => {
PredicateKind::ConstEquate(::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder))
}
5usize => { PredicateKind::Ambiguous }
6usize => {
PredicateKind::NormalizesTo(::rustc_serialize::Decodable::decode(__decoder))
}
n => {
::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `PredicateKind`, expected 0..7, actual {0}",
n));
}
}
}
}
};Decodable_NoContext, const _: () =
{
impl<I: Interner> ::rustc_data_structures::stable_hash::StableHash for
PredicateKind<I> where
ClauseKind<I>: ::rustc_data_structures::stable_hash::StableHash,
I::TraitId: ::rustc_data_structures::stable_hash::StableHash,
ty::SubtypePredicate<I>: ::rustc_data_structures::stable_hash::StableHash,
ty::CoercePredicate<I>: ::rustc_data_structures::stable_hash::StableHash,
Const<I>: ::rustc_data_structures::stable_hash::StableHash,
ty::NormalizesTo<I>: ::rustc_data_structures::stable_hash::StableHash
{
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
PredicateKind::Clause(ref __binding_0) =>
0u8.stable_hash(__hcx, __hasher),
PredicateKind::DynCompatible(ref __binding_0) =>
1u8.stable_hash(__hcx, __hasher),
PredicateKind::Subtype(ref __binding_0) =>
2u8.stable_hash(__hcx, __hasher),
PredicateKind::Coerce(ref __binding_0) =>
3u8.stable_hash(__hcx, __hasher),
PredicateKind::ConstEquate(ref __binding_0, ref __binding_1)
=> 4u8.stable_hash(__hcx, __hasher),
PredicateKind::Ambiguous =>
5u8.stable_hash(__hcx, __hasher),
PredicateKind::NormalizesTo(ref __binding_0) =>
6u8.stable_hash(__hcx, __hasher),
}
match *self {
PredicateKind::Clause(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
PredicateKind::DynCompatible(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
PredicateKind::Subtype(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
PredicateKind::Coerce(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
PredicateKind::ConstEquate(ref __binding_0, ref __binding_1)
=> {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
PredicateKind::Ambiguous => {}
PredicateKind::NormalizesTo(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash_NoContext)
75)]
76pub enum PredicateKind<I: Interner> {
77 Clause(ClauseKind<I>),
79
80 DynCompatible(I::TraitId),
82
83 Subtype(ty::SubtypePredicate<I>),
89
90 Coerce(ty::CoercePredicate<I>),
99
100 ConstEquate(Const<I>, Const<I>),
102
103 Ambiguous,
106
107 NormalizesTo(ty::NormalizesTo<I>),
116}
117
118impl<I: Interner> Eq for PredicateKind<I> {}
119
120impl<I: Interner> fmt::Debug for ClauseKind<I> {
121 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
122 match self {
123 ClauseKind::ConstArgHasType(ct, ty) => f.write_fmt(format_args!("ConstArgHasType({0:?}, {1:?})", ct, ty))write!(f, "ConstArgHasType({ct:?}, {ty:?})"),
124 ClauseKind::HostEffect(data) => data.fmt(f),
125 ClauseKind::Trait(a) => a.fmt(f),
126 ClauseKind::RegionOutlives(pair) => pair.fmt(f),
127 ClauseKind::TypeOutlives(pair) => pair.fmt(f),
128 ClauseKind::Projection(pair) => pair.fmt(f),
129 ClauseKind::WellFormed(data) => f.write_fmt(format_args!("WellFormed({0:?})", data))write!(f, "WellFormed({data:?})"),
130 ClauseKind::ConstEvaluatable(ct) => {
131 f.write_fmt(format_args!("ConstEvaluatable({0:?})", ct))write!(f, "ConstEvaluatable({ct:?})")
132 }
133 ClauseKind::UnstableFeature(feature_name) => {
134 f.write_fmt(format_args!("UnstableFeature({0:?})", feature_name))write!(f, "UnstableFeature({feature_name:?})")
135 }
136 ClauseKind::CompressedTrait(c) => {
137 f.write_fmt(format_args!("CompressedTrait({0:?})", c))write!(f, "CompressedTrait({c:?})")
138 }
139 }
140 }
141}
142
143impl<I: Interner> fmt::Debug for PredicateKind<I> {
144 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
145 match self {
146 PredicateKind::Clause(a) => a.fmt(f),
147 PredicateKind::Subtype(pair) => pair.fmt(f),
148 PredicateKind::Coerce(pair) => pair.fmt(f),
149 PredicateKind::DynCompatible(trait_def_id) => {
150 f.write_fmt(format_args!("DynCompatible({0:?})", trait_def_id))write!(f, "DynCompatible({trait_def_id:?})")
151 }
152 PredicateKind::ConstEquate(c1, c2) => f.write_fmt(format_args!("ConstEquate({0:?}, {1:?})", c1, c2))write!(f, "ConstEquate({c1:?}, {c2:?})"),
153 PredicateKind::Ambiguous => f.write_fmt(format_args!("Ambiguous"))write!(f, "Ambiguous"),
154 PredicateKind::NormalizesTo(p) => p.fmt(f),
155 }
156 }
157}