X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_mir%2Fdataflow%2Fmod.rs;h=a9d23a0afeabcc3a6ef79a0fd9ddd1ccea0ac1ad;hb=59724084089da63cc2f982372c0fae3551d85fe5;hp=af0e3f5a2709130764cb7e211568a8f7f1bca623;hpb=a92d689b122f725e0942564bc3c7af95c6792800;p=rust.git diff --git a/src/librustc_mir/dataflow/mod.rs b/src/librustc_mir/dataflow/mod.rs index af0e3f5a270..a9d23a0afea 100644 --- a/src/librustc_mir/dataflow/mod.rs +++ b/src/librustc_mir/dataflow/mod.rs @@ -1,4 +1,5 @@ use syntax::ast::{self, MetaItem}; +use syntax::symbol::{Symbol, sym}; use rustc_data_structures::bit_set::{BitSet, BitSetOperator, HybridBitSet}; use rustc_data_structures::indexed_vec::Idx; @@ -33,7 +34,12 @@ mod impls; pub mod move_paths; -pub(crate) use self::move_paths::indexes; +pub(crate) mod indexes { + pub(crate) use super::{ + move_paths::{MovePathIndex, MoveOutIndex, InitIndex}, + impls::borrows::BorrowIndex, + }; +} pub(crate) struct DataflowBuilder<'a, 'tcx: 'a, BD> where @@ -95,9 +101,9 @@ fn dataflow

(&mut self, p: P) where P: Fn(&BD, BD::Idx) -> DebugFormatted { fn propagate(&mut self) { self.flow_state.propagate(); } } -pub(crate) fn has_rustc_mir_with(attrs: &[ast::Attribute], name: &str) -> Option { +pub(crate) fn has_rustc_mir_with(attrs: &[ast::Attribute], name: Symbol) -> Option { for attr in attrs { - if attr.check_name("rustc_mir") { + if attr.check_name(sym::rustc_mir) { let items = attr.meta_item_list(); for item in items.iter().flat_map(|l| l.iter()) { match item.meta_item() { @@ -153,10 +159,8 @@ pub(crate) fn run

(self, return None; }; - let print_preflow_to = - name_found(tcx.sess, attributes, "borrowck_graphviz_preflow"); - let print_postflow_to = - name_found(tcx.sess, attributes, "borrowck_graphviz_postflow"); + let print_preflow_to = name_found(tcx.sess, attributes, sym::borrowck_graphviz_preflow); + let print_postflow_to = name_found(tcx.sess, attributes, sym::borrowck_graphviz_postflow); let mut mbcx = DataflowBuilder { def_id,