1
Fork 0

rustc_session: Remove lint store from Session

This commit is contained in:
Vadim Petrochenkov 2021-09-28 11:53:33 +03:00
parent 8a12be7412
commit a09fb901cb
4 changed files with 4 additions and 37 deletions

View file

@ -179,7 +179,7 @@ pub fn register_plugins<'a>(
register_lints: impl Fn(&Session, &mut LintStore),
mut krate: ast::Crate,
crate_name: &str,
) -> Result<(ast::Crate, Lrc<LintStore>)> {
) -> Result<(ast::Crate, LintStore)> {
krate = sess.time("attributes_injection", || {
rustc_builtin_macros::cmdline_attrs::inject(
krate,
@ -230,9 +230,6 @@ pub fn register_plugins<'a>(
}
});
let lint_store = Lrc::new(lint_store);
sess.init_lint_store(lint_store.clone());
Ok((krate, lint_store))
}

View file

@ -135,7 +135,7 @@ impl<'tcx> Queries<'tcx> {
let krate = self.parse()?.take();
let empty: &(dyn Fn(&Session, &mut LintStore) + Sync + Send) = &|_, _| {};
let result = passes::register_plugins(
let (krate, lint_store) = passes::register_plugins(
self.session(),
&*self.codegen_backend().metadata_loader(),
self.compiler.register_lints.as_deref().unwrap_or_else(|| empty),
@ -150,7 +150,7 @@ impl<'tcx> Queries<'tcx> {
// called, which happens within passes::register_plugins().
self.dep_graph_future().ok();
Ok(result)
Ok((krate, Lrc::new(lint_store)))
})
}