Skip to content

Commit 4e116e1

Browse files
committed
Convert return type of get_vtable_methods to Vec
1 parent d21c023 commit 4e116e1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/librustc/traits/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ pub fn normalize_and_test_predicates<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
653653
pub fn get_vtable_methods<'a, 'tcx>(
654654
tcx: TyCtxt<'a, 'tcx, 'tcx>,
655655
trait_ref: ty::PolyTraitRef<'tcx>)
656-
-> impl Iterator<Item=Option<(DefId, &'tcx Substs<'tcx>)>> + 'a
656+
-> Vec<Option<(DefId, &'tcx Substs<'tcx>)>>
657657
{
658658
debug!("get_vtable_methods({:?})", trait_ref);
659659

@@ -696,7 +696,7 @@ pub fn get_vtable_methods<'a, 'tcx>(
696696

697697
Some((def_id, substs))
698698
})
699-
})
699+
}).collect()
700700
}
701701

702702
impl<'tcx,O> Obligation<'tcx,O> {

src/librustc_trans/collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ fn create_trans_items_for_vtable_methods<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
850850

851851
// Walk all methods of the trait, including those of its supertraits
852852
let methods = traits::get_vtable_methods(tcx, poly_trait_ref);
853-
let methods = methods.filter_map(|method| method)
853+
let methods = methods.into_iter().filter_map(|method| method)
854854
.map(|(def_id, substs)| ty::Instance::resolve(
855855
tcx,
856856
ty::ParamEnv::empty(traits::Reveal::All),

src/librustc_trans/meth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub fn get_vtable<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
8787

8888
if let Some(trait_ref) = trait_ref {
8989
let trait_ref = trait_ref.with_self_ty(tcx, ty);
90-
let methods = traits::get_vtable_methods(tcx, trait_ref).map(|opt_mth| {
90+
let methods = traits::get_vtable_methods(tcx, trait_ref).into_iter().map(|opt_mth| {
9191
opt_mth.map_or(nullptr, |(def_id, substs)| {
9292
callee::resolve_and_get_fn(ccx, def_id, substs)
9393
})

0 commit comments

Comments
 (0)