Skip to content

Commit 54ef4ea

Browse files
committed
update rust-analyzer to new interned struct
1 parent f2f811a commit 54ef4ea

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
@@ -560,7 +560,7 @@ pub enum ItemContainerId {
560560
impl_from!(ModuleId for ItemContainerId);
561561

562562
/// A Data Type
563-
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::Enum)]
563+
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::supertype)]
564564
pub enum AdtId {
565565
StructId(StructId),
566566
UnionId(UnionId),
@@ -569,7 +569,7 @@ pub enum AdtId {
569569
impl_from!(StructId, UnionId, EnumId for AdtId);
570570

571571
/// A macro
572-
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::Enum)]
572+
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::supertype)]
573573
pub enum MacroId {
574574
Macro2Id(Macro2Id),
575575
MacroRulesId(MacroRulesId),
@@ -825,7 +825,7 @@ impl GeneralConstId {
825825
}
826826

827827
/// The defs which have a body.
828-
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::Enum)]
828+
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::supertype)]
829829
pub enum DefWithBodyId {
830830
FunctionId(FunctionId),
831831
StaticId(StaticId),
@@ -868,7 +868,7 @@ pub enum AssocItemId {
868868
// casting them, and somehow making the constructors private, which would be annoying.
869869
impl_from!(FunctionId, ConstId, TypeAliasId for AssocItemId);
870870

871-
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::Enum)]
871+
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::supertype)]
872872
pub enum GenericDefId {
873873
AdtId(AdtId),
874874
// consts can have type parameters from their parents (i.e. associated consts of traits)
@@ -957,7 +957,7 @@ impl From<AssocItemId> for GenericDefId {
957957
}
958958
}
959959

960-
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::Enum)]
960+
#[derive(Debug, PartialOrd, Ord, Clone, Copy, PartialEq, Eq, Hash, salsa::supertype)]
961961
pub enum CallableDefId {
962962
FunctionId(FunctionId),
963963
StructId(StructId),
@@ -1073,7 +1073,7 @@ impl From<VariantId> for AttrDefId {
10731073
}
10741074
}
10751075

1076-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, salsa::Enum)]
1076+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, salsa::supertype)]
10771077
pub enum VariantId {
10781078
EnumVariantId(EnumVariantId),
10791079
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)