diff --git a/src/librustc/traits/mod.rs b/src/librustc/traits/mod.rs index bdfbefd1364..b58ffd4c7b8 100644 --- a/src/librustc/traits/mod.rs +++ b/src/librustc/traits/mod.rs @@ -653,7 +653,7 @@ pub fn normalize_and_test_predicates<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, pub fn get_vtable_methods<'a, 'tcx>( tcx: TyCtxt<'a, 'tcx, 'tcx>, trait_ref: ty::PolyTraitRef<'tcx>) - -> impl Iterator)>> + 'a + -> Vec)>> { debug!("get_vtable_methods({:?})", trait_ref); @@ -696,7 +696,7 @@ pub fn get_vtable_methods<'a, 'tcx>( Some((def_id, substs)) }) - }) + }).collect() } impl<'tcx,O> Obligation<'tcx,O> { diff --git a/src/librustc_trans/collector.rs b/src/librustc_trans/collector.rs index 9d1e36fa581..835283aa09b 100644 --- a/src/librustc_trans/collector.rs +++ b/src/librustc_trans/collector.rs @@ -850,7 +850,7 @@ fn create_trans_items_for_vtable_methods<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, // Walk all methods of the trait, including those of its supertraits let methods = traits::get_vtable_methods(tcx, poly_trait_ref); - let methods = methods.filter_map(|method| method) + let methods = methods.into_iter().filter_map(|method| method) .map(|(def_id, substs)| ty::Instance::resolve( tcx, ty::ParamEnv::empty(traits::Reveal::All), diff --git a/src/librustc_trans/meth.rs b/src/librustc_trans/meth.rs index 88407947f0e..72f580c2d38 100644 --- a/src/librustc_trans/meth.rs +++ b/src/librustc_trans/meth.rs @@ -87,7 +87,7 @@ pub fn get_vtable<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, if let Some(trait_ref) = trait_ref { let trait_ref = trait_ref.with_self_ty(tcx, ty); - let methods = traits::get_vtable_methods(tcx, trait_ref).map(|opt_mth| { + let methods = traits::get_vtable_methods(tcx, trait_ref).into_iter().map(|opt_mth| { opt_mth.map_or(nullptr, |(def_id, substs)| { callee::resolve_and_get_fn(ccx, def_id, substs) })