rust/compiler/rustc_typeck
est31 7208a01cdf Turn quadratic time on number of impl blocks into linear time
Previously, if you had a lot of inherent impl blocks on a type like:

struct Foo;

impl Foo { fn foo_1() {} }
...
impl Foo { fn foo_100_000() {} }

The compiler would be very slow at processing it, because
an internal algorithm would run in O(n^2), where n is the number
of impl blocks. Now, we add a new algorithm that allocates but
is faster asymptotically.

If there is an overlap between multiple impl blocks in terms of
identifiers, we still run a O(m^2) algorithm on groups of impl
blocks that have overlaps, but that m refers to the size of the
connected component, which is hopefully smaller than the n
that refers to the sum of all connected components.
2020-12-07 02:01:21 +01:00
..
src Turn quadratic time on number of impl blocks into linear time 2020-12-07 02:01:21 +01:00
Cargo.toml Replace some trivial struct_span_err!s in typeck. 2020-09-01 23:05:56 +10:00
README.md

For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.