// except according to those terms.
use hir::def_id::DefId;
-use ty::subst::{Kind, Subst, Substs};
+use traits::specialize::specialization_graph::NodeItem;
use ty::{self, Ty, TyCtxt, ToPredicate, ToPolyTraitRef};
use ty::outlives::Component;
+use ty::subst::{Kind, Subst};
use util::nodemap::FxHashSet;
-use hir::{self};
-use traits::specialize::specialization_graph::NodeItem;
use super::{Obligation, ObligationCause, PredicateObligation, SelectionContext, Normalized};
}
let visited = &mut self.visited;
+ let mut components = smallvec![];
+ tcx.push_outlives_components(ty_max, &mut components);
self.stack.extend(
- tcx.outlives_components(ty_max)
+ components
.into_iter()
.filter_map(|component| match component {
Component::Region(r) => if r.is_late_bound() {
}
}
-impl<'tcx,I:Iterator<Item = ty::Predicate<'tcx>>> Iterator for FilterToTraits<I> {
+impl<'tcx, I: Iterator<Item = ty::Predicate<'tcx>>> Iterator for FilterToTraits<I> {
type Item = ty::PolyTraitRef<'tcx>;
fn next(&mut self) -> Option<ty::PolyTraitRef<'tcx>> {
}
pub fn impl_is_default(self, node_item_def_id: DefId) -> bool {
- match self.hir.as_local_node_id(node_item_def_id) {
+ match self.hir().as_local_node_id(node_item_def_id) {
Some(node_id) => {
- let item = self.hir.expect_item(node_id);
+ let item = self.hir().expect_item(node_id);
if let hir::ItemKind::Impl(_, _, defaultness, ..) = item.node {
defaultness.is_default()
} else {