Access future incompatibility information directly

Avoid querying LintStore when not necessary
This commit is contained in:
Mark Rousskov 2019-10-08 21:51:18 -04:00
parent 7abb1fafce
commit c4475c753b
2 changed files with 1 additions and 6 deletions

View file

@ -203,10 +203,6 @@ impl LintStore {
}
}
pub fn future_incompatible(&self, id: LintId) -> Option<FutureIncompatibleInfo> {
id.lint.future_incompatible
}
pub fn register_group_alias(
&mut self,
lint_name: &'static str,

View file

@ -672,9 +672,8 @@ pub fn struct_lint_level<'a>(sess: &'a Session,
};
// Check for future incompatibility lints and issue a stronger warning.
let lints = sess.lint_store.borrow();
let lint_id = LintId::of(lint);
let future_incompatible = lints.future_incompatible(lint_id);
let future_incompatible = lint.future_incompatible;
// If this code originates in a foreign macro, aka something that this crate
// did not itself author, then it's likely that there's nothing this crate