mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Stronger typing for AstId and AstIdMap
This commit is contained in:
parent
45272efec5
commit
8886d707b8
10 changed files with 102 additions and 50 deletions
|
@ -64,7 +64,7 @@ use std::{
|
|||
|
||||
use base_db::{impl_intern_key, salsa, CrateId, ProcMacroKind};
|
||||
use hir_expand::{
|
||||
ast_id_map::FileAstId,
|
||||
ast_id_map::{AstIdNode, FileAstId},
|
||||
attrs::{Attr, AttrId, AttrInput},
|
||||
builtin_attr_macro::BuiltinAttrExpander,
|
||||
builtin_derive_macro::BuiltinDeriveExpander,
|
||||
|
@ -1124,12 +1124,12 @@ impl AsMacroCall for InFile<&ast::MacroCall> {
|
|||
|
||||
/// Helper wrapper for `AstId` with `ModPath`
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
struct AstIdWithPath<T: ast::AstNode> {
|
||||
struct AstIdWithPath<T: AstIdNode> {
|
||||
ast_id: AstId<T>,
|
||||
path: path::ModPath,
|
||||
}
|
||||
|
||||
impl<T: ast::AstNode> AstIdWithPath<T> {
|
||||
impl<T: AstIdNode> AstIdWithPath<T> {
|
||||
fn new(file_id: HirFileId, ast_id: FileAstId<T>, path: path::ModPath) -> AstIdWithPath<T> {
|
||||
AstIdWithPath { ast_id: AstId::new(file_id, ast_id), path }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue