about summary refs log tree commit diff
path: root/src/librustc_incremental/assert_module_sources.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_incremental/assert_module_sources.rs')
-rw-r--r--src/librustc_incremental/assert_module_sources.rs19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/librustc_incremental/assert_module_sources.rs b/src/librustc_incremental/assert_module_sources.rs
index 70abb38278a..eee6e73ed10 100644
--- a/src/librustc_incremental/assert_module_sources.rs
+++ b/src/librustc_incremental/assert_module_sources.rs
@@ -21,13 +21,13 @@
 //! allows for doing a more fine-grained check to see if pre- or post-lto data
 //! was re-used.
 
-use rustc::mir::mono::CodegenUnitNameBuilder;
-use rustc::ty::TyCtxt;
+use rustc_ast::ast;
 use rustc_hir::def_id::LOCAL_CRATE;
+use rustc_middle::mir::mono::CodegenUnitNameBuilder;
+use rustc_middle::ty::TyCtxt;
 use rustc_session::cgu_reuse_tracker::*;
 use rustc_span::symbol::{sym, Symbol};
 use std::collections::BTreeSet;
-use syntax::ast;
 
 pub fn assert_module_sources(tcx: TyCtxt<'_>) {
     tcx.dep_graph.with_ignore(|| {
@@ -44,7 +44,7 @@ pub fn assert_module_sources(tcx: TyCtxt<'_>) {
 
         let ams = AssertModuleSource { tcx, available_cgus };
 
-        for attr in tcx.hir().krate().attrs {
+        for attr in tcx.hir().krate().item.attrs {
             ams.check_attr(attr);
         }
     })
@@ -81,10 +81,7 @@ impl AssertModuleSource<'tcx> {
         if !self.tcx.sess.opts.debugging_opts.query_dep_graph {
             self.tcx.sess.span_fatal(
                 attr.span,
-                &format!(
-                    "found CGU-reuse attribute but `-Zquery-dep-graph` \
-                          was not specified"
-                ),
+                "found CGU-reuse attribute but `-Zquery-dep-graph` was not specified",
             );
         }
 
@@ -107,7 +104,7 @@ impl AssertModuleSource<'tcx> {
         }
 
         // Split of the "special suffix" if there is one.
-        let (user_path, cgu_special_suffix) = if let Some(index) = user_path.rfind(".") {
+        let (user_path, cgu_special_suffix) = if let Some(index) = user_path.rfind('.') {
             (&user_path[..index], Some(&user_path[index + 1..]))
         } else {
             (&user_path[..], None)
@@ -150,7 +147,7 @@ impl AssertModuleSource<'tcx> {
         );
     }
 
-    fn field(&self, attr: &ast::Attribute, name: Symbol) -> ast::Name {
+    fn field(&self, attr: &ast::Attribute, name: Symbol) -> Symbol {
         for item in attr.meta_item_list().unwrap_or_else(Vec::new) {
             if item.check_name(name) {
                 if let Some(value) = item.value_str() {
@@ -178,6 +175,6 @@ impl AssertModuleSource<'tcx> {
             return true;
         }
         debug!("check_config: no match found");
-        return false;
+        false
     }
 }