From c4475c753b252060dbc76a73b83159484992bf06 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Tue, 8 Oct 2019 21:51:18 -0400 Subject: [PATCH] Access future incompatibility information directly Avoid querying LintStore when not necessary --- src/librustc/lint/context.rs | 4 ---- src/librustc/lint/mod.rs | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs index 97b9f21163db..4146606d443e 100644 --- a/src/librustc/lint/context.rs +++ b/src/librustc/lint/context.rs @@ -203,10 +203,6 @@ impl LintStore { } } - pub fn future_incompatible(&self, id: LintId) -> Option { - id.lint.future_incompatible - } - pub fn register_group_alias( &mut self, lint_name: &'static str, diff --git a/src/librustc/lint/mod.rs b/src/librustc/lint/mod.rs index ba7ec0ed6e48..e3219b717905 100644 --- a/src/librustc/lint/mod.rs +++ b/src/librustc/lint/mod.rs @@ -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