From bbcb13da88f7a4b25506ec85f2f170e6f78d5a58 Mon Sep 17 00:00:00 2001 From: Jared Roesch Date: Tue, 7 Jul 2015 15:50:02 -0700 Subject: Implement Default TyParam fallback This patch allows type parameter defaults to influence type inference. This is a possible breaking change since it effects the way type inference works and will have different behavior when mixing defaults and literal fallback. --- src/librustc_data_structures/unify/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/librustc_data_structures/unify') diff --git a/src/librustc_data_structures/unify/mod.rs b/src/librustc_data_structures/unify/mod.rs index a899bbacc03..7582b7ff61d 100644 --- a/src/librustc_data_structures/unify/mod.rs +++ b/src/librustc_data_structures/unify/mod.rs @@ -339,5 +339,11 @@ impl<'tcx,K,V> UnificationTable pub fn probe(&mut self, a_id: K) -> Option { self.get(a_id).value.clone() } -} + pub fn unsolved_variables(&mut self) -> Vec { + self.values + .iter() + .filter_map(|vv| if vv.value.is_some() { None } else { Some(vv.key()) }) + .collect() + } +} -- cgit 1.4.1-3-g733a5