]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_incremental/assert_module_sources.rs
Auto merge of #69555 - Centril:rollup-e53lxz4, r=Centril
[rust.git] / src / librustc_incremental / assert_module_sources.rs
index c08deb6dfd5b56a1505002a01f659b49e95e488e..4dd08b517e1f214527903f66a35f3945cb7bcd17 100644 (file)
 //! allows for doing a more fine-grained check to see if pre- or post-lto data
 //! was re-used.
 
-use rustc::hir::def_id::LOCAL_CRATE;
 use rustc::mir::mono::CodegenUnitNameBuilder;
 use rustc::ty::TyCtxt;
+use rustc_hir::def_id::LOCAL_CRATE;
 use rustc_session::cgu_reuse_tracker::*;
+use rustc_span::symbol::{sym, Symbol};
 use std::collections::BTreeSet;
 use syntax::ast;
-use syntax::symbol::{sym, Symbol};
 
 pub fn assert_module_sources(tcx: TyCtxt<'_>) {
     tcx.dep_graph.with_ignore(|| {
@@ -81,10 +81,7 @@ fn check_attr(&self, attr: &ast::Attribute) {
         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 @@ fn check_attr(&self, attr: &ast::Attribute) {
         }
 
         // 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)