rust/src/librustc_data_structures
Aaron Turon 940adda2ae Move specialization graph walks to iterators; make associated type
projection sensitive to "mode" (most importantly, trans vs middle).

This commit introduces several pieces of iteration infrastructure in the
specialization graph data structure, as well as various helpers for
finding the definition of a given item, given its kind and name.

In addition, associated type projection is now *mode-sensitive*, with
three possible modes:

- **Topmost**. This means that projection is only possible if there is a
    non-`default` definition of the associated type directly on the
    selected impl. This mode is a bit of a hack: it's used during early
    coherence checking before we have built the specialization
    graph (and therefore before we can walk up the specialization
    parents to find other definitions). Eventually, this should be
    replaced with a less "staged" construction of the specialization
    graph.

- **AnyFinal**. Projection succeeds for any non-`default` associated
    type definition, even if it is defined by a parent impl. Used
    throughout typechecking.

- **Any**. Projection always succeeds. Used by trans.

The lasting distinction here is between `AnyFinal` and `Any` -- we wish
to treat `default` associated types opaquely for typechecking purposes.

In addition to the above, the commit includes a few other minor review fixes.
2016-03-14 15:04:40 -07:00
..
graph adopt new header style to sidestep rust-lang-nursery/rustfmt#836 2016-03-05 08:40:37 -05:00
obligation_forest Move specialization graph walks to iterators; make associated type 2016-03-14 15:04:40 -07:00
unify adopt new header style to sidestep rust-lang-nursery/rustfmt#836 2016-03-05 08:40:37 -05:00
veccell apply rustfmt to librustc_data_structures, correcting rust-lang-nursery/rustfmt#836 2016-03-05 08:40:33 -05:00
bitvec.rs apply rustfmt to librustc_data_structures, correcting rust-lang-nursery/rustfmt#836 2016-03-05 08:40:33 -05:00
Cargo.toml bootstrap: Add a bunch of Cargo.toml files 2016-02-11 11:12:32 -08:00
fnv.rs apply rustfmt to librustc_data_structures, correcting rust-lang-nursery/rustfmt#836 2016-03-05 08:40:33 -05:00
ivar.rs apply rustfmt to librustc_data_structures, correcting rust-lang-nursery/rustfmt#836 2016-03-05 08:40:33 -05:00
lib.rs apply rustfmt to librustc_data_structures, correcting rust-lang-nursery/rustfmt#836 2016-03-05 08:40:33 -05:00
snapshot_vec.rs apply rustfmt to librustc_data_structures, correcting rust-lang-nursery/rustfmt#836 2016-03-05 08:40:33 -05:00
transitive_relation.rs apply rustfmt to librustc_data_structures, correcting rust-lang-nursery/rustfmt#836 2016-03-05 08:40:33 -05:00
tuple_slice.rs apply rustfmt to librustc_data_structures, correcting rust-lang-nursery/rustfmt#836 2016-03-05 08:40:33 -05:00