1use rustc_macros::{HashStable, TypeFoldable, TypeVisitable};
9use rustc_span::Span;
10
11use crate::error::DropCheckOverflow;
12use crate::infer::canonical::{Canonical, CanonicalQueryInput, QueryResponse};
13use crate::traits::solve;
14pub use crate::traits::solve::NoSolution;
15use crate::ty::{self, GenericArg, Ty, TyCtxt};
16
17pub mod type_op {
18 use rustc_macros::{HashStable, TypeFoldable, TypeVisitable};
19
20 use crate::ty::{Predicate, Ty, UserType};
21
22 #[derive(#[automatically_derived]
impl<'tcx> ::core::marker::Copy for AscribeUserType<'tcx> { }Copy, #[automatically_derived]
impl<'tcx> ::core::clone::Clone for AscribeUserType<'tcx> {
#[inline]
fn clone(&self) -> AscribeUserType<'tcx> {
let _: ::core::clone::AssertParamIsClone<Ty<'tcx>>;
let _: ::core::clone::AssertParamIsClone<UserType<'tcx>>;
*self
}
}Clone, #[automatically_derived]
impl<'tcx> ::core::fmt::Debug for AscribeUserType<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"AscribeUserType", "mir_ty", &self.mir_ty, "user_ty",
&&self.user_ty)
}
}Debug, #[automatically_derived]
impl<'tcx> ::core::hash::Hash for AscribeUserType<'tcx> {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&self.mir_ty, state);
::core::hash::Hash::hash(&self.user_ty, state)
}
}Hash, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for AscribeUserType<'tcx> {
#[inline]
fn eq(&self, other: &AscribeUserType<'tcx>) -> bool {
self.mir_ty == other.mir_ty && self.user_ty == other.user_ty
}
}PartialEq, #[automatically_derived]
impl<'tcx> ::core::cmp::Eq for AscribeUserType<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_receiver_is_total_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<UserType<'tcx>>;
}
}Eq, const _: () =
{
impl<'tcx, '__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for AscribeUserType<'tcx> {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
AscribeUserType {
mir_ty: ref __binding_0, user_ty: ref __binding_1 } => {
{ __binding_0.hash_stable(__hcx, __hasher); }
{ __binding_1.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for AscribeUserType<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
AscribeUserType { mir_ty: __binding_0, user_ty: __binding_1
} => {
AscribeUserType {
mir_ty: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
user_ty: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
AscribeUserType { mir_ty: __binding_0, user_ty: __binding_1
} => {
AscribeUserType {
mir_ty: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
user_ty: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
}
}
}
}
}
};TypeFoldable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for AscribeUserType<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
AscribeUserType {
mir_ty: ref __binding_0, user_ty: ref __binding_1 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable)]
23 pub struct AscribeUserType<'tcx> {
24 pub mir_ty: Ty<'tcx>,
25 pub user_ty: UserType<'tcx>,
26 }
27
28 #[derive(#[automatically_derived]
impl<'tcx> ::core::marker::Copy for Eq<'tcx> { }Copy, #[automatically_derived]
impl<'tcx> ::core::clone::Clone for Eq<'tcx> {
#[inline]
fn clone(&self) -> Eq<'tcx> {
let _: ::core::clone::AssertParamIsClone<Ty<'tcx>>;
let _: ::core::clone::AssertParamIsClone<Ty<'tcx>>;
*self
}
}Clone, #[automatically_derived]
impl<'tcx> ::core::fmt::Debug for Eq<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Eq", "a",
&self.a, "b", &&self.b)
}
}Debug, #[automatically_derived]
impl<'tcx> ::core::hash::Hash for Eq<'tcx> {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&self.a, state);
::core::hash::Hash::hash(&self.b, state)
}
}Hash, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for Eq<'tcx> {
#[inline]
fn eq(&self, other: &Eq<'tcx>) -> bool {
self.a == other.a && self.b == other.b
}
}PartialEq, #[automatically_derived]
impl<'tcx> ::core::cmp::Eq for Eq<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_receiver_is_total_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
}
}Eq, const _: () =
{
impl<'tcx, '__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for Eq<'tcx> {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
Eq { a: ref __binding_0, b: ref __binding_1 } => {
{ __binding_0.hash_stable(__hcx, __hasher); }
{ __binding_1.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for Eq<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
Eq { a: __binding_0, b: __binding_1 } => {
Eq {
a: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
b: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
Eq { a: __binding_0, b: __binding_1 } => {
Eq {
a: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
b: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
}
}
}
}
}
};TypeFoldable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for Eq<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
Eq { a: ref __binding_0, b: ref __binding_1 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable)]
29 pub struct Eq<'tcx> {
30 pub a: Ty<'tcx>,
31 pub b: Ty<'tcx>,
32 }
33
34 #[derive(#[automatically_derived]
impl<'tcx> ::core::marker::Copy for Subtype<'tcx> { }Copy, #[automatically_derived]
impl<'tcx> ::core::clone::Clone for Subtype<'tcx> {
#[inline]
fn clone(&self) -> Subtype<'tcx> {
let _: ::core::clone::AssertParamIsClone<Ty<'tcx>>;
let _: ::core::clone::AssertParamIsClone<Ty<'tcx>>;
*self
}
}Clone, #[automatically_derived]
impl<'tcx> ::core::fmt::Debug for Subtype<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Subtype",
"sub", &self.sub, "sup", &&self.sup)
}
}Debug, #[automatically_derived]
impl<'tcx> ::core::hash::Hash for Subtype<'tcx> {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&self.sub, state);
::core::hash::Hash::hash(&self.sup, state)
}
}Hash, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for Subtype<'tcx> {
#[inline]
fn eq(&self, other: &Subtype<'tcx>) -> bool {
self.sub == other.sub && self.sup == other.sup
}
}PartialEq, #[automatically_derived]
impl<'tcx> ::core::cmp::Eq for Subtype<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_receiver_is_total_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
}
}Eq, const _: () =
{
impl<'tcx, '__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for Subtype<'tcx> {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
Subtype { sub: ref __binding_0, sup: ref __binding_1 } => {
{ __binding_0.hash_stable(__hcx, __hasher); }
{ __binding_1.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for Subtype<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
Subtype { sub: __binding_0, sup: __binding_1 } => {
Subtype {
sub: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
sup: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
Subtype { sub: __binding_0, sup: __binding_1 } => {
Subtype {
sub: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
sup: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
}
}
}
}
}
};TypeFoldable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for Subtype<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
Subtype { sub: ref __binding_0, sup: ref __binding_1 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable)]
35 pub struct Subtype<'tcx> {
36 pub sub: Ty<'tcx>,
37 pub sup: Ty<'tcx>,
38 }
39
40 #[derive(#[automatically_derived]
impl<'tcx> ::core::marker::Copy for ProvePredicate<'tcx> { }Copy, #[automatically_derived]
impl<'tcx> ::core::clone::Clone for ProvePredicate<'tcx> {
#[inline]
fn clone(&self) -> ProvePredicate<'tcx> {
let _: ::core::clone::AssertParamIsClone<Predicate<'tcx>>;
*self
}
}Clone, #[automatically_derived]
impl<'tcx> ::core::fmt::Debug for ProvePredicate<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"ProvePredicate", "predicate", &&self.predicate)
}
}Debug, #[automatically_derived]
impl<'tcx> ::core::hash::Hash for ProvePredicate<'tcx> {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&self.predicate, state)
}
}Hash, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for ProvePredicate<'tcx> {
#[inline]
fn eq(&self, other: &ProvePredicate<'tcx>) -> bool {
self.predicate == other.predicate
}
}PartialEq, #[automatically_derived]
impl<'tcx> ::core::cmp::Eq for ProvePredicate<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_receiver_is_total_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Predicate<'tcx>>;
}
}Eq, const _: () =
{
impl<'tcx, '__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for ProvePredicate<'tcx> {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
ProvePredicate { predicate: ref __binding_0 } => {
{ __binding_0.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for ProvePredicate<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
ProvePredicate { predicate: __binding_0 } => {
ProvePredicate {
predicate: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
ProvePredicate { predicate: __binding_0 } => {
ProvePredicate {
predicate: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
}
}
}
}
}
};TypeFoldable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for ProvePredicate<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
ProvePredicate { predicate: ref __binding_0 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable)]
41 pub struct ProvePredicate<'tcx> {
42 pub predicate: Predicate<'tcx>,
43 }
44
45 #[derive(#[automatically_derived]
impl<T: ::core::marker::Copy> ::core::marker::Copy for Normalize<T> { }Copy, #[automatically_derived]
impl<T: ::core::clone::Clone> ::core::clone::Clone for Normalize<T> {
#[inline]
fn clone(&self) -> Normalize<T> {
Normalize { value: ::core::clone::Clone::clone(&self.value) }
}
}Clone, #[automatically_derived]
impl<T: ::core::fmt::Debug> ::core::fmt::Debug for Normalize<T> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "Normalize",
"value", &&self.value)
}
}Debug, #[automatically_derived]
impl<T: ::core::hash::Hash> ::core::hash::Hash for Normalize<T> {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&self.value, state)
}
}Hash, #[automatically_derived]
impl<T: ::core::cmp::PartialEq> ::core::cmp::PartialEq for Normalize<T> {
#[inline]
fn eq(&self, other: &Normalize<T>) -> bool { self.value == other.value }
}PartialEq, #[automatically_derived]
impl<T: ::core::cmp::Eq> ::core::cmp::Eq for Normalize<T> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_receiver_is_total_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<T>;
}
}Eq, const _: () =
{
impl<'__ctx, T>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for Normalize<T> where
T: ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
{
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
Normalize { value: ref __binding_0 } => {
{ __binding_0.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable, const _: () =
{
impl<'tcx, T>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for Normalize<T> where
T: ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
{
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
Normalize { value: __binding_0 } => {
Normalize {
value: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
Normalize { value: __binding_0 } => {
Normalize {
value: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
}
}
}
}
}
};TypeFoldable, const _: () =
{
impl<'tcx, T>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for Normalize<T> where
T: ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
{
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
Normalize { value: ref __binding_0 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable)]
47 pub struct Normalize<T> {
48 pub value: T,
49 }
50
51 #[derive(#[automatically_derived]
impl<T: ::core::marker::Copy> ::core::marker::Copy for DeeplyNormalize<T> { }Copy, #[automatically_derived]
impl<T: ::core::clone::Clone> ::core::clone::Clone for DeeplyNormalize<T> {
#[inline]
fn clone(&self) -> DeeplyNormalize<T> {
DeeplyNormalize { value: ::core::clone::Clone::clone(&self.value) }
}
}Clone, #[automatically_derived]
impl<T: ::core::fmt::Debug> ::core::fmt::Debug for DeeplyNormalize<T> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"DeeplyNormalize", "value", &&self.value)
}
}Debug, #[automatically_derived]
impl<T: ::core::hash::Hash> ::core::hash::Hash for DeeplyNormalize<T> {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&self.value, state)
}
}Hash, #[automatically_derived]
impl<T: ::core::cmp::PartialEq> ::core::cmp::PartialEq for DeeplyNormalize<T>
{
#[inline]
fn eq(&self, other: &DeeplyNormalize<T>) -> bool {
self.value == other.value
}
}PartialEq, #[automatically_derived]
impl<T: ::core::cmp::Eq> ::core::cmp::Eq for DeeplyNormalize<T> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_receiver_is_total_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<T>;
}
}Eq, const _: () =
{
impl<'__ctx, T>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for DeeplyNormalize<T> where
T: ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
{
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
DeeplyNormalize { value: ref __binding_0 } => {
{ __binding_0.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable, const _: () =
{
impl<'tcx, T>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for DeeplyNormalize<T> where
T: ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
{
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
DeeplyNormalize { value: __binding_0 } => {
DeeplyNormalize {
value: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
DeeplyNormalize { value: __binding_0 } => {
DeeplyNormalize {
value: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
}
}
}
}
}
};TypeFoldable, const _: () =
{
impl<'tcx, T>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for DeeplyNormalize<T> where
T: ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
{
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
DeeplyNormalize { value: ref __binding_0 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable)]
53 pub struct DeeplyNormalize<T> {
54 pub value: T,
55 }
56
57 #[derive(#[automatically_derived]
impl<'tcx> ::core::marker::Copy for ImpliedOutlivesBounds<'tcx> { }Copy, #[automatically_derived]
impl<'tcx> ::core::clone::Clone for ImpliedOutlivesBounds<'tcx> {
#[inline]
fn clone(&self) -> ImpliedOutlivesBounds<'tcx> {
let _: ::core::clone::AssertParamIsClone<Ty<'tcx>>;
*self
}
}Clone, #[automatically_derived]
impl<'tcx> ::core::fmt::Debug for ImpliedOutlivesBounds<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"ImpliedOutlivesBounds", "ty", &&self.ty)
}
}Debug, #[automatically_derived]
impl<'tcx> ::core::hash::Hash for ImpliedOutlivesBounds<'tcx> {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&self.ty, state)
}
}Hash, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for ImpliedOutlivesBounds<'tcx> {
#[inline]
fn eq(&self, other: &ImpliedOutlivesBounds<'tcx>) -> bool {
self.ty == other.ty
}
}PartialEq, #[automatically_derived]
impl<'tcx> ::core::cmp::Eq for ImpliedOutlivesBounds<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_receiver_is_total_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
}
}Eq, const _: () =
{
impl<'tcx, '__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for ImpliedOutlivesBounds<'tcx> {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
ImpliedOutlivesBounds { ty: ref __binding_0 } => {
{ __binding_0.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for ImpliedOutlivesBounds<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
ImpliedOutlivesBounds { ty: __binding_0 } => {
ImpliedOutlivesBounds {
ty: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
ImpliedOutlivesBounds { ty: __binding_0 } => {
ImpliedOutlivesBounds {
ty: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
}
}
}
}
}
};TypeFoldable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for ImpliedOutlivesBounds<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
ImpliedOutlivesBounds { ty: ref __binding_0 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable)]
58 pub struct ImpliedOutlivesBounds<'tcx> {
59 pub ty: Ty<'tcx>,
60 }
61
62 #[derive(#[automatically_derived]
impl<'tcx> ::core::marker::Copy for DropckOutlives<'tcx> { }Copy, #[automatically_derived]
impl<'tcx> ::core::clone::Clone for DropckOutlives<'tcx> {
#[inline]
fn clone(&self) -> DropckOutlives<'tcx> {
let _: ::core::clone::AssertParamIsClone<Ty<'tcx>>;
*self
}
}Clone, #[automatically_derived]
impl<'tcx> ::core::fmt::Debug for DropckOutlives<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"DropckOutlives", "dropped_ty", &&self.dropped_ty)
}
}Debug, #[automatically_derived]
impl<'tcx> ::core::hash::Hash for DropckOutlives<'tcx> {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&self.dropped_ty, state)
}
}Hash, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for DropckOutlives<'tcx> {
#[inline]
fn eq(&self, other: &DropckOutlives<'tcx>) -> bool {
self.dropped_ty == other.dropped_ty
}
}PartialEq, #[automatically_derived]
impl<'tcx> ::core::cmp::Eq for DropckOutlives<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_receiver_is_total_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
}
}Eq, const _: () =
{
impl<'tcx, '__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for DropckOutlives<'tcx> {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
DropckOutlives { dropped_ty: ref __binding_0 } => {
{ __binding_0.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for DropckOutlives<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
DropckOutlives { dropped_ty: __binding_0 } => {
DropckOutlives {
dropped_ty: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
DropckOutlives { dropped_ty: __binding_0 } => {
DropckOutlives {
dropped_ty: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
}
}
}
}
}
};TypeFoldable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for DropckOutlives<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
DropckOutlives { dropped_ty: ref __binding_0 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable)]
63 pub struct DropckOutlives<'tcx> {
64 pub dropped_ty: Ty<'tcx>,
65 }
66}
67
68pub type CanonicalAliasGoal<'tcx> =
69 CanonicalQueryInput<'tcx, ty::ParamEnvAnd<'tcx, ty::AliasTerm<'tcx>>>;
70
71pub type CanonicalMethodAutoderefStepsGoal<'tcx> =
72 CanonicalQueryInput<'tcx, ty::ParamEnvAnd<'tcx, MethodAutoderefSteps<'tcx>>>;
73#[derive(#[automatically_derived]
impl<'tcx> ::core::marker::Copy for MethodAutoderefSteps<'tcx> { }Copy, #[automatically_derived]
impl<'tcx> ::core::clone::Clone for MethodAutoderefSteps<'tcx> {
#[inline]
fn clone(&self) -> MethodAutoderefSteps<'tcx> {
let _:
::core::clone::AssertParamIsClone<solve::PredefinedOpaques<'tcx>>;
let _: ::core::clone::AssertParamIsClone<Ty<'tcx>>;
*self
}
}Clone, #[automatically_derived]
impl<'tcx> ::core::fmt::Debug for MethodAutoderefSteps<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"MethodAutoderefSteps", "predefined_opaques_in_body",
&self.predefined_opaques_in_body, "self_ty", &&self.self_ty)
}
}Debug, #[automatically_derived]
impl<'tcx> ::core::hash::Hash for MethodAutoderefSteps<'tcx> {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&self.predefined_opaques_in_body, state);
::core::hash::Hash::hash(&self.self_ty, state)
}
}Hash, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for MethodAutoderefSteps<'tcx> {
#[inline]
fn eq(&self, other: &MethodAutoderefSteps<'tcx>) -> bool {
self.predefined_opaques_in_body == other.predefined_opaques_in_body &&
self.self_ty == other.self_ty
}
}PartialEq, #[automatically_derived]
impl<'tcx> ::core::cmp::Eq for MethodAutoderefSteps<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_receiver_is_total_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<solve::PredefinedOpaques<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
}
}Eq, const _: () =
{
impl<'tcx, '__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for MethodAutoderefSteps<'tcx> {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
MethodAutoderefSteps {
predefined_opaques_in_body: ref __binding_0,
self_ty: ref __binding_1 } => {
{ __binding_0.hash_stable(__hcx, __hasher); }
{ __binding_1.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for MethodAutoderefSteps<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
MethodAutoderefSteps {
predefined_opaques_in_body: __binding_0,
self_ty: __binding_1 } => {
MethodAutoderefSteps {
predefined_opaques_in_body: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
self_ty: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
MethodAutoderefSteps {
predefined_opaques_in_body: __binding_0,
self_ty: __binding_1 } => {
MethodAutoderefSteps {
predefined_opaques_in_body: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
self_ty: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
}
}
}
}
}
};TypeFoldable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for MethodAutoderefSteps<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
MethodAutoderefSteps {
predefined_opaques_in_body: ref __binding_0,
self_ty: ref __binding_1 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable)]
74pub struct MethodAutoderefSteps<'tcx> {
75 pub predefined_opaques_in_body: solve::PredefinedOpaques<'tcx>,
79 pub self_ty: Ty<'tcx>,
80}
81
82pub type CanonicalPredicateGoal<'tcx> =
83 CanonicalQueryInput<'tcx, ty::ParamEnvAnd<'tcx, ty::Predicate<'tcx>>>;
84
85pub type CanonicalTypeOpAscribeUserTypeGoal<'tcx> =
86 CanonicalQueryInput<'tcx, ty::ParamEnvAnd<'tcx, type_op::AscribeUserType<'tcx>>>;
87
88pub type CanonicalTypeOpProvePredicateGoal<'tcx> =
89 CanonicalQueryInput<'tcx, ty::ParamEnvAnd<'tcx, type_op::ProvePredicate<'tcx>>>;
90
91pub type CanonicalTypeOpNormalizeGoal<'tcx, T> =
92 CanonicalQueryInput<'tcx, ty::ParamEnvAnd<'tcx, type_op::Normalize<T>>>;
93
94pub type CanonicalTypeOpDeeplyNormalizeGoal<'tcx, T> =
95 CanonicalQueryInput<'tcx, ty::ParamEnvAnd<'tcx, type_op::DeeplyNormalize<T>>>;
96
97pub type CanonicalImpliedOutlivesBoundsGoal<'tcx> =
98 CanonicalQueryInput<'tcx, ty::ParamEnvAnd<'tcx, type_op::ImpliedOutlivesBounds<'tcx>>>;
99
100pub type CanonicalDropckOutlivesGoal<'tcx> =
101 CanonicalQueryInput<'tcx, ty::ParamEnvAnd<'tcx, type_op::DropckOutlives<'tcx>>>;
102
103#[derive(#[automatically_derived]
impl<'tcx> ::core::clone::Clone for DropckOutlivesResult<'tcx> {
#[inline]
fn clone(&self) -> DropckOutlivesResult<'tcx> {
DropckOutlivesResult {
kinds: ::core::clone::Clone::clone(&self.kinds),
overflows: ::core::clone::Clone::clone(&self.overflows),
}
}
}Clone, #[automatically_derived]
impl<'tcx> ::core::fmt::Debug for DropckOutlivesResult<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"DropckOutlivesResult", "kinds", &self.kinds, "overflows",
&&self.overflows)
}
}Debug, #[automatically_derived]
impl<'tcx> ::core::default::Default for DropckOutlivesResult<'tcx> {
#[inline]
fn default() -> DropckOutlivesResult<'tcx> {
DropckOutlivesResult {
kinds: ::core::default::Default::default(),
overflows: ::core::default::Default::default(),
}
}
}Default, const _: () =
{
impl<'tcx, '__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for DropckOutlivesResult<'tcx> {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
DropckOutlivesResult {
kinds: ref __binding_0, overflows: ref __binding_1 } => {
{ __binding_0.hash_stable(__hcx, __hasher); }
{ __binding_1.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for DropckOutlivesResult<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
DropckOutlivesResult {
kinds: __binding_0, overflows: __binding_1 } => {
DropckOutlivesResult {
kinds: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
overflows: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
DropckOutlivesResult {
kinds: __binding_0, overflows: __binding_1 } => {
DropckOutlivesResult {
kinds: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
overflows: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
}
}
}
}
}
};TypeFoldable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for DropckOutlivesResult<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
DropckOutlivesResult {
kinds: ref __binding_0, overflows: ref __binding_1 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable)]
104pub struct DropckOutlivesResult<'tcx> {
105 pub kinds: Vec<GenericArg<'tcx>>,
106 pub overflows: Vec<Ty<'tcx>>,
107}
108
109impl<'tcx> DropckOutlivesResult<'tcx> {
110 pub fn report_overflows(&self, tcx: TyCtxt<'tcx>, span: Span, ty: Ty<'tcx>) {
111 if let Some(overflow_ty) = self.overflows.get(0) {
112 tcx.dcx().emit_err(DropCheckOverflow { span, ty, overflow_ty: *overflow_ty });
113 }
114 }
115}
116
117#[derive(#[automatically_derived]
impl<'tcx> ::core::clone::Clone for DropckConstraint<'tcx> {
#[inline]
fn clone(&self) -> DropckConstraint<'tcx> {
DropckConstraint {
outlives: ::core::clone::Clone::clone(&self.outlives),
dtorck_types: ::core::clone::Clone::clone(&self.dtorck_types),
overflows: ::core::clone::Clone::clone(&self.overflows),
}
}
}Clone, #[automatically_derived]
impl<'tcx> ::core::fmt::Debug for DropckConstraint<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f,
"DropckConstraint", "outlives", &self.outlives, "dtorck_types",
&self.dtorck_types, "overflows", &&self.overflows)
}
}Debug, const _: () =
{
impl<'tcx, '__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for DropckConstraint<'tcx> {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
DropckConstraint {
outlives: ref __binding_0,
dtorck_types: ref __binding_1,
overflows: ref __binding_2 } => {
{ __binding_0.hash_stable(__hcx, __hasher); }
{ __binding_1.hash_stable(__hcx, __hasher); }
{ __binding_2.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable)]
120pub struct DropckConstraint<'tcx> {
121 pub outlives: Vec<ty::GenericArg<'tcx>>,
124
125 pub dtorck_types: Vec<Ty<'tcx>>,
127
128 pub overflows: Vec<Ty<'tcx>>,
132}
133
134impl<'tcx> DropckConstraint<'tcx> {
135 pub fn empty() -> DropckConstraint<'tcx> {
136 DropckConstraint { outlives: ::alloc::vec::Vec::new()vec![], dtorck_types: ::alloc::vec::Vec::new()vec![], overflows: ::alloc::vec::Vec::new()vec![] }
137 }
138}
139
140impl<'tcx> FromIterator<DropckConstraint<'tcx>> for DropckConstraint<'tcx> {
141 fn from_iter<I: IntoIterator<Item = DropckConstraint<'tcx>>>(iter: I) -> Self {
142 let mut result = Self::empty();
143
144 for DropckConstraint { outlives, dtorck_types, overflows } in iter {
145 result.outlives.extend(outlives);
146 result.dtorck_types.extend(dtorck_types);
147 result.overflows.extend(overflows);
148 }
149
150 result
151 }
152}
153
154#[derive(#[automatically_derived]
impl<'tcx> ::core::fmt::Debug for CandidateStep<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
let names: &'static _ =
&["self_ty", "self_ty_is_opaque", "autoderefs",
"from_unsafe_deref", "unsize", "reachable_via_deref"];
let values: &[&dyn ::core::fmt::Debug] =
&[&self.self_ty, &self.self_ty_is_opaque, &self.autoderefs,
&self.from_unsafe_deref, &self.unsize,
&&self.reachable_via_deref];
::core::fmt::Formatter::debug_struct_fields_finish(f, "CandidateStep",
names, values)
}
}Debug, const _: () =
{
impl<'tcx, '__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for CandidateStep<'tcx> {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
CandidateStep {
self_ty: ref __binding_0,
self_ty_is_opaque: ref __binding_1,
autoderefs: ref __binding_2,
from_unsafe_deref: ref __binding_3,
unsize: ref __binding_4,
reachable_via_deref: ref __binding_5 } => {
{ __binding_0.hash_stable(__hcx, __hasher); }
{ __binding_1.hash_stable(__hcx, __hasher); }
{ __binding_2.hash_stable(__hcx, __hasher); }
{ __binding_3.hash_stable(__hcx, __hasher); }
{ __binding_4.hash_stable(__hcx, __hasher); }
{ __binding_5.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable)]
155pub struct CandidateStep<'tcx> {
156 pub self_ty: Canonical<'tcx, QueryResponse<'tcx, Ty<'tcx>>>,
157 pub self_ty_is_opaque: bool,
158 pub autoderefs: usize,
159 pub from_unsafe_deref: bool,
165 pub unsize: bool,
166 pub reachable_via_deref: bool,
175}
176
177#[derive(#[automatically_derived]
impl<'tcx> ::core::marker::Copy for MethodAutoderefStepsResult<'tcx> { }Copy, #[automatically_derived]
impl<'tcx> ::core::clone::Clone for MethodAutoderefStepsResult<'tcx> {
#[inline]
fn clone(&self) -> MethodAutoderefStepsResult<'tcx> {
let _: ::core::clone::AssertParamIsClone<&'tcx [CandidateStep<'tcx>]>;
let _:
::core::clone::AssertParamIsClone<Option<&'tcx MethodAutoderefBadTy<'tcx>>>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]
impl<'tcx> ::core::fmt::Debug for MethodAutoderefStepsResult<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f,
"MethodAutoderefStepsResult", "steps", &self.steps, "opt_bad_ty",
&self.opt_bad_ty, "reached_recursion_limit",
&&self.reached_recursion_limit)
}
}Debug, const _: () =
{
impl<'tcx, '__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for MethodAutoderefStepsResult<'tcx> {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
MethodAutoderefStepsResult {
steps: ref __binding_0,
opt_bad_ty: ref __binding_1,
reached_recursion_limit: ref __binding_2 } => {
{ __binding_0.hash_stable(__hcx, __hasher); }
{ __binding_1.hash_stable(__hcx, __hasher); }
{ __binding_2.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable)]
178pub struct MethodAutoderefStepsResult<'tcx> {
179 pub steps: &'tcx [CandidateStep<'tcx>],
182 pub opt_bad_ty: Option<&'tcx MethodAutoderefBadTy<'tcx>>,
184 pub reached_recursion_limit: bool,
187}
188
189#[derive(#[automatically_derived]
impl<'tcx> ::core::fmt::Debug for MethodAutoderefBadTy<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"MethodAutoderefBadTy", "reached_raw_pointer",
&self.reached_raw_pointer, "ty", &&self.ty)
}
}Debug, const _: () =
{
impl<'tcx, '__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for MethodAutoderefBadTy<'tcx> {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
MethodAutoderefBadTy {
reached_raw_pointer: ref __binding_0, ty: ref __binding_1 }
=> {
{ __binding_0.hash_stable(__hcx, __hasher); }
{ __binding_1.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable)]
190pub struct MethodAutoderefBadTy<'tcx> {
191 pub reached_raw_pointer: bool,
192 pub ty: Canonical<'tcx, QueryResponse<'tcx, Ty<'tcx>>>,
193}
194
195#[derive(#[automatically_derived]
impl<'tcx> ::core::clone::Clone for NormalizationResult<'tcx> {
#[inline]
fn clone(&self) -> NormalizationResult<'tcx> {
NormalizationResult {
normalized_term: ::core::clone::Clone::clone(&self.normalized_term),
}
}
}Clone, #[automatically_derived]
impl<'tcx> ::core::fmt::Debug for NormalizationResult<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f,
"NormalizationResult", "normalized_term", &&self.normalized_term)
}
}Debug, const _: () =
{
impl<'tcx, '__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for NormalizationResult<'tcx> {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
NormalizationResult { normalized_term: ref __binding_0 } =>
{
{ __binding_0.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for NormalizationResult<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
NormalizationResult { normalized_term: __binding_0 } => {
NormalizationResult {
normalized_term: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
NormalizationResult { normalized_term: __binding_0 } => {
NormalizationResult {
normalized_term: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
}
}
}
}
}
};TypeFoldable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for NormalizationResult<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
NormalizationResult { normalized_term: ref __binding_0 } =>
{
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable)]
197pub struct NormalizationResult<'tcx> {
198 pub normalized_term: ty::Term<'tcx>,
200}
201
202#[derive(#[automatically_derived]
impl<'tcx> ::core::marker::Copy for OutlivesBound<'tcx> { }Copy, #[automatically_derived]
impl<'tcx> ::core::clone::Clone for OutlivesBound<'tcx> {
#[inline]
fn clone(&self) -> OutlivesBound<'tcx> {
let _: ::core::clone::AssertParamIsClone<ty::Region<'tcx>>;
let _: ::core::clone::AssertParamIsClone<ty::Region<'tcx>>;
let _: ::core::clone::AssertParamIsClone<ty::Region<'tcx>>;
let _: ::core::clone::AssertParamIsClone<ty::ParamTy>;
let _: ::core::clone::AssertParamIsClone<ty::Region<'tcx>>;
let _: ::core::clone::AssertParamIsClone<ty::AliasTy<'tcx>>;
*self
}
}Clone, #[automatically_derived]
impl<'tcx> ::core::fmt::Debug for OutlivesBound<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
match self {
OutlivesBound::RegionSubRegion(__self_0, __self_1) =>
::core::fmt::Formatter::debug_tuple_field2_finish(f,
"RegionSubRegion", __self_0, &__self_1),
OutlivesBound::RegionSubParam(__self_0, __self_1) =>
::core::fmt::Formatter::debug_tuple_field2_finish(f,
"RegionSubParam", __self_0, &__self_1),
OutlivesBound::RegionSubAlias(__self_0, __self_1) =>
::core::fmt::Formatter::debug_tuple_field2_finish(f,
"RegionSubAlias", __self_0, &__self_1),
}
}
}Debug, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for OutlivesBound<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
OutlivesBound::RegionSubRegion(__binding_0, __binding_1) =>
{
OutlivesBound::RegionSubRegion(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?)
}
OutlivesBound::RegionSubParam(__binding_0, __binding_1) => {
OutlivesBound::RegionSubParam(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?)
}
OutlivesBound::RegionSubAlias(__binding_0, __binding_1) => {
OutlivesBound::RegionSubAlias(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?)
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
OutlivesBound::RegionSubRegion(__binding_0, __binding_1) =>
{
OutlivesBound::RegionSubRegion(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder))
}
OutlivesBound::RegionSubParam(__binding_0, __binding_1) => {
OutlivesBound::RegionSubParam(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder))
}
OutlivesBound::RegionSubAlias(__binding_0, __binding_1) => {
OutlivesBound::RegionSubAlias(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder))
}
}
}
}
};TypeFoldable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for OutlivesBound<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
OutlivesBound::RegionSubRegion(ref __binding_0,
ref __binding_1) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
OutlivesBound::RegionSubParam(ref __binding_0,
ref __binding_1) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
OutlivesBound::RegionSubAlias(ref __binding_0,
ref __binding_1) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable, const _: () =
{
impl<'tcx, '__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for OutlivesBound<'tcx> {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
::std::mem::discriminant(self).hash_stable(__hcx, __hasher);
match *self {
OutlivesBound::RegionSubRegion(ref __binding_0,
ref __binding_1) => {
{ __binding_0.hash_stable(__hcx, __hasher); }
{ __binding_1.hash_stable(__hcx, __hasher); }
}
OutlivesBound::RegionSubParam(ref __binding_0,
ref __binding_1) => {
{ __binding_0.hash_stable(__hcx, __hasher); }
{ __binding_1.hash_stable(__hcx, __hasher); }
}
OutlivesBound::RegionSubAlias(ref __binding_0,
ref __binding_1) => {
{ __binding_0.hash_stable(__hcx, __hasher); }
{ __binding_1.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable)]
210pub enum OutlivesBound<'tcx> {
211 RegionSubRegion(ty::Region<'tcx>, ty::Region<'tcx>),
212 RegionSubParam(ty::Region<'tcx>, ty::ParamTy),
213 RegionSubAlias(ty::Region<'tcx>, ty::AliasTy<'tcx>),
214}