Skip to content

Commit c762e4e

Browse files
committed
update rust-analyzer to new interned struct
1 parent 1965cf0 commit c762e4e

File tree

6 files changed

+31
-23
lines changed

6 files changed

+31
-23
lines changed

Cargo.lock

+19-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ process-wrap = { version = "8.0.2", features = ["std"] }
135135
pulldown-cmark-to-cmark = "10.0.4"
136136
pulldown-cmark = { version = "0.9.0", default-features = false }
137137
rayon = "1.8.0"
138-
salsa = { git = "https://github.com/davidbarsky/salsa.git", branch = "chayim-david-lukas/salsa-perf-improvements" }
138+
salsa = { git = "https://github.com/davidbarsky/salsa.git", branch = "chayim-david-lukas/salsa-changes-for-ra" }
139139
db-ext-macro = { git = "https://github.com/davidbarsky/db-ext-macro.git", rev = "c88f2f058ac4e6a8a09e87e41d7b30b147235514" }
140140
rustc-hash = "2.0.0"
141141
semver = "1.0.14"

crates/base-db/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use vfs::{AbsPathBuf, FileId};
2727
#[macro_export]
2828
macro_rules! impl_intern_key {
2929
($id:ident, $loc:ident) => {
30-
#[salsa::interned_sans_lifetime(no_debug)]
30+
#[salsa::interned(no_debug, no_lifetime)]
3131
pub struct $id {
3232
pub loc: $loc,
3333
}
@@ -167,7 +167,7 @@ impl Files {
167167
}
168168
}
169169

170-
#[salsa::interned_sans_lifetime]
170+
#[salsa::interned(no_lifetime)]
171171
pub struct EditionedFileId {
172172
pub file_id: FileText,
173173
pub editioned_file_id: span::EditionedFileId,

crates/hir-def/src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ pub enum ItemContainerId {
557557
impl_from!(ModuleId for ItemContainerId);
558558

559559
/// A Data Type
560-
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::Enum)]
560+
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::supertype)]
561561
pub enum AdtId {
562562
StructId(StructId),
563563
UnionId(UnionId),
@@ -566,7 +566,7 @@ pub enum AdtId {
566566
impl_from!(StructId, UnionId, EnumId for AdtId);
567567

568568
/// A macro
569-
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::Enum)]
569+
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::supertype)]
570570
pub enum MacroId {
571571
Macro2Id(Macro2Id),
572572
MacroRulesId(MacroRulesId),
@@ -820,7 +820,7 @@ impl GeneralConstId {
820820
}
821821

822822
/// The defs which have a body.
823-
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::Enum)]
823+
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::supertype)]
824824
pub enum DefWithBodyId {
825825
FunctionId(FunctionId),
826826
StaticId(StaticId),
@@ -863,7 +863,7 @@ pub enum AssocItemId {
863863
// casting them, and somehow making the constructors private, which would be annoying.
864864
impl_from!(FunctionId, ConstId, TypeAliasId for AssocItemId);
865865

866-
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::Enum)]
866+
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::supertype)]
867867
pub enum GenericDefId {
868868
FunctionId(FunctionId),
869869
AdtId(AdtId),
@@ -946,7 +946,7 @@ impl From<AssocItemId> for GenericDefId {
946946
}
947947
}
948948

949-
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::Enum)]
949+
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::supertype)]
950950
pub enum CallableDefId {
951951
FunctionId(FunctionId),
952952
StructId(StructId),
@@ -1062,7 +1062,7 @@ impl From<VariantId> for AttrDefId {
10621062
}
10631063
}
10641064

1065-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, salsa::Enum)]
1065+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, salsa::supertype)]
10661066
pub enum VariantId {
10671067
EnumVariantId(EnumVariantId),
10681068
StructId(StructId),

crates/hir-expand/src/db.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ pub trait ExpandDatabase: RootQueryDb {
152152
fn syntax_context(&self, file: HirFileId, edition: Edition) -> SyntaxContextId;
153153
}
154154

155-
#[salsa::interned_sans_lifetime(id = span::MacroCallId)]
155+
#[salsa::interned(no_lifetime, id = span::MacroCallId)]
156156
pub struct MacroCallWrapper {
157157
pub loc: MacroCallLoc,
158158
}
@@ -168,7 +168,7 @@ fn lookup_intern_macro_call(db: &dyn ExpandDatabase, macro_call: MacroCallId) ->
168168
.clone()
169169
}
170170

171-
#[salsa::interned_sans_lifetime(id = span::SyntaxContextId)]
171+
#[salsa::interned(no_lifetime, id = span::SyntaxContextId)]
172172
pub struct SyntaxContextWrapper {
173173
pub data: SyntaxContextId,
174174
}

crates/hir-ty/src/lower.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2463,7 +2463,7 @@ pub enum TyDefId {
24632463
}
24642464
impl_from!(BuiltinType, AdtId(StructId, EnumId, UnionId), TypeAliasId for TyDefId);
24652465

2466-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, salsa::Enum)]
2466+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, salsa::supertype)]
24672467
pub enum ValueTyDefId {
24682468
FunctionId(FunctionId),
24692469
StructId(StructId),

0 commit comments

Comments
 (0)