rustc_session: implement latent TODO

This commit is contained in:
Tamir Duberstein
2023-11-17 15:24:55 -05:00
parent 45bad64ab4
commit 55393b6eca
4 changed files with 10 additions and 7 deletions

View File

@@ -30,8 +30,9 @@ use rustc_span::Span;
use std::any::Any;
use std::cell::Cell;
/// Extract the `LintStore` from the query context.
/// This function exists because we've erased `LintStore` as `dyn Any` in the session.
/// Extract the [`LintStore`] from [`Session`].
///
/// 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;