]> git.lizzy.rs Git - rust.git/commit
Split dummy in region inference graph into distinct source and sink nodes.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Sat, 6 Feb 2016 03:28:20 +0000 (04:28 +0100)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Mon, 8 Feb 2016 12:44:03 +0000 (13:44 +0100)
commit8801bdb6b09569b187bb4c83f6121533afc69820
treee51e02455b7c296cb819aa2d00ca7a0b9671ce49
parente06f6928cb840a018706cabf75ab2bf3807551b1
Split dummy in region inference graph into distinct source and sink nodes.

Why do this: The RegionGraph representation previously conflated all
of the non-variable regions (i.e. the concrete regions such as
lifetime parameters to the current function) into a single dummy node.

A single dummy node leads DFS on a graph `'a -> '_#1 -> '_#0 -> 'b` to
claim that `'_#1` is reachable from `'_#0` (due to `'a` and `'b` being
conflated in the graph representation), which is incorrect (and can
lead to soundness bugs later on in compilation, see #30438).

Splitting the dummy node ensures that DFS will never introduce new
ancestor relationships between nodes for variable regions in the
graph.
src/librustc/middle/infer/region_inference/mod.rs