]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/monomorphize/collector.rs
Merge branch 'incr_attr_queries' of https://github.com/wesleywiser/rust into update...
[rust.git] / src / librustc_mir / monomorphize / collector.rs
index 1fba436d405787f21c9b0ca5836da9cb9f3fec66..0f512569adf9757f1bd07d1f7e35056105029c36 100644 (file)
 //! this is not implemented however: a mono item will be produced
 //! regardless of whether it is actually needed or not.
 
-use rustc::hir;
+use rustc::hir::{self, TransFnAttrFlags};
 use rustc::hir::itemlikevisit::ItemLikeVisitor;
 
 use rustc::hir::map as hir_map;
 
 use rustc_data_structures::bitvec::BitVector;
 
-use syntax::attr;
-
 use std::iter;
 
 #[derive(PartialEq, Eq, Hash, Clone, Copy, Debug)]
@@ -985,8 +983,8 @@ fn is_root(&self, def_id: DefId) -> bool {
             MonoItemCollectionMode::Lazy => {
                 self.entry_fn == Some(def_id) ||
                 self.tcx.is_reachable_non_generic(def_id) ||
-                attr::contains_name(&self.tcx.get_attrs(def_id),
-                                    "rustc_std_internal_symbol")
+                self.tcx.trans_fn_attrs(def_id).flags.contains(
+                    TransFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL)
             }
         }
     }