diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2023-08-07 14:23:01 +0800 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2023-08-07 19:33:23 +0800 |
| commit | b6ac5764872a8b2d236460d889ccd745be6fff7d (patch) | |
| tree | 3184a7f15c36ebbf61398dab7812d9728e1c4b5a /compiler/rustc_driver_impl/src | |
| parent | adb15a20ac99024ea90b28abd5af12f438fa2a20 (diff) | |
| download | rust-b6ac5764872a8b2d236460d889ccd745be6fff7d.tar.gz rust-b6ac5764872a8b2d236460d889ccd745be6fff7d.zip | |
rustc_interface: Dismantle `register_plugins` query
Diffstat (limited to 'compiler/rustc_driver_impl/src')
| -rw-r--r-- | compiler/rustc_driver_impl/src/lib.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs index 60dc9b20077..ec77569d4b8 100644 --- a/compiler/rustc_driver_impl/src/lib.rs +++ b/compiler/rustc_driver_impl/src/lib.rs @@ -32,7 +32,7 @@ use rustc_feature::find_gated_cfg; use rustc_fluent_macro::fluent_messages; use rustc_interface::util::{self, collect_crate_types, get_codegen_backend}; use rustc_interface::{interface, Queries}; -use rustc_lint::LintStore; +use rustc_lint::{unerased_lint_store, LintStore}; use rustc_metadata::locator; use rustc_session::config::{nightly_options, CG_OPTIONS, Z_OPTIONS}; use rustc_session::config::{ErrorOutputType, Input, OutFileName, OutputType, TrimmedDefPaths}; @@ -411,15 +411,11 @@ fn run_compiler( return early_exit(); } - { - let plugins = queries.register_plugins()?; - let (.., lint_store) = &*plugins.borrow(); - - // Lint plugins are registered; now we can process command line flags. - if sess.opts.describe_lints { - describe_lints(sess, lint_store, true); - return early_exit(); - } + if sess.opts.describe_lints { + queries + .global_ctxt()? + .enter(|tcx| describe_lints(sess, unerased_lint_store(tcx), true)); + return early_exit(); } // Make sure name resolution and macro expansion is run. |
