@@ -19,15 +19,18 @@ use std::io::{self, Write};
19
19
use super :: * ;
20
20
use borrow_check:: nll:: constraints:: OutlivesConstraint ;
21
21
22
-
23
22
impl < ' tcx > RegionInferenceContext < ' tcx > {
24
23
/// Write out the region constraint graph.
25
- pub ( crate ) fn dump_graphviz ( & self , mut w : & mut dyn Write ) -> io:: Result < ( ) > {
26
- dot:: render ( self , & mut w)
24
+ pub ( crate ) fn dump_graphviz_raw_constraints ( & self , mut w : & mut dyn Write ) -> io:: Result < ( ) > {
25
+ dot:: render ( & RawConstraints { regioncx : self } , & mut w)
27
26
}
28
27
}
29
28
30
- impl < ' this , ' tcx > dot:: Labeller < ' this > for RegionInferenceContext < ' tcx > {
29
+ struct RawConstraints < ' a , ' tcx : ' a > {
30
+ regioncx : & ' a RegionInferenceContext < ' tcx >
31
+ }
32
+
33
+ impl < ' a , ' this , ' tcx > dot:: Labeller < ' this > for RawConstraints < ' a , ' tcx > {
31
34
type Node = RegionVid ;
32
35
type Edge = OutlivesConstraint ;
33
36
@@ -48,16 +51,16 @@ impl<'this, 'tcx> dot::Labeller<'this> for RegionInferenceContext<'tcx> {
48
51
}
49
52
}
50
53
51
- impl < ' this , ' tcx > dot:: GraphWalk < ' this > for RegionInferenceContext < ' tcx > {
54
+ impl < ' a , ' this , ' tcx > dot:: GraphWalk < ' this > for RawConstraints < ' a , ' tcx > {
52
55
type Node = RegionVid ;
53
56
type Edge = OutlivesConstraint ;
54
57
55
58
fn nodes ( & ' this self ) -> dot:: Nodes < ' this , RegionVid > {
56
- let vids: Vec < RegionVid > = self . definitions . indices ( ) . collect ( ) ;
59
+ let vids: Vec < RegionVid > = self . regioncx . definitions . indices ( ) . collect ( ) ;
57
60
vids. into_cow ( )
58
61
}
59
62
fn edges ( & ' this self ) -> dot:: Edges < ' this , OutlivesConstraint > {
60
- ( & self . constraints . raw [ ..] ) . into_cow ( )
63
+ ( & self . regioncx . constraints . raw [ ..] ) . into_cow ( )
61
64
}
62
65
63
66
// Render `a: b` as `a <- b`, indicating the flow
0 commit comments