1use rustc_data_structures::transitive_relation::TransitiveRelation;
63use rustc_data_structures::undo_log::UndoLogs;
64use rustc_middle::bug;
65use rustc_middle::mir::ConstraintCategory;
66use rustc_middle::ty::outlives::{Component, push_outlives_components};
67use rustc_middle::ty::{
68 self, GenericArgKind, GenericArgsRef, PolyTypeOutlivesClause, Region, RegionExt, RegionVid, Ty,
69 TyCtxt, TypeVisitableExt, eager_resolve_vars,
70};
71use rustc_span::Span;
72use smallvec::smallvec;
73use tracing::{debug, instrument};
74
75use super::env::OutlivesEnvironment;
76use crate::infer::outlives::env::RegionBoundPairs;
77use crate::infer::outlives::verify::VerifyBoundCx;
78use crate::infer::snapshot::undo_log::UndoLog;
79use crate::infer::{
80 self, GenericKind, InferCtxt, SolverRegionConstraint, SubregionOrigin, TypeOutlivesConstraint,
81 VerifyBound,
82};
83use crate::traits::{ObligationCause, ObligationCauseCode};
84
85impl<'tcx> InferCtxt<'tcx> {
86 pub fn register_outlives_constraint(
87 &self,
88 ty::OutlivesClause(arg, r2): ty::ArgOutlivesClause<'tcx>,
89 vis: ty::VisibleForLeakCheck,
90 cause: &ObligationCause<'tcx>,
91 ) {
92 match arg.kind() {
93 ty::GenericArgKind::Lifetime(r1) => {
94 self.register_region_outlives_constraint(ty::OutlivesClause(r1, r2), vis, cause);
95 }
96 ty::GenericArgKind::Type(ty1) => {
97 self.register_type_outlives_constraint(ty1, r2, cause);
98 }
99 ty::GenericArgKind::Const(_) => ::core::panicking::panic("internal error: entered unreachable code")unreachable!(),
100 }
101 }
102
103 pub fn register_region_eq_constraint(
104 &self,
105 ty::RegionEqPredicate(r_a, r_b): ty::RegionEqPredicate<'tcx>,
106 vis: ty::VisibleForLeakCheck,
107 cause: &ObligationCause<'tcx>,
108 ) {
109 let origin = SubregionOrigin::from_obligation_cause(cause, || {
110 SubregionOrigin::RelateRegionParamBound(cause.span, None)
111 });
112 self.equate_regions(origin, r_a, r_b, vis);
113 }
114
115 pub fn register_region_outlives_constraint(
116 &self,
117 ty::OutlivesClause(r_a, r_b): ty::RegionOutlivesClause<'tcx>,
118 vis: ty::VisibleForLeakCheck,
119 cause: &ObligationCause<'tcx>,
120 ) {
121 let origin = SubregionOrigin::from_obligation_cause(cause, || {
122 SubregionOrigin::RelateRegionParamBound(cause.span, None)
123 });
124 self.sub_regions(origin, r_b, r_a, vis);
126 }
127
128 #[allow(clippy :: suspicious_else_formatting)]
{
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() ||
{ false } {
__tracing_attr_span =
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("register_type_outlives_constraint_inner",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(133u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("obligation")
}> =
::tracing::__macro_support::FieldName::new("obligation");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::SPAN)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let mut interest = ::tracing::subscriber::Interest::never();
if ::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{ interest = __CALLSITE.interest(); !interest.is_never() }
&&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest) {
let meta = __CALLSITE.metadata();
::tracing::Span::new(meta,
&{
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&obligation)
as &dyn ::tracing::field::Value))])
})
} else {
let span =
::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
{};
span
}
};
__tracing_attr_guard = __tracing_attr_span.enter();
}
#[warn(clippy :: suspicious_else_formatting)]
{
#[allow(unknown_lints, unreachable_code, clippy ::
diverging_sub_expression, clippy :: empty_loop, clippy ::
let_unit_value, clippy :: let_with_type_underscore, clippy ::
needless_return, clippy :: unreachable)]
if false {
let __tracing_attr_fake_return: () = loop {};
return __tracing_attr_fake_return;
}
{
let mut inner = self.inner.borrow_mut();
inner.undo_log.push(UndoLog::PushTypeOutlivesConstraint);
inner.region_obligations.push(obligation);
}
}
}#[instrument(level = "debug", skip(self))]
134 pub fn register_type_outlives_constraint_inner(
135 &self,
136 obligation: TypeOutlivesConstraint<'tcx>,
137 ) {
138 let mut inner = self.inner.borrow_mut();
139 inner.undo_log.push(UndoLog::PushTypeOutlivesConstraint);
140 inner.region_obligations.push(obligation);
141 }
142
143 pub fn register_solver_region_constraint(&self, c: SolverRegionConstraint<'tcx>) {
144 let mut inner = self.inner.borrow_mut();
145 let previous_was_and = inner.solver_region_constraint_storage.is_and();
146 inner.undo_log.push(UndoLog::PushSolverRegionConstraint { previous_was_and });
147 inner.solver_region_constraint_storage.push(c);
148 }
149
150 pub fn register_type_outlives_constraint(
151 &self,
152 sup_type: Ty<'tcx>,
153 sub_region: Region<'tcx>,
154 cause: &ObligationCause<'tcx>,
155 ) {
156 if !!self.tcx.assumptions_on_binders() {
::core::panicking::panic("assertion failed: !self.tcx.assumptions_on_binders()")
};assert!(!self.tcx.assumptions_on_binders());
157
158 if sup_type.is_global() {
163 return;
164 }
165
166 {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event compiler/rustc_infer/src/infer/outlives/obligations.rs:166",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(166u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("sup_type")
}> =
::tracing::__macro_support::FieldName::new("sup_type");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("sub_region")
}> =
::tracing::__macro_support::FieldName::new("sub_region");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("cause")
}> =
::tracing::__macro_support::FieldName::new("cause");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&sup_type)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&sub_region)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&cause)
as &dyn ::tracing::field::Value))])
});
} else { ; }
};debug!(?sup_type, ?sub_region, ?cause);
167 let origin = SubregionOrigin::from_obligation_cause(cause, || {
168 SubregionOrigin::RelateParamBound(
169 cause.span,
170 sup_type,
171 match cause.code().peel_derives() {
172 ObligationCauseCode::WhereClause(_, span)
173 | ObligationCauseCode::WhereClauseInExpr(_, span, ..)
174 | ObligationCauseCode::OpaqueTypeBound(span, _)
175 if !span.is_dummy() =>
176 {
177 Some(*span)
178 }
179 _ => None,
180 },
181 )
182 });
183
184 self.register_type_outlives_constraint_inner(TypeOutlivesConstraint {
185 sup_type,
186 sub_region,
187 origin,
188 });
189 }
190
191 pub fn take_registered_region_obligations(&self) -> Vec<TypeOutlivesConstraint<'tcx>> {
193 if !!self.in_snapshot() {
{
::core::panicking::panic_fmt(format_args!("cannot take registered region obligations in a snapshot"));
}
};assert!(!self.in_snapshot(), "cannot take registered region obligations in a snapshot");
194 std::mem::take(&mut self.inner.borrow_mut().region_obligations)
195 }
196
197 pub fn num_registered_region_obligations(&self) -> usize {
198 self.inner.borrow().region_obligations.len()
199 }
200
201 pub fn registered_region_obligations_since(
202 &self,
203 prev: usize,
204 ) -> Vec<TypeOutlivesConstraint<'tcx>> {
205 self.inner.borrow().region_obligations.iter().skip(prev).cloned().collect()
206 }
207
208 pub fn clone_registered_region_obligations(&self) -> Vec<TypeOutlivesConstraint<'tcx>> {
209 self.inner.borrow().region_obligations.clone()
210 }
211
212 pub fn register_region_assumption(&self, assumption: ty::ArgOutlivesClause<'tcx>) {
213 let mut inner = self.inner.borrow_mut();
214 inner.undo_log.push(UndoLog::PushRegionAssumption);
215 inner.region_assumptions.push(assumption);
216 }
217
218 pub fn take_registered_region_assumptions(&self) -> Vec<ty::ArgOutlivesClause<'tcx>> {
219 if !!self.in_snapshot() {
{
::core::panicking::panic_fmt(format_args!("cannot take registered region assumptions in a snapshot"));
}
};assert!(!self.in_snapshot(), "cannot take registered region assumptions in a snapshot");
220 std::mem::take(&mut self.inner.borrow_mut().region_assumptions)
221 }
222
223 pub fn destructure_solver_region_constraints_for_regionck(
224 &self,
225 outlives_env: &OutlivesEnvironment<'tcx>,
226 ) {
227 let assumptions = rustc_type_ir::region_constraint::Assumptions::new(
228 outlives_env.known_type_outlives().into_iter().cloned().collect(),
229 outlives_env.free_region_map().relation.clone(),
230 );
231 self.destructure_solver_region_constraints(assumptions, self);
232 }
233
234 pub fn destructure_solver_region_constraints_for_borrowck(
235 &self,
236 conversion: impl TypeOutlivesDelegate<'tcx>,
238 known_type_outlives: &[PolyTypeOutlivesClause<'tcx>],
239 region_outlives: TransitiveRelation<RegionVid>,
240 ) {
241 let assumptions = rustc_type_ir::region_constraint::Assumptions::new(
242 known_type_outlives.into_iter().cloned().collect(),
243 region_outlives.maybe_map(|r| Some(Region::new_var(self.tcx, r))).unwrap(),
244 );
245 self.destructure_solver_region_constraints(assumptions, conversion);
246 }
247
248 #[allow(clippy :: suspicious_else_formatting)]
{
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() ||
{ false } {
__tracing_attr_span =
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("destructure_solver_region_constraints",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(248u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("assumptions")
}> =
::tracing::__macro_support::FieldName::new("assumptions");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::SPAN)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let mut interest = ::tracing::subscriber::Interest::never();
if ::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{ interest = __CALLSITE.interest(); !interest.is_never() }
&&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest) {
let meta = __CALLSITE.metadata();
::tracing::Span::new(meta,
&{
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&assumptions)
as &dyn ::tracing::field::Value))])
})
} else {
let span =
::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
{};
span
}
};
__tracing_attr_guard = __tracing_attr_span.enter();
}
#[warn(clippy :: suspicious_else_formatting)]
{
#[allow(unknown_lints, unreachable_code, clippy ::
diverging_sub_expression, clippy :: empty_loop, clippy ::
let_unit_value, clippy :: let_with_type_underscore, clippy ::
needless_return, clippy :: unreachable)]
if false {
let __tracing_attr_fake_return: () = loop {};
return __tracing_attr_fake_return;
}
{
if !self.tcx.assumptions_on_binders() {
::core::panicking::panic("assertion failed: self.tcx.assumptions_on_binders()")
};
if !self.next_trait_solver() {
::core::panicking::panic("assertion failed: self.next_trait_solver()")
};
let constraint =
self.inner.borrow().solver_region_constraint_storage.get_constraint();
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event compiler/rustc_infer/src/infer/outlives/obligations.rs:258",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(258u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("constraint")
}> =
::tracing::__macro_support::FieldName::new("constraint");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&constraint)
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
let constraint =
rustc_type_ir::region_constraint::destructure_type_outlives_constraints_in_root(self,
constraint, &assumptions);
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event compiler/rustc_infer/src/infer/outlives/obligations.rs:265",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(265u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("constraint")
}> =
::tracing::__macro_support::FieldName::new("constraint");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&constraint)
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
let constraint =
rustc_type_ir::region_constraint::evaluate_solver_constraint(&constraint);
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event compiler/rustc_infer/src/infer/outlives/obligations.rs:267",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(267u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("constraint")
}> =
::tracing::__macro_support::FieldName::new("constraint");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&constraint)
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
let mut constraints =
::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
[constraint]));
while let Some(c) = constraints.pop() {
use rustc_type_ir::region_constraint::RegionConstraint::*;
match c {
Ambiguity(span) => {
self.dcx().struct_span_err(span,
"unable to satisfy constraints involving placeholders due to unknown implied bounds").emit();
}
RegionOutlives(a, b, span) => {
let origin = SubregionOrigin::SolverRegionConstraint(span);
let category = origin.to_constraint_category();
conversion.push_sub_region_constraint(origin, b, a,
category);
}
And(nested) | Or(nested) => constraints.extend(nested),
AliasTyOutlivesViaEnv(..) | PlaceholderTyOutlives(..) =>
::core::panicking::panic("internal error: entered unreachable code"),
}
}
}
}
}#[instrument(level = "debug", skip(self, conversion))]
249 pub fn destructure_solver_region_constraints(
250 &self,
251 assumptions: rustc_type_ir::region_constraint::Assumptions<TyCtxt<'tcx>>,
252 mut conversion: impl TypeOutlivesDelegate<'tcx>,
253 ) {
254 assert!(self.tcx.assumptions_on_binders());
255 assert!(self.next_trait_solver());
256
257 let constraint = self.inner.borrow().solver_region_constraint_storage.get_constraint();
258 debug!(?constraint);
259 let constraint =
260 rustc_type_ir::region_constraint::destructure_type_outlives_constraints_in_root(
261 self,
262 constraint,
263 &assumptions,
264 );
265 debug!(?constraint);
266 let constraint = rustc_type_ir::region_constraint::evaluate_solver_constraint(&constraint);
267 debug!(?constraint);
268
269 let mut constraints = vec![constraint];
270 while let Some(c) = constraints.pop() {
271 use rustc_type_ir::region_constraint::RegionConstraint::*;
272
273 match c {
274 Ambiguity(span) => {
275 self.dcx()
276 .struct_span_err(
277 span,
278 "unable to satisfy constraints involving placeholders due to unknown implied bounds",
279 )
280 .emit();
281 }
282 RegionOutlives(a, b, span) => {
283 let origin = SubregionOrigin::SolverRegionConstraint(span);
284 let category = origin.to_constraint_category();
285 conversion.push_sub_region_constraint(
286 origin, b, a, category,
288 );
289 }
290 And(nested) | Or(nested) => constraints.extend(nested),
292 AliasTyOutlivesViaEnv(..) | PlaceholderTyOutlives(..) => unreachable!(),
293 }
294 }
295 }
296
297 #[allow(clippy :: suspicious_else_formatting)]
{
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() ||
{ false } {
__tracing_attr_span =
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("process_registered_region_obligations",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(306u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("span")
}> =
::tracing::__macro_support::FieldName::new("span");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::SPAN)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let mut interest = ::tracing::subscriber::Interest::never();
if ::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{ interest = __CALLSITE.interest(); !interest.is_never() }
&&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest) {
let meta = __CALLSITE.metadata();
::tracing::Span::new(meta,
&{
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&span)
as &dyn ::tracing::field::Value))])
})
} else {
let span =
::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
{};
span
}
};
__tracing_attr_guard = __tracing_attr_span.enter();
}
#[warn(clippy :: suspicious_else_formatting)]
{
#[allow(unknown_lints, unreachable_code, clippy ::
diverging_sub_expression, clippy :: empty_loop, clippy ::
let_unit_value, clippy :: let_with_type_underscore, clippy ::
needless_return, clippy :: unreachable)]
if false {
let __tracing_attr_fake_return: () = loop {};
return __tracing_attr_fake_return;
}
{
if !!self.in_snapshot() {
{
::core::panicking::panic_fmt(format_args!("cannot process registered region obligations in a snapshot"));
}
};
if self.tcx.assumptions_on_binders() {
self.destructure_solver_region_constraints_for_regionck(outlives_env);
}
for iteration in 0.. {
let my_region_obligations =
self.take_registered_region_obligations();
if my_region_obligations.is_empty() { break; }
if !self.tcx.recursion_limit().value_within_limit(iteration) {
::rustc_middle::util::bug::bug_fmt(format_args!("unexpected overflowed when processing region obligations: {0:#?}",
my_region_obligations));
}
for TypeOutlivesConstraint { sup_type, sub_region, origin } in
my_region_obligations {
let (sup_type, sub_region) =
eager_resolve_vars(self, (sup_type, sub_region));
if self.tcx.sess.opts.unstable_opts.higher_ranked_assumptions
&&
outlives_env.higher_ranked_assumptions().contains(&ty::OutlivesClause(sup_type.into(),
sub_region)) {
continue;
}
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event compiler/rustc_infer/src/infer/outlives/obligations.rs:348",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(348u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("sup_type")
}> =
::tracing::__macro_support::FieldName::new("sup_type");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("sub_region")
}> =
::tracing::__macro_support::FieldName::new("sub_region");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("origin")
}> =
::tracing::__macro_support::FieldName::new("origin");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&sup_type)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&sub_region)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&origin)
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
let outlives =
&mut TypeOutlives::new(self, self.tcx,
outlives_env.region_bound_pairs(), None,
outlives_env.known_type_outlives());
let category = origin.to_constraint_category();
outlives.type_must_outlive(origin, sup_type, sub_region,
category);
}
}
}
}
}#[instrument(level = "debug", skip(self, outlives_env))]
307 pub fn process_registered_region_obligations(
308 &self,
309 outlives_env: &OutlivesEnvironment<'tcx>,
310 span: Span,
311 ) {
312 assert!(!self.in_snapshot(), "cannot process registered region obligations in a snapshot");
313
314 if self.tcx.assumptions_on_binders() {
315 self.destructure_solver_region_constraints_for_regionck(outlives_env);
316 }
317
318 for iteration in 0.. {
320 let my_region_obligations = self.take_registered_region_obligations();
321 if my_region_obligations.is_empty() {
322 break;
323 }
324
325 if !self.tcx.recursion_limit().value_within_limit(iteration) {
326 bug!(
330 "unexpected overflowed when processing region obligations: {my_region_obligations:#?}"
331 );
332 }
333
334 for TypeOutlivesConstraint { sup_type, sub_region, origin } in my_region_obligations {
335 let (sup_type, sub_region) = eager_resolve_vars(self, (sup_type, sub_region));
339
340 if self.tcx.sess.opts.unstable_opts.higher_ranked_assumptions
341 && outlives_env
342 .higher_ranked_assumptions()
343 .contains(&ty::OutlivesClause(sup_type.into(), sub_region))
344 {
345 continue;
346 }
347
348 debug!(?sup_type, ?sub_region, ?origin);
349
350 let outlives = &mut TypeOutlives::new(
351 self,
352 self.tcx,
353 outlives_env.region_bound_pairs(),
354 None,
355 outlives_env.known_type_outlives(),
356 );
357 let category = origin.to_constraint_category();
358 outlives.type_must_outlive(origin, sup_type, sub_region, category);
359 }
360 }
361 }
362}
363
364pub struct TypeOutlives<'cx, 'tcx, D>
371where
372 D: TypeOutlivesDelegate<'tcx>,
373{
374 delegate: D,
377 tcx: TyCtxt<'tcx>,
378 verify_bound: VerifyBoundCx<'cx, 'tcx>,
379}
380
381pub trait TypeOutlivesDelegate<'tcx> {
382 fn push_sub_region_constraint(
383 &mut self,
384 origin: SubregionOrigin<'tcx>,
385 a: ty::Region<'tcx>,
386 b: ty::Region<'tcx>,
387 constraint_category: ConstraintCategory<'tcx>,
388 );
389
390 fn push_verify(
391 &mut self,
392 origin: SubregionOrigin<'tcx>,
393 kind: GenericKind<'tcx>,
394 a: ty::Region<'tcx>,
395 bound: VerifyBound<'tcx>,
396 );
397}
398
399impl<'cx, 'tcx, D> TypeOutlives<'cx, 'tcx, D>
400where
401 D: TypeOutlivesDelegate<'tcx>,
402{
403 pub fn new(
404 delegate: D,
405 tcx: TyCtxt<'tcx>,
406 region_bound_pairs: &'cx RegionBoundPairs<'tcx>,
407 implicit_region_bound: Option<ty::Region<'tcx>>,
408 caller_bounds: &'cx [ty::PolyTypeOutlivesClause<'tcx>],
409 ) -> Self {
410 Self {
411 delegate,
412 tcx,
413 verify_bound: VerifyBoundCx::new(
414 tcx,
415 region_bound_pairs,
416 implicit_region_bound,
417 caller_bounds,
418 ),
419 }
420 }
421
422 #[allow(clippy :: suspicious_else_formatting)]
{
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() ||
{ false } {
__tracing_attr_span =
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("type_must_outlive",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(430u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("origin")
}> =
::tracing::__macro_support::FieldName::new("origin");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("ty")
}> =
::tracing::__macro_support::FieldName::new("ty");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("region")
}> =
::tracing::__macro_support::FieldName::new("region");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("category")
}> =
::tracing::__macro_support::FieldName::new("category");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::SPAN)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let mut interest = ::tracing::subscriber::Interest::never();
if ::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{ interest = __CALLSITE.interest(); !interest.is_never() }
&&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest) {
let meta = __CALLSITE.metadata();
::tracing::Span::new(meta,
&{
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&origin)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&ty)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(®ion)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&category)
as &dyn ::tracing::field::Value))])
})
} else {
let span =
::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
{};
span
}
};
__tracing_attr_guard = __tracing_attr_span.enter();
}
#[warn(clippy :: suspicious_else_formatting)]
{
#[allow(unknown_lints, unreachable_code, clippy ::
diverging_sub_expression, clippy :: empty_loop, clippy ::
let_unit_value, clippy :: let_with_type_underscore, clippy ::
needless_return, clippy :: unreachable)]
if false {
let __tracing_attr_fake_return: () = loop {};
return __tracing_attr_fake_return;
}
{
if !!ty.has_escaping_bound_vars() {
::core::panicking::panic("assertion failed: !ty.has_escaping_bound_vars()")
};
if true {
if !!ty.has_non_region_infer() {
::core::panicking::panic("assertion failed: !ty.has_non_region_infer()")
};
};
if true {
if !(!self.tcx.next_trait_solver_globally() ||
!ty.has_non_rigid_aliases()) {
{
::core::panicking::panic_fmt(format_args!("{0:?} has non-rigid aliases",
ty));
}
};
};
let mut components = ::smallvec::SmallVec::new();
push_outlives_components(self.tcx, ty, &mut components);
self.components_must_outlive(origin, &components, region,
category);
}
}
}#[instrument(level = "debug", skip(self))]
431 pub fn type_must_outlive(
432 &mut self,
433 origin: infer::SubregionOrigin<'tcx>,
434 ty: Ty<'tcx>,
435 region: ty::Region<'tcx>,
436 category: ConstraintCategory<'tcx>,
437 ) {
438 assert!(!ty.has_escaping_bound_vars());
439 debug_assert!(!ty.has_non_region_infer());
440 debug_assert!(
441 !self.tcx.next_trait_solver_globally() || !ty.has_non_rigid_aliases(),
442 "{ty:?} has non-rigid aliases"
443 );
444
445 let mut components = smallvec![];
446 push_outlives_components(self.tcx, ty, &mut components);
447 self.components_must_outlive(origin, &components, region, category);
448 }
449
450 fn components_must_outlive(
451 &mut self,
452 origin: infer::SubregionOrigin<'tcx>,
453 components: &[Component<TyCtxt<'tcx>>],
454 region: ty::Region<'tcx>,
455 category: ConstraintCategory<'tcx>,
456 ) {
457 for component in components.iter() {
458 let origin = origin.clone();
459 match component {
460 Component::Region(region1) => {
461 self.delegate.push_sub_region_constraint(origin, region, *region1, category);
462 }
463 Component::Param(param_ty) => {
464 self.param_ty_must_outlive(origin, region, *param_ty);
465 }
466 Component::Placeholder(placeholder_ty) => {
467 self.placeholder_ty_must_outlive(origin, region, *placeholder_ty);
468 }
469 Component::Alias(is_rigid, alias_ty) => {
470 if true {
{
match (&*is_rigid, &ty::IsRigid::yes_if_next_solver(self.tcx)) {
(left_val, right_val) => {
if !(*left_val == *right_val) {
let kind = ::core::panicking::AssertKind::Eq;
::core::panicking::assert_failed(kind, &*left_val,
&*right_val, ::core::option::Option::None);
}
}
}
};
};debug_assert_eq!(*is_rigid, ty::IsRigid::yes_if_next_solver(self.tcx));
471 self.alias_ty_must_outlive(origin, region, *alias_ty);
472 }
473 Component::EscapingAlias(subcomponents) => {
474 self.components_must_outlive(origin, subcomponents, region, category);
475 }
476 Component::UnresolvedInferenceVariable(v) => {
477 self.tcx.dcx().span_delayed_bug(
481 origin.span(),
482 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("unresolved inference variable in outlives: {0:?}",
v))
})format!("unresolved inference variable in outlives: {v:?}"),
483 );
484 }
485 }
486 }
487 }
488
489 #[allow(clippy :: suspicious_else_formatting)]
{
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() ||
{ false } {
__tracing_attr_span =
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("param_ty_must_outlive",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(489u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("origin")
}> =
::tracing::__macro_support::FieldName::new("origin");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("region")
}> =
::tracing::__macro_support::FieldName::new("region");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("param_ty")
}> =
::tracing::__macro_support::FieldName::new("param_ty");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::SPAN)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let mut interest = ::tracing::subscriber::Interest::never();
if ::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{ interest = __CALLSITE.interest(); !interest.is_never() }
&&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest) {
let meta = __CALLSITE.metadata();
::tracing::Span::new(meta,
&{
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&origin)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(®ion)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(¶m_ty)
as &dyn ::tracing::field::Value))])
})
} else {
let span =
::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
{};
span
}
};
__tracing_attr_guard = __tracing_attr_span.enter();
}
#[warn(clippy :: suspicious_else_formatting)]
{
#[allow(unknown_lints, unreachable_code, clippy ::
diverging_sub_expression, clippy :: empty_loop, clippy ::
let_unit_value, clippy :: let_with_type_underscore, clippy ::
needless_return, clippy :: unreachable)]
if false {
let __tracing_attr_fake_return: () = loop {};
return __tracing_attr_fake_return;
}
{
let verify_bound =
self.verify_bound.param_or_placeholder_bound(param_ty.to_ty(self.tcx));
self.delegate.push_verify(origin, GenericKind::Param(param_ty),
region, verify_bound);
}
}
}#[instrument(level = "debug", skip(self))]
490 fn param_ty_must_outlive(
491 &mut self,
492 origin: infer::SubregionOrigin<'tcx>,
493 region: ty::Region<'tcx>,
494 param_ty: ty::ParamTy,
495 ) {
496 let verify_bound = self.verify_bound.param_or_placeholder_bound(param_ty.to_ty(self.tcx));
497 self.delegate.push_verify(origin, GenericKind::Param(param_ty), region, verify_bound);
498 }
499
500 #[allow(clippy :: suspicious_else_formatting)]
{
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() ||
{ false } {
__tracing_attr_span =
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("placeholder_ty_must_outlive",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(500u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("origin")
}> =
::tracing::__macro_support::FieldName::new("origin");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("region")
}> =
::tracing::__macro_support::FieldName::new("region");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("placeholder_ty")
}> =
::tracing::__macro_support::FieldName::new("placeholder_ty");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::SPAN)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let mut interest = ::tracing::subscriber::Interest::never();
if ::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{ interest = __CALLSITE.interest(); !interest.is_never() }
&&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest) {
let meta = __CALLSITE.metadata();
::tracing::Span::new(meta,
&{
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&origin)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(®ion)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&placeholder_ty)
as &dyn ::tracing::field::Value))])
})
} else {
let span =
::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
{};
span
}
};
__tracing_attr_guard = __tracing_attr_span.enter();
}
#[warn(clippy :: suspicious_else_formatting)]
{
#[allow(unknown_lints, unreachable_code, clippy ::
diverging_sub_expression, clippy :: empty_loop, clippy ::
let_unit_value, clippy :: let_with_type_underscore, clippy ::
needless_return, clippy :: unreachable)]
if false {
let __tracing_attr_fake_return: () = loop {};
return __tracing_attr_fake_return;
}
{
let verify_bound =
self.verify_bound.param_or_placeholder_bound(Ty::new_placeholder(self.tcx,
placeholder_ty));
self.delegate.push_verify(origin,
GenericKind::Placeholder(placeholder_ty), region,
verify_bound);
}
}
}#[instrument(level = "debug", skip(self))]
501 fn placeholder_ty_must_outlive(
502 &mut self,
503 origin: infer::SubregionOrigin<'tcx>,
504 region: ty::Region<'tcx>,
505 placeholder_ty: ty::PlaceholderType<'tcx>,
506 ) {
507 let verify_bound = self
508 .verify_bound
509 .param_or_placeholder_bound(Ty::new_placeholder(self.tcx, placeholder_ty));
510 self.delegate.push_verify(
511 origin,
512 GenericKind::Placeholder(placeholder_ty),
513 region,
514 verify_bound,
515 );
516 }
517
518 #[allow(clippy :: suspicious_else_formatting)]
{
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() ||
{ false } {
__tracing_attr_span =
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("alias_ty_must_outlive",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(518u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("origin")
}> =
::tracing::__macro_support::FieldName::new("origin");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("region")
}> =
::tracing::__macro_support::FieldName::new("region");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("alias_ty")
}> =
::tracing::__macro_support::FieldName::new("alias_ty");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::SPAN)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let mut interest = ::tracing::subscriber::Interest::never();
if ::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{ interest = __CALLSITE.interest(); !interest.is_never() }
&&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest) {
let meta = __CALLSITE.metadata();
::tracing::Span::new(meta,
&{
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&origin)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(®ion)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&alias_ty)
as &dyn ::tracing::field::Value))])
})
} else {
let span =
::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
{};
span
}
};
__tracing_attr_guard = __tracing_attr_span.enter();
}
#[warn(clippy :: suspicious_else_formatting)]
{
#[allow(unknown_lints, unreachable_code, clippy ::
diverging_sub_expression, clippy :: empty_loop, clippy ::
let_unit_value, clippy :: let_with_type_underscore, clippy ::
needless_return, clippy :: unreachable)]
if false {
let __tracing_attr_fake_return: () = loop {};
return __tracing_attr_fake_return;
}
{
if alias_ty.args.is_empty() { return; }
if alias_ty.has_non_region_infer() {
self.tcx.dcx().span_delayed_bug(origin.span(),
"an alias has infers during region solving");
return;
}
let trait_bounds: Vec<_> =
rustc_type_ir::outlives::declared_bounds_from_definition(self.tcx,
alias_ty).collect();
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event compiler/rustc_infer/src/infer/outlives/obligations.rs:557",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(557u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("trait_bounds")
}> =
::tracing::__macro_support::FieldName::new("trait_bounds");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&trait_bounds)
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
let approx_env_bounds =
self.verify_bound.approx_declared_bounds_from_env(alias_ty);
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event compiler/rustc_infer/src/infer/outlives/obligations.rs:563",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(563u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("approx_env_bounds")
}> =
::tracing::__macro_support::FieldName::new("approx_env_bounds");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&approx_env_bounds)
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
let kind = alias_ty.kind;
if approx_env_bounds.is_empty() && trait_bounds.is_empty() &&
(alias_ty.has_infer_regions() ||
#[allow(non_exhaustive_omitted_patterns)] match kind {
ty::Opaque { .. } => true,
_ => false,
}) {
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event compiler/rustc_infer/src/infer/outlives/obligations.rs:584",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(584u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("no declared bounds")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
let opt_variances = self.tcx.opt_alias_variances(kind);
self.args_must_outlive(alias_ty.args, origin, region,
opt_variances);
return;
}
if !trait_bounds.is_empty() &&
trait_bounds[1..].iter().map(|r|
Some(*r)).chain(approx_env_bounds.iter().map(|b|
b.map_bound(|b|
b.1).no_bound_vars())).all(|b| b == Some(trait_bounds[0])) {
let unique_bound = trait_bounds[0];
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event compiler/rustc_infer/src/infer/outlives/obligations.rs:615",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(615u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("unique_bound")
}> =
::tracing::__macro_support::FieldName::new("unique_bound");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&unique_bound)
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event compiler/rustc_infer/src/infer/outlives/obligations.rs:616",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(616u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("unique declared bound appears in trait ref")
as &dyn ::tracing::field::Value))])
});
} else { ; }
};
let category = origin.to_constraint_category();
self.delegate.push_sub_region_constraint(origin, region,
unique_bound, category);
return;
}
let verify_bound = self.verify_bound.alias_bound(alias_ty);
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("event compiler/rustc_infer/src/infer/outlives/obligations.rs:628",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(628u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&["message"],
::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::EVENT)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let enabled =
::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{
let interest = __CALLSITE.interest();
!interest.is_never() &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest)
};
if enabled {
(|value_set: ::tracing::field::ValueSet|
{
let meta = __CALLSITE.metadata();
::tracing::Event::dispatch(meta, &value_set);
;
})({
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
__CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("alias_must_outlive: pushing {0:?}",
verify_bound) as &dyn ::tracing::field::Value))])
});
} else { ; }
};
self.delegate.push_verify(origin, GenericKind::Alias(alias_ty),
region, verify_bound);
}
}
}#[instrument(level = "debug", skip(self))]
519 fn alias_ty_must_outlive(
520 &mut self,
521 origin: infer::SubregionOrigin<'tcx>,
522 region: ty::Region<'tcx>,
523 alias_ty: ty::AliasTy<'tcx>,
524 ) {
525 if alias_ty.args.is_empty() {
527 return;
528 }
529
530 if alias_ty.has_non_region_infer() {
531 self.tcx
532 .dcx()
533 .span_delayed_bug(origin.span(), "an alias has infers during region solving");
534 return;
535 }
536
537 let trait_bounds: Vec<_> =
555 rustc_type_ir::outlives::declared_bounds_from_definition(self.tcx, alias_ty).collect();
556
557 debug!(?trait_bounds);
558
559 let approx_env_bounds = self.verify_bound.approx_declared_bounds_from_env(alias_ty);
563 debug!(?approx_env_bounds);
564
565 let kind = alias_ty.kind;
580 if approx_env_bounds.is_empty()
581 && trait_bounds.is_empty()
582 && (alias_ty.has_infer_regions() || matches!(kind, ty::Opaque { .. }))
583 {
584 debug!("no declared bounds");
585 let opt_variances = self.tcx.opt_alias_variances(kind);
586 self.args_must_outlive(alias_ty.args, origin, region, opt_variances);
587 return;
588 }
589
590 if !trait_bounds.is_empty()
601 && trait_bounds[1..]
602 .iter()
603 .map(|r| Some(*r))
604 .chain(
605 approx_env_bounds.iter().map(|b| b.map_bound(|b| b.1).no_bound_vars()),
611 )
612 .all(|b| b == Some(trait_bounds[0]))
613 {
614 let unique_bound = trait_bounds[0];
615 debug!(?unique_bound);
616 debug!("unique declared bound appears in trait ref");
617 let category = origin.to_constraint_category();
618 self.delegate.push_sub_region_constraint(origin, region, unique_bound, category);
619 return;
620 }
621
622 let verify_bound = self.verify_bound.alias_bound(alias_ty);
628 debug!("alias_must_outlive: pushing {:?}", verify_bound);
629 self.delegate.push_verify(origin, GenericKind::Alias(alias_ty), region, verify_bound);
630 }
631
632 #[allow(clippy :: suspicious_else_formatting)]
{
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
&&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() ||
{ false } {
__tracing_attr_span =
{
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::callsite::DefaultCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("args_must_outlive",
"rustc_infer::infer::outlives::obligations",
::tracing::Level::DEBUG,
::tracing_core::__macro_support::Option::Some("compiler/rustc_infer/src/infer/outlives/obligations.rs"),
::tracing_core::__macro_support::Option::Some(632u32),
::tracing_core::__macro_support::Option::Some("rustc_infer::infer::outlives::obligations"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("args")
}> =
::tracing::__macro_support::FieldName::new("args");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("origin")
}> =
::tracing::__macro_support::FieldName::new("origin");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("region")
}> =
::tracing::__macro_support::FieldName::new("region");
NAME.as_str()
},
{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("opt_variances")
}> =
::tracing::__macro_support::FieldName::new("opt_variances");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::SPAN)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let mut interest = ::tracing::subscriber::Interest::never();
if ::tracing::Level::DEBUG <=
::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::DEBUG <=
::tracing::level_filters::LevelFilter::current() &&
{ interest = __CALLSITE.interest(); !interest.is_never() }
&&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest) {
let meta = __CALLSITE.metadata();
::tracing::Span::new(meta,
&{
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&args)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&origin)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(®ion)
as &dyn ::tracing::field::Value)),
(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&opt_variances)
as &dyn ::tracing::field::Value))])
})
} else {
let span =
::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
{};
span
}
};
__tracing_attr_guard = __tracing_attr_span.enter();
}
#[warn(clippy :: suspicious_else_formatting)]
{
#[allow(unknown_lints, unreachable_code, clippy ::
diverging_sub_expression, clippy :: empty_loop, clippy ::
let_unit_value, clippy :: let_with_type_underscore, clippy ::
needless_return, clippy :: unreachable)]
if false {
let __tracing_attr_fake_return: () = loop {};
return __tracing_attr_fake_return;
}
{
let constraint = origin.to_constraint_category();
for (index, arg) in args.iter().enumerate() {
match arg.kind() {
GenericArgKind::Lifetime(lt) => {
let variance =
if let Some(variances) = opt_variances {
variances[index]
} else { ty::Invariant };
if variance == ty::Invariant {
self.delegate.push_sub_region_constraint(origin.clone(),
region, lt, constraint);
}
}
GenericArgKind::Type(ty) => {
self.type_must_outlive(origin.clone(), ty, region,
constraint);
}
GenericArgKind::Const(_) => {}
}
}
}
}
}#[instrument(level = "debug", skip(self))]
633 fn args_must_outlive(
634 &mut self,
635 args: GenericArgsRef<'tcx>,
636 origin: infer::SubregionOrigin<'tcx>,
637 region: ty::Region<'tcx>,
638 opt_variances: Option<&[ty::Variance]>,
639 ) {
640 let constraint = origin.to_constraint_category();
641 for (index, arg) in args.iter().enumerate() {
642 match arg.kind() {
643 GenericArgKind::Lifetime(lt) => {
644 let variance = if let Some(variances) = opt_variances {
645 variances[index]
646 } else {
647 ty::Invariant
648 };
649 if variance == ty::Invariant {
650 self.delegate.push_sub_region_constraint(
651 origin.clone(),
652 region,
653 lt,
654 constraint,
655 );
656 }
657 }
658 GenericArgKind::Type(ty) => {
659 self.type_must_outlive(origin.clone(), ty, region, constraint);
660 }
661 GenericArgKind::Const(_) => {
662 }
664 }
665 }
666 }
667}
668
669impl<'cx, 'tcx> TypeOutlivesDelegate<'tcx> for &'cx InferCtxt<'tcx> {
670 fn push_sub_region_constraint(
671 &mut self,
672 origin: SubregionOrigin<'tcx>,
673 a: ty::Region<'tcx>,
674 b: ty::Region<'tcx>,
675 _constraint_category: ConstraintCategory<'tcx>,
676 ) {
677 self.sub_regions(origin, a, b, ty::VisibleForLeakCheck::Unreachable)
679 }
680
681 fn push_verify(
682 &mut self,
683 origin: SubregionOrigin<'tcx>,
684 kind: GenericKind<'tcx>,
685 a: ty::Region<'tcx>,
686 bound: VerifyBound<'tcx>,
687 ) {
688 self.verify_generic_bound(origin, kind, a, bound)
689 }
690}