mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Replace SmolStr usage with lang item enum for lang items
This commit is contained in:
parent
1afa032f34
commit
1535881836
21 changed files with 432 additions and 193 deletions
|
@ -11,6 +11,7 @@ use hir_def::{
|
|||
GenericParams, TypeOrConstParamData, TypeParamProvenance, WherePredicate,
|
||||
WherePredicateTypeTarget,
|
||||
},
|
||||
lang_item::LangItem,
|
||||
resolver::{HasResolver, TypeNs},
|
||||
type_ref::{TraitBoundModifier, TypeRef},
|
||||
ConstParamId, FunctionId, GenericDefId, ItemContainerId, Lookup, TraitId, TypeAliasId,
|
||||
|
@ -21,7 +22,6 @@ use intern::Interned;
|
|||
use itertools::Either;
|
||||
use rustc_hash::FxHashSet;
|
||||
use smallvec::{smallvec, SmallVec};
|
||||
use syntax::SmolStr;
|
||||
|
||||
use crate::{
|
||||
db::HirDatabase, ChalkTraitId, Interner, Substitution, TraitRef, TraitRefExt, WhereClause,
|
||||
|
@ -29,9 +29,9 @@ use crate::{
|
|||
|
||||
pub(crate) fn fn_traits(db: &dyn DefDatabase, krate: CrateId) -> impl Iterator<Item = TraitId> {
|
||||
[
|
||||
db.lang_item(krate, SmolStr::new_inline("fn")),
|
||||
db.lang_item(krate, SmolStr::new_inline("fn_mut")),
|
||||
db.lang_item(krate, SmolStr::new_inline("fn_once")),
|
||||
db.lang_item(krate, LangItem::Fn),
|
||||
db.lang_item(krate, LangItem::FnMut),
|
||||
db.lang_item(krate, LangItem::FnOnce),
|
||||
]
|
||||
.into_iter()
|
||||
.flatten()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue