mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 10:39:45 +00:00
Idiomatic salsa use for extern block abi query
This commit is contained in:
parent
4e392f82cb
commit
bceeb6a3c7
6 changed files with 16 additions and 13 deletions
|
|
@ -5,7 +5,7 @@ use hir_expand::{
|
|||
EditionedFileId, HirFileId, InFile, Lookup, MacroCallId, MacroDefId, MacroDefKind,
|
||||
db::ExpandDatabase,
|
||||
};
|
||||
use intern::{Symbol, sym};
|
||||
use intern::sym;
|
||||
use la_arena::ArenaMap;
|
||||
use syntax::{AstPtr, ast};
|
||||
use triomphe::Arc;
|
||||
|
|
@ -238,9 +238,6 @@ pub trait DefDatabase: InternDatabase + ExpandDatabase + SourceDatabase {
|
|||
e: TypeAliasId,
|
||||
) -> (Arc<TypeAliasSignature>, Arc<ExpressionStoreSourceMap>);
|
||||
|
||||
#[salsa::invoke(crate::signatures::extern_block_abi_query)]
|
||||
fn extern_block_abi(&self, extern_block: ExternBlockId) -> Option<Symbol>;
|
||||
|
||||
// endregion:data
|
||||
|
||||
#[salsa::invoke(Body::body_with_source_map_query)]
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ pub mod find_path;
|
|||
pub mod import_map;
|
||||
pub mod visibility;
|
||||
|
||||
use intern::{Interned, sym};
|
||||
use intern::{Interned, Symbol, sym};
|
||||
pub use rustc_abi as layout;
|
||||
use thin_vec::ThinVec;
|
||||
use triomphe::Arc;
|
||||
|
|
@ -311,6 +311,14 @@ impl_intern!(ExternCrateId, ExternCrateLoc, intern_extern_crate, lookup_intern_e
|
|||
type ExternBlockLoc = ItemLoc<ast::ExternBlock>;
|
||||
impl_intern!(ExternBlockId, ExternBlockLoc, intern_extern_block, lookup_intern_extern_block);
|
||||
|
||||
#[salsa::tracked]
|
||||
impl ExternBlockId {
|
||||
#[salsa::tracked]
|
||||
pub fn abi(self, db: &dyn DefDatabase) -> Option<Symbol> {
|
||||
signatures::extern_block_abi(db, self)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
pub struct EnumVariantLoc {
|
||||
pub id: AstId<ast::Variant>,
|
||||
|
|
|
|||
|
|
@ -965,7 +965,7 @@ impl EnumVariants {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn extern_block_abi_query(
|
||||
pub(crate) fn extern_block_abi(
|
||||
db: &dyn DefDatabase,
|
||||
extern_block: ExternBlockId,
|
||||
) -> Option<Symbol> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue