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

@ -2,10 +2,9 @@ use crate::cgu_reuse_tracker::CguReuseTracker;
use crate::code_stats::CodeStats;
pub use crate::code_stats::{DataTypeKind, FieldInfo, SizeKind, VariantInfo};
use crate::config::{self, CrateType, OutputType, SwitchWithOptPath};
use crate::filesearch;
use crate::lint::{self, LintId};
use crate::parse::ParseSess;
use crate::search_paths::{PathKind, SearchPath};
use crate::{filesearch, lint};
pub use rustc_ast::attr::MarkedAttrs;
pub use rustc_ast::Attribute;
@ -41,10 +40,6 @@ use std::str::FromStr;
use std::sync::Arc;
use std::time::Duration;
pub trait SessionLintStore: sync::Send + sync::Sync {
fn name_to_lint(&self, lint_name: &str) -> LintId;
}
pub struct OptimizationFuel {
/// If `-zfuel=crate=n` is specified, initially set to `n`, otherwise `0`.
remaining: u64,
@ -153,8 +148,6 @@ pub struct Session {
features: OnceCell<rustc_feature::Features>,
lint_store: OnceCell<Lrc<dyn SessionLintStore>>,
incr_comp_session: OneThread<RefCell<IncrCompSession>>,
/// Used for incremental compilation tests. Will only be populated if
/// `-Zquery-dep-graph` is specified.
@ -591,13 +584,6 @@ impl Session {
}
}
pub fn init_lint_store(&self, lint_store: Lrc<dyn SessionLintStore>) {
self.lint_store
.set(lint_store)
.map_err(|_| ())
.expect("`lint_store` was initialized twice");
}
/// Calculates the flavor of LTO to use for this compilation.
pub fn lto(&self) -> config::Lto {
// If our target has codegen requirements ignore the command line
@ -1315,7 +1301,6 @@ pub fn build_session(
crate_types: OnceCell::new(),
stable_crate_id: OnceCell::new(),
features: OnceCell::new(),
lint_store: OnceCell::new(),
incr_comp_session: OneThread::new(RefCell::new(IncrCompSession::NotInitialized)),
cgu_reuse_tracker,
prof,