X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_borrowck%2Fgraphviz.rs;h=1f2480666959e17eca3fdae778344c73c15c35ec;hb=fff08cb04389497d254fb40948674cbbee402908;hp=adad8c55f2159acc2a9ce1e3a16506d135bae071;hpb=ebc70e2e9ecdd0920c5e78f53ed694f1c050c5ed;p=rust.git diff --git a/src/librustc_borrowck/graphviz.rs b/src/librustc_borrowck/graphviz.rs index adad8c55f21..1f248066695 100644 --- a/src/librustc_borrowck/graphviz.rs +++ b/src/librustc_borrowck/graphviz.rs @@ -2,16 +2,15 @@ //! libgraphviz traits, specialized to attaching borrowck analysis //! data to rendered labels. -pub use self::Variant::*; +pub use Variant::*; pub use rustc::cfg::graphviz::{Node, Edge}; use rustc::cfg::graphviz as cfg_dot; -use borrowck; -use borrowck::{BorrowckCtxt, LoanPath}; -use dot; +use crate::borrowck::{self, BorrowckCtxt, LoanPath}; +use crate::dataflow::{DataFlowOperator, DataFlowContext, EntryOrExit}; +use log::debug; use rustc::cfg::CFGIndex; -use dataflow::{DataFlowOperator, DataFlowContext, EntryOrExit}; use std::rc::Rc; #[derive(Debug, Copy, Clone)] @@ -35,7 +34,7 @@ pub struct DataflowLabeller<'a, 'tcx: 'a> { pub inner: cfg_dot::LabelledCFG<'a, 'tcx>, pub variants: Vec, pub borrowck_ctxt: &'a BorrowckCtxt<'a, 'tcx>, - pub analysis_data: &'a borrowck::AnalysisData<'a, 'tcx>, + pub analysis_data: &'a borrowck::AnalysisData<'tcx>, } impl<'a, 'tcx> DataflowLabeller<'a, 'tcx> { @@ -53,7 +52,7 @@ fn dataflow_for(&self, e: EntryOrExit, n: &Node<'a>) -> String { sets } - fn dataflow_for_variant(&self, e: EntryOrExit, n: &Node, v: Variant) -> String { + fn dataflow_for_variant(&self, e: EntryOrExit, n: &Node<'_>, v: Variant) -> String { let cfgidx = n.0; match v { Loans => self.dataflow_loans_for(e, cfgidx), @@ -62,11 +61,14 @@ fn dataflow_for_variant(&self, e: EntryOrExit, n: &Node, v: Variant) -> String { } } - fn build_set(&self, - e: EntryOrExit, - cfgidx: CFGIndex, - dfcx: &DataFlowContext<'a, 'tcx, O>, - mut to_lp: F) -> String where + fn build_set( + &self, + e: EntryOrExit, + cfgidx: CFGIndex, + dfcx: &DataFlowContext<'tcx, O>, + mut to_lp: F, + ) -> String + where F: FnMut(usize) -> Rc>, { let mut saw_some = false; @@ -89,7 +91,7 @@ fn dataflow_loans_for(&self, e: EntryOrExit, cfgidx: CFGIndex) -> String { let dfcx = &self.analysis_data.loans; let loan_index_to_path = |loan_index| { let all_loans = &self.analysis_data.all_loans; - let l: &borrowck::Loan = &all_loans[loan_index]; + let l: &borrowck::Loan<'_> = &all_loans[loan_index]; l.loan_path() }; self.build_set(e, cfgidx, dfcx, loan_index_to_path)