]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #32062 - Marwes:unification_table_for_eq_relations, r=nikomatsakis
authorbors <bors@rust-lang.org>
Mon, 21 Mar 2016 23:00:08 +0000 (16:00 -0700)
committerbors <bors@rust-lang.org>
Mon, 21 Mar 2016 23:00:08 +0000 (16:00 -0700)
Improve time complexity of equality relations

This PR adds a `UnificationTable` to the `TypeVariableTable` type which is used store information about variable equality instead of just storing them in a vector for later processing. By using a `UnificationTable` equality relations can be resolved in O(n) (for all realistic values of n) rather than O(n!) which can give massive speedups in certain cases (see combine as an example).

Link to combine: https://github.com/Marwes/combine

1  2 
src/librustc/middle/infer/freshen.rs
src/librustc/middle/infer/mod.rs

Simple merge
Simple merge