use rustc::ty::outlives::Component;
use rustc::ty::query::Providers;
use rustc::ty::wf;
+use smallvec::{SmallVec, smallvec};
use syntax::ast::DUMMY_NODE_ID;
use syntax::source_map::DUMMY_SP;
use rustc::traits::FulfillmentContext;
let obligations =
wf::obligations(infcx, param_env, DUMMY_NODE_ID, ty, DUMMY_SP).unwrap_or(vec![]);
- // NB: All of these predicates *ought* to be easily proven
+ // N.B., all of these predicates *ought* to be easily proven
// true. In fact, their correctness is (mostly) implied by
// other parts of the program. However, in #42552, we had
// an annoying scenario where:
None => vec![],
Some(ty::OutlivesPredicate(ty_a, r_b)) => {
let ty_a = infcx.resolve_type_vars_if_possible(&ty_a);
- let components = tcx.outlives_components(ty_a);
+ let mut components = smallvec![];
+ tcx.push_outlives_components(ty_a, &mut components);
implied_bounds_from_components(r_b, components)
}
},
/// those relationships.
fn implied_bounds_from_components(
sub_region: ty::Region<'tcx>,
- sup_components: Vec<Component<'tcx>>,
+ sup_components: SmallVec<[Component<'tcx>; 4]>,
) -> Vec<OutlivesBound<'tcx>> {
sup_components
.into_iter()