about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2016-02-16 10:36:47 -0800
committerAaron Turon <aturon@mozilla.com>2016-03-14 15:04:40 -0700
commit940adda2aef63ac820cf331ebb7f6f0699c12045 (patch)
tree844f0e38e37dbd31a78a2659076c7d2b38789869 /src/librustc_data_structures
parent462c83e272e2ba268aaf11ef00e9d47c52011b90 (diff)
downloadrust-940adda2aef63ac820cf331ebb7f6f0699c12045.tar.gz
rust-940adda2aef63ac820cf331ebb7f6f0699c12045.zip
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.
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/obligation_forest/README.md4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/librustc_data_structures/obligation_forest/README.md b/src/librustc_data_structures/obligation_forest/README.md
index d76d7f6ba34..982a2bacce1 100644
--- a/src/librustc_data_structures/obligation_forest/README.md
+++ b/src/librustc_data_structures/obligation_forest/README.md
@@ -60,7 +60,7 @@ which includes three bits of information:
   `process_obligations` would simply yield back further ambiguous
   results. This is used by the `FulfillmentContext` to decide when it
   has reached a steady state.
-  
+
 #### Snapshots
 
 The `ObligationForest` supports a limited form of snapshots; see
@@ -79,5 +79,3 @@ parent and (for convenience) its root (which may be itself). It also
 has a current state, described by `NodeState`. After each
 processing step, we compress the vector to remove completed and error
 nodes, which aren't needed anymore.
-
-