about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorJared Roesch <roeschinc@gmail.com>2015-07-07 15:50:02 -0700
committerJared Roesch <jroesch@MacBook.home>2015-07-25 19:57:57 -0700
commitbbcb13da88f7a4b25506ec85f2f170e6f78d5a58 (patch)
tree6a872075699ea6996313f46ed03983da066c423a /src/librustc_data_structures
parent7276d8b7613c81c09feeec3bf94d47c4a5174bc8 (diff)
downloadrust-bbcb13da88f7a4b25506ec85f2f170e6f78d5a58.tar.gz
rust-bbcb13da88f7a4b25506ec85f2f170e6f78d5a58.zip
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.
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/unify/mod.rs8
1 files changed, 7 insertions, 1 deletions
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<K>
     pub fn probe(&mut self, a_id: K) -> Option<V> {
         self.get(a_id).value.clone()
     }
-}
 
+    pub fn unsolved_variables(&mut self) -> Vec<K> {
+        self.values
+            .iter()
+            .filter_map(|vv| if vv.value.is_some() { None } else { Some(vv.key()) })
+            .collect()
+    }
+}