about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJimmy Brisson <theotherjimmy@gmail.com>2017-10-07 09:20:13 -0500
committerJimmy Brisson <theotherjimmy@gmail.com>2017-10-13 09:32:29 -0500
commit4e116e14263ac27b4f0e4362638f281c06183813 (patch)
tree3d76fc2e79c08b6e1a46a1257f059a860e383797
parentd21c02396419d905344baeeb6186343d8038c5ef (diff)
downloadrust-4e116e14263ac27b4f0e4362638f281c06183813.tar.gz
rust-4e116e14263ac27b4f0e4362638f281c06183813.zip
Convert return type of get_vtable_methods to Vec
-rw-r--r--src/librustc/traits/mod.rs4
-rw-r--r--src/librustc_trans/collector.rs2
-rw-r--r--src/librustc_trans/meth.rs2
3 files changed, 4 insertions, 4 deletions
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<Item=Option<(DefId, &'tcx Substs<'tcx>)>> + 'a
+    -> Vec<Option<(DefId, &'tcx Substs<'tcx>)>>
 {
     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)
             })