mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Simplify Arena to use a generic index
This commit is contained in:
parent
988f1dda6b
commit
f840fcb2f5
17 changed files with 179 additions and 189 deletions
|
@ -13,7 +13,7 @@
|
|||
//! See also a neighboring `body` module.
|
||||
|
||||
use hir_expand::name::Name;
|
||||
use ra_arena::{impl_arena_id, RawId};
|
||||
use ra_arena::{Idx, RawId};
|
||||
use ra_syntax::ast::RangeOp;
|
||||
|
||||
use crate::{
|
||||
|
@ -22,19 +22,12 @@ use crate::{
|
|||
type_ref::{Mutability, TypeRef},
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct ExprId(RawId);
|
||||
impl_arena_id!(ExprId);
|
||||
|
||||
impl ExprId {
|
||||
pub fn dummy() -> ExprId {
|
||||
ExprId((!0).into())
|
||||
}
|
||||
pub type ExprId = Idx<Expr>;
|
||||
pub(crate) fn dummy_expr_id() -> ExprId {
|
||||
ExprId::from_raw(RawId::from(!0))
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct PatId(RawId);
|
||||
impl_arena_id!(PatId);
|
||||
pub type PatId = Idx<Pat>;
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub enum Literal {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue