about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/passes.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-01-28 09:01:33 +0000
committerbors <bors@rust-lang.org>2021-01-28 09:01:33 +0000
commit0e190206e2ff0c13d64701d9b4145bf89a2d0cab (patch)
treef081fe04717328752fade190520b7c3b1579565b /compiler/rustc_interface/src/passes.rs
parente32f372c4203b2527221b313cf63b05ea178e8a9 (diff)
parentf3dfbfc8f5f2b17c7f6fe12b4ba48f589d54dc87 (diff)
downloadrust-0e190206e2ff0c13d64701d9b4145bf89a2d0cab.tar.gz
rust-0e190206e2ff0c13d64701d9b4145bf89a2d0cab.zip
Auto merge of #81461 - JohnTitor:rollup-b0ij25f, r=JohnTitor
Rollup of 13 pull requests

Successful merges:

 - #70904 (Stabilize `Seek::stream_position` (feature `seek_convenience`))
 - #79951 (Refractor a few more types to `rustc_type_ir` )
 - #80868 (Print failure message on all tests that should panic, but don't)
 - #81062 (Improve diagnostics for Precise Capture)
 - #81277 (Make more traits of the From/Into family diagnostic items)
 - #81284 (Make `-Z time-passes` less noisy)
 - #81379 (Improve URLs handling)
 - #81416 (Tweak suggestion for missing field in patterns)
 - #81426 (const_evaluatable: expand abstract consts in try_unify)
 - #81428 (compiletest: Add two more unit tests)
 - #81430 (add const_evaluatable_checked test)
 - #81433 (const_evaluatable: stop looking into type aliases)
 - #81445 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_interface/src/passes.rs')
-rw-r--r--compiler/rustc_interface/src/passes.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index 7031234e108..56aa3939b22 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -33,7 +33,7 @@ use rustc_session::lint;
 use rustc_session::output::{filename_for_input, filename_for_metadata};
 use rustc_session::search_paths::PathKind;
 use rustc_session::Session;
-use rustc_span::symbol::Symbol;
+use rustc_span::symbol::{Ident, Symbol};
 use rustc_span::{FileName, RealFileName};
 use rustc_trait_selection::traits;
 use rustc_typeck as typeck;
@@ -211,8 +211,13 @@ pub fn register_plugins<'a>(
     Ok((krate, lint_store))
 }
 
-fn pre_expansion_lint(sess: &Session, lint_store: &LintStore, krate: &ast::Crate) {
-    sess.time("pre_AST_expansion_lint_checks", || {
+fn pre_expansion_lint(
+    sess: &Session,
+    lint_store: &LintStore,
+    krate: &ast::Crate,
+    crate_name: &str,
+) {
+    sess.prof.generic_activity_with_arg("pre_AST_expansion_lint_checks", crate_name).run(|| {
         rustc_lint::check_ast_crate(
             sess,
             lint_store,
@@ -233,7 +238,7 @@ fn configure_and_expand_inner<'a>(
     metadata_loader: &'a MetadataLoaderDyn,
 ) -> Result<(ast::Crate, Resolver<'a>)> {
     tracing::trace!("configure_and_expand_inner");
-    pre_expansion_lint(sess, lint_store, &krate);
+    pre_expansion_lint(sess, lint_store, &krate, crate_name);
 
     let mut resolver = Resolver::new(sess, &krate, crate_name, metadata_loader, &resolver_arenas);
     rustc_builtin_macros::register_builtin_macros(&mut resolver);
@@ -295,7 +300,9 @@ fn configure_and_expand_inner<'a>(
             ..rustc_expand::expand::ExpansionConfig::default(crate_name.to_string())
         };
 
-        let extern_mod_loaded = |k: &ast::Crate| pre_expansion_lint(sess, lint_store, k);
+        let extern_mod_loaded = |k: &ast::Crate, ident: Ident| {
+            pre_expansion_lint(sess, lint_store, k, &*ident.name.as_str())
+        };
         let mut ecx = ExtCtxt::new(&sess, cfg, &mut resolver, Some(&extern_mod_loaded));
 
         // Expand macros now!