@@ -19,15 +19,18 @@ use std::io::{self, Write};
1919use super :: * ;
2020use borrow_check:: nll:: constraints:: OutlivesConstraint ;
2121
22-
2322impl < ' tcx > RegionInferenceContext < ' tcx > {
2423 /// 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)
2726 }
2827}
2928
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 > {
3134 type Node = RegionVid ;
3235 type Edge = OutlivesConstraint ;
3336
@@ -48,16 +51,16 @@ impl<'this, 'tcx> dot::Labeller<'this> for RegionInferenceContext<'tcx> {
4851 }
4952}
5053
51- impl < ' this , ' tcx > dot:: GraphWalk < ' this > for RegionInferenceContext < ' tcx > {
54+ impl < ' a , ' this , ' tcx > dot:: GraphWalk < ' this > for RawConstraints < ' a , ' tcx > {
5255 type Node = RegionVid ;
5356 type Edge = OutlivesConstraint ;
5457
5558 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 ( ) ;
5760 vids. into_cow ( )
5861 }
5962 fn edges ( & ' this self ) -> dot:: Edges < ' this , OutlivesConstraint > {
60- ( & self . constraints . raw [ ..] ) . into_cow ( )
63+ ( & self . regioncx . constraints . raw [ ..] ) . into_cow ( )
6164 }
6265
6366 // Render `a: b` as `a <- b`, indicating the flow
0 commit comments