We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 11f7dcc commit b2a1c8aCopy full SHA for b2a1c8a
src/librustc_driver/lib.rs
@@ -35,7 +35,7 @@ use rustc_serialize::json::{self, ToJson};
35
use rustc_session::config::nightly_options;
36
use rustc_session::config::{ErrorOutputType, Input, OutputType, PrintRequest};
37
use rustc_session::getopts;
38
-use rustc_session::lint::{Level, Lint, LintId};
+use rustc_session::lint::{Lint, LintId};
39
use rustc_session::{config, DiagnosticOutput, Session};
40
use rustc_session::{early_error, early_warn};
41
use rustc_span::source_map::{FileLoader, FileName};
@@ -256,12 +256,6 @@ pub fn run_compiler(
256
};
257
258
callbacks.config(&mut config);
259
- // Since the warnings from these lints will never be shown, there is no need to run them at all!
260
- if let Some(Level::Allow) = config.opts.lint_cap {
261
- config.override_queries = Some(|_, providers, _| {
262
- providers.lint_mod = |_, _| {};
263
- });
264
- }
265
266
interface::run_compiler(config, |compiler| {
267
let sess = compiler.session();
src/librustc_interface/interface.rs
@@ -158,7 +158,14 @@ pub struct Config {
158
pub registry: Registry,
159
}
160
161
-pub fn create_compiler_and_run<R>(config: Config, f: impl FnOnce(&Compiler) -> R) -> R {
+pub fn create_compiler_and_run<R>(mut config: Config, f: impl FnOnce(&Compiler) -> R) -> R {
162
+ // Since the warnings from these lints will never be shown, there is no need to run them at all!
163
+ if let Some(lint::Level::Allow) = config.opts.lint_cap {
164
+ config.override_queries = Some(|_, providers, _| {
165
+ providers.lint_mod = |_, _| {};
166
+ });
167
+ }
168
+
169
let registry = &config.registry;
170
let (sess, codegen_backend) = util::create_session(
171
config.opts,
0 commit comments