mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Replace once_cell with std's recently stabilized OnceCell/Lock and LazyCell/Lock
This doesn't get rid of the once_cell dependency, unfortunately, since we have dependencies that use it, but it's a nice to do cleanup. And when our deps will eventually get rid of once_cell we will get rid of it for free.
This commit is contained in:
parent
0daeb5c0b0
commit
955e609867
19 changed files with 49 additions and 54 deletions
|
@ -75,6 +75,8 @@ mod handlers {
|
|||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use hir::{diagnostics::AnyDiagnostic, InFile, Semantics};
|
||||
use ide_db::{
|
||||
assists::{Assist, AssistId, AssistKind, AssistResolveStrategy},
|
||||
|
@ -86,7 +88,6 @@ use ide_db::{
|
|||
syntax_helpers::node_ext::parse_tt_as_comma_sep_paths,
|
||||
EditionedFileId, FileId, FileRange, FxHashMap, FxHashSet, RootDatabase, SnippetCap,
|
||||
};
|
||||
use once_cell::sync::Lazy;
|
||||
use stdx::never;
|
||||
use syntax::{
|
||||
ast::{self, AstNode},
|
||||
|
@ -512,11 +513,11 @@ pub fn full_diagnostics(
|
|||
|
||||
// `__RA_EVERY_LINT` is a fake lint group to allow every lint in proc macros
|
||||
|
||||
static RUSTC_LINT_GROUPS_DICT: Lazy<FxHashMap<&str, Vec<&str>>> =
|
||||
Lazy::new(|| build_group_dict(DEFAULT_LINT_GROUPS, &["warnings", "__RA_EVERY_LINT"], ""));
|
||||
static RUSTC_LINT_GROUPS_DICT: LazyLock<FxHashMap<&str, Vec<&str>>> =
|
||||
LazyLock::new(|| build_group_dict(DEFAULT_LINT_GROUPS, &["warnings", "__RA_EVERY_LINT"], ""));
|
||||
|
||||
static CLIPPY_LINT_GROUPS_DICT: Lazy<FxHashMap<&str, Vec<&str>>> =
|
||||
Lazy::new(|| build_group_dict(CLIPPY_LINT_GROUPS, &["__RA_EVERY_LINT"], "clippy::"));
|
||||
static CLIPPY_LINT_GROUPS_DICT: LazyLock<FxHashMap<&str, Vec<&str>>> =
|
||||
LazyLock::new(|| build_group_dict(CLIPPY_LINT_GROUPS, &["__RA_EVERY_LINT"], "clippy::"));
|
||||
|
||||
fn build_group_dict(
|
||||
lint_group: &'static [LintGroup],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue