debug!("normalize_projection_type(projection_ty={:?})",
projection_ty);
- assert!(!projection_ty.has_escaping_regions());
+ debug_assert!(!projection_ty.has_escaping_regions());
// FIXME(#20304) -- cache
if !is_default {
true
} else if obligation.param_env.reveal == Reveal::All {
- assert!(!poly_trait_ref.needs_infer());
+ debug_assert!(!poly_trait_ref.needs_infer());
if !poly_trait_ref.needs_subst() {
true
} else {
pub fn select(&mut self, obligation: &TraitObligation<'tcx>)
-> SelectionResult<'tcx, Selection<'tcx>> {
debug!("select({:?})", obligation);
- assert!(!obligation.predicate.has_escaping_regions());
+ debug_assert!(!obligation.predicate.has_escaping_regions());
let stack = self.push_stack(TraitObligationStackList::empty(), obligation);
match obligation.predicate {
ty::Predicate::Trait(ref t) => {
- assert!(!t.has_escaping_regions());
+ debug_assert!(!t.has_escaping_regions());
let obligation = obligation.with(t.clone());
self.evaluate_trait_predicate_recursively(previous_stack, obligation)
}
debug!("candidate_from_obligation(cache_fresh_trait_pred={:?}, obligation={:?})",
cache_fresh_trait_pred,
stack);
- assert!(!stack.obligation.predicate.has_escaping_regions());
+ debug_assert!(!stack.obligation.predicate.has_escaping_regions());
if let Some(c) = self.check_candidate_cache(stack.obligation.param_env,
&cache_fresh_trait_pred) {
snapshot: &infer::CombinedSnapshot<'cx, 'tcx>)
-> bool
{
- assert!(!skol_trait_ref.has_escaping_regions());
+ debug_assert!(!skol_trait_ref.has_escaping_regions());
if self.infcx.at(&obligation.cause, obligation.param_env)
.sup(ty::Binder::dummy(skol_trait_ref), trait_bound).is_err() {
return false;
let univariant = |fields: &[TyLayout], repr: &ReprOptions, kind| {
Ok(tcx.intern_layout(univariant_uninterned(fields, repr, kind)?))
};
- assert!(!ty.has_infer_types());
+ debug_assert!(!ty.has_infer_types());
Ok(match ty.sty {
// Basic scalars.
tcx: TyCtxt<'a, 'tcx, 'tcx>,
param_env: ty::ParamEnv<'tcx>)
-> Result<SizeSkeleton<'tcx>, LayoutError<'tcx>> {
- assert!(!ty.has_infer_types());
+ debug_assert!(!ty.has_infer_types());
// First try computing a static layout.
let err = match tcx.layout_of(param_env.and(ty)) {
let tail = tcx.struct_tail(pointee);
match tail.sty {
ty::TyParam(_) | ty::TyProjection(_) => {
- assert!(tail.has_param_types() || tail.has_self_ty());
+ debug_assert!(tail.has_param_types() || tail.has_self_ty());
Ok(SizeSkeleton::Pointer {
non_zero,
tail: tcx.erase_regions(&tail)
pub fn with_self_ty(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>, self_ty: Ty<'tcx>)
-> ty::TraitRef<'tcx> {
// otherwise the escaping regions would be captured by the binder
- assert!(!self_ty.has_escaping_regions());
+ debug_assert!(!self_ty.has_escaping_regions());
ty::TraitRef {
def_id: self.def_id,
pub fn dummy<'tcx>(value: T) -> Binder<T>
where T: TypeFoldable<'tcx>
{
- assert!(!value.has_escaping_regions());
+ debug_assert!(!value.has_escaping_regions());
Binder(value)
}
-> ty::ProjectionPredicate<'tcx>
{
// otherwise the escaping regions would be captured by the binders
- assert!(!self_ty.has_escaping_regions());
+ debug_assert!(!self_ty.has_escaping_regions());
ty::ProjectionPredicate {
projection_ty: ty::ProjectionTy {