about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-10-07 13:08:19 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-10-07 13:58:29 +1100
commit2123509351c970b1c3fdbb21f719862dd0ab9e00 (patch)
tree6be35434737852fc9187f8593b8f11f67cc5a51a
parent860cbccad993151ef87ec6c39fd1b2892b18972f (diff)
downloadrust-2123509351c970b1c3fdbb21f719862dd0ab9e00.tar.gz
rust-2123509351c970b1c3fdbb21f719862dd0ab9e00.zip
Remove an unnecessary `&Lrc<_>` local variable.
-rw-r--r--compiler/rustc_lint/src/late.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_lint/src/late.rs b/compiler/rustc_lint/src/late.rs
index de401397150..6d5903ac467 100644
--- a/compiler/rustc_lint/src/late.rs
+++ b/compiler/rustc_lint/src/late.rs
@@ -18,7 +18,7 @@ use std::any::Any;
 use std::cell::Cell;
 
 use rustc_data_structures::stack::ensure_sufficient_stack;
-use rustc_data_structures::sync::{Lrc, join};
+use rustc_data_structures::sync::join;
 use rustc_hir as hir;
 use rustc_hir::def_id::{LocalDefId, LocalModDefId};
 use rustc_hir::{HirId, intravisit as hir_visit};
@@ -36,8 +36,7 @@ use crate::{LateContext, LateLintPass, LintStore};
 ///
 /// This function exists because [`Session::lint_store`] is type-erased.
 pub fn unerased_lint_store(sess: &Session) -> &LintStore {
-    let store: &Lrc<_> = sess.lint_store.as_ref().unwrap();
-    let store: &dyn Any = &**store;
+    let store: &dyn Any = sess.lint_store.as_deref().unwrap();
     store.downcast_ref().unwrap()
 }