Skip to content

Commit 898f265

Browse files
committed
Bump salsa
1 parent 6dd8cfe commit 898f265

File tree

20 files changed

+155
-93
lines changed

20 files changed

+155
-93
lines changed

src/tools/rust-analyzer/Cargo.lock

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -569,12 +569,6 @@ dependencies = [
569569
"hashbrown 0.15.4",
570570
]
571571

572-
[[package]]
573-
name = "heck"
574-
version = "0.5.0"
575-
source = "registry+https://github.com/rust-lang/crates.io-index"
576-
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
577-
578572
[[package]]
579573
name = "hermit-abi"
580574
version = "0.5.2"
@@ -1020,6 +1014,15 @@ dependencies = [
10201014
"triomphe",
10211015
]
10221016

1017+
[[package]]
1018+
name = "intrusive-collections"
1019+
version = "0.9.7"
1020+
source = "registry+https://github.com/rust-lang/crates.io-index"
1021+
checksum = "189d0897e4cbe8c75efedf3502c18c887b05046e59d28404d4d8e46cbc4d1e86"
1022+
dependencies = [
1023+
"memoffset",
1024+
]
1025+
10231026
[[package]]
10241027
name = "itertools"
10251028
version = "0.12.1"
@@ -1427,6 +1430,16 @@ dependencies = [
14271430
"num-traits",
14281431
]
14291432

1433+
[[package]]
1434+
name = "papaya"
1435+
version = "0.2.3"
1436+
source = "registry+https://github.com/rust-lang/crates.io-index"
1437+
checksum = "f92dd0b07c53a0a0c764db2ace8c541dc47320dad97c2200c2a637ab9dd2328f"
1438+
dependencies = [
1439+
"equivalent",
1440+
"seize",
1441+
]
1442+
14301443
[[package]]
14311444
name = "parking_lot"
14321445
version = "0.12.4"
@@ -1955,16 +1968,18 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
19551968

19561969
[[package]]
19571970
name = "salsa"
1958-
version = "0.22.0"
1971+
version = "0.23.0"
19591972
source = "registry+https://github.com/rust-lang/crates.io-index"
1960-
checksum = "c8fff508e3d6ef42a32607f7538e17171a877a12015e32036f46e99d00c95781"
1973+
checksum = "2e235afdb8e510f38a07138fbe5a0b64691894358a9c0cbd813b1aade110efc9"
19611974
dependencies = [
19621975
"boxcar",
19631976
"crossbeam-queue",
1964-
"dashmap",
1977+
"crossbeam-utils",
19651978
"hashbrown 0.15.4",
19661979
"hashlink",
19671980
"indexmap",
1981+
"intrusive-collections",
1982+
"papaya",
19681983
"parking_lot",
19691984
"portable-atomic",
19701985
"rayon",
@@ -1978,17 +1993,16 @@ dependencies = [
19781993

19791994
[[package]]
19801995
name = "salsa-macro-rules"
1981-
version = "0.22.0"
1996+
version = "0.23.0"
19821997
source = "registry+https://github.com/rust-lang/crates.io-index"
1983-
checksum = "8ea72b3c06f2ce6350fe3a0eeb7aaaf842d1d8352b706973c19c4f02e298a87c"
1998+
checksum = "2edb86a7e9c91f6d30c9ce054312721dbe773a162db27bbfae834d16177b30ce"
19841999

19852000
[[package]]
19862001
name = "salsa-macros"
1987-
version = "0.22.0"
2002+
version = "0.23.0"
19882003
source = "registry+https://github.com/rust-lang/crates.io-index"
1989-
checksum = "0ce92025bc160b27814a207cb78d680973af17f863c7f4fc56cf3a535e22f378"
2004+
checksum = "d0778d6e209051bc4e75acfe83bcd7848601ec3dbe9c3dbb982829020e9128af"
19902005
dependencies = [
1991-
"heck",
19922006
"proc-macro2",
19932007
"quote",
19942008
"syn",
@@ -2025,6 +2039,16 @@ version = "1.2.0"
20252039
source = "registry+https://github.com/rust-lang/crates.io-index"
20262040
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
20272041

2042+
[[package]]
2043+
name = "seize"
2044+
version = "0.5.0"
2045+
source = "registry+https://github.com/rust-lang/crates.io-index"
2046+
checksum = "e4b8d813387d566f627f3ea1b914c068aac94c40ae27ec43f5f33bde65abefe7"
2047+
dependencies = [
2048+
"libc",
2049+
"windows-sys 0.52.0",
2050+
]
2051+
20282052
[[package]]
20292053
name = "semver"
20302054
version = "1.0.26"

src/tools/rust-analyzer/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ debug = 2
4949
# ungrammar = { path = "../ungrammar" }
5050

5151
# salsa = { path = "../salsa" }
52+
# salsa-macros = { path = "../salsa/components/salsa-macros" }
53+
# salsa-macro-rules = { path = "../salsa/components/salsa-macro-rules" }
5254

5355
[workspace.dependencies]
5456
# local crates
@@ -136,8 +138,8 @@ rayon = "1.10.0"
136138
rowan = "=0.15.15"
137139
# Ideally we'd not enable the macros feature but unfortunately the `tracked` attribute does not work
138140
# on impls without it
139-
salsa = { version = "0.22.0", default-features = true, features = ["rayon","salsa_unstable", "macros"] }
140-
salsa-macros = "0.22.0"
141+
salsa = { version = "0.23.0", default-features = true, features = ["rayon","salsa_unstable", "macros"] }
142+
salsa-macros = "0.23.0"
141143
semver = "1.0.26"
142144
serde = { version = "1.0.219" }
143145
serde_derive = { version = "1.0.219" }

src/tools/rust-analyzer/crates/base-db/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub type FxIndexSet<T> = indexmap::IndexSet<T, rustc_hash::FxBuildHasher>;
3434
#[macro_export]
3535
macro_rules! impl_intern_key {
3636
($id:ident, $loc:ident) => {
37-
#[salsa_macros::interned(no_lifetime)]
37+
#[salsa_macros::interned(no_lifetime, revisions = usize::MAX)]
3838
#[derive(PartialOrd, Ord)]
3939
pub struct $id {
4040
pub loc: $loc,
@@ -44,7 +44,7 @@ macro_rules! impl_intern_key {
4444
impl ::std::fmt::Debug for $id {
4545
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4646
f.debug_tuple(stringify!($id))
47-
.field(&format_args!("{:04x}", self.0.as_u32()))
47+
.field(&format_args!("{:04x}", self.0.index()))
4848
.finish()
4949
}
5050
}
@@ -168,7 +168,7 @@ impl Files {
168168
}
169169
}
170170

171-
#[salsa_macros::interned(no_lifetime, debug, constructor=from_span)]
171+
#[salsa_macros::interned(no_lifetime, debug, constructor=from_span, revisions = usize::MAX)]
172172
#[derive(PartialOrd, Ord)]
173173
pub struct EditionedFileId {
174174
pub editioned_file_id: span::EditionedFileId,

src/tools/rust-analyzer/crates/hir-def/src/expr_store/path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ pub enum Path {
2929
// This type is being used a lot, make sure it doesn't grow unintentionally.
3030
#[cfg(target_arch = "x86_64")]
3131
const _: () = {
32-
assert!(size_of::<Path>() == 16);
33-
assert!(size_of::<Option<Path>>() == 16);
32+
assert!(size_of::<Path>() == 24);
33+
assert!(size_of::<Option<Path>>() == 24);
3434
};
3535

3636
#[derive(Debug, Clone, PartialEq, Eq, Hash)]

src/tools/rust-analyzer/crates/hir-def/src/hir/type_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pub enum TypeRef {
149149
}
150150

151151
#[cfg(target_arch = "x86_64")]
152-
const _: () = assert!(size_of::<TypeRef>() == 16);
152+
const _: () = assert!(size_of::<TypeRef>() == 24);
153153

154154
pub type TypeRefId = Idx<TypeRef>;
155155

src/tools/rust-analyzer/crates/hir-def/src/nameres/tests/incremental.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ fn no() {}
172172
"ast_id_map_shim",
173173
"parse_shim",
174174
"real_span_map_shim",
175-
"of_",
175+
"EnumVariants::of_",
176176
]
177177
"#]],
178178
expect![[r#"
@@ -181,7 +181,7 @@ fn no() {}
181181
"ast_id_map_shim",
182182
"file_item_tree_query",
183183
"real_span_map_shim",
184-
"of_",
184+
"EnumVariants::of_",
185185
]
186186
"#]],
187187
);

src/tools/rust-analyzer/crates/hir-expand/src/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ pub trait ExpandDatabase: RootQueryDb {
145145
fn syntax_context(&self, file: HirFileId, edition: Edition) -> SyntaxContext;
146146
}
147147

148-
#[salsa_macros::interned(no_lifetime, id = span::SyntaxContext)]
148+
#[salsa_macros::interned(no_lifetime, id = span::SyntaxContext, revisions = usize::MAX)]
149149
pub struct SyntaxContextWrapper {
150150
pub data: SyntaxContext,
151151
}

src/tools/rust-analyzer/crates/hir-expand/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ impl ExpandTo {
10561056

10571057
intern::impl_internable!(ModPath, attrs::AttrInput);
10581058

1059-
#[salsa_macros::interned(no_lifetime, debug)]
1059+
#[salsa_macros::interned(no_lifetime, debug, revisions = usize::MAX)]
10601060
#[doc(alias = "MacroFileId")]
10611061
pub struct MacroCallId {
10621062
pub loc: MacroCallLoc,

src/tools/rust-analyzer/crates/hir-ty/src/db.rs

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,6 @@ pub trait HirDatabase: DefDatabase + std::fmt::Debug {
236236
fn trait_impls_in_deps(&self, krate: Crate) -> Arc<[Arc<TraitImpls>]>;
237237

238238
// Interned IDs for Chalk integration
239-
#[salsa::interned]
240-
fn intern_type_or_const_param_id(
241-
&self,
242-
param_id: TypeOrConstParamId,
243-
) -> InternedTypeOrConstParamId;
244-
245-
#[salsa::interned]
246-
fn intern_lifetime_param_id(&self, param_id: LifetimeParamId) -> InternedLifetimeParamId;
247-
248239
#[salsa::interned]
249240
fn intern_impl_trait_id(&self, id: ImplTraitId) -> InternedOpaqueTyId;
250241

@@ -329,9 +320,31 @@ fn hir_database_is_dyn_compatible() {
329320
fn _assert_dyn_compatible(_: &dyn HirDatabase) {}
330321
}
331322

332-
impl_intern_key!(InternedTypeOrConstParamId, TypeOrConstParamId);
323+
#[salsa_macros::interned(no_lifetime, revisions = usize::MAX)]
324+
#[derive(PartialOrd, Ord)]
325+
pub struct InternedTypeOrConstParamId {
326+
pub loc: TypeOrConstParamId,
327+
}
328+
impl ::std::fmt::Debug for InternedTypeOrConstParamId {
329+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
330+
f.debug_tuple(stringify!(InternedTypeOrConstParamId))
331+
.field(&format_args!("{:04x}", self.0.index()))
332+
.finish()
333+
}
334+
}
333335

334-
impl_intern_key!(InternedLifetimeParamId, LifetimeParamId);
336+
#[salsa_macros::interned(no_lifetime, revisions = usize::MAX)]
337+
#[derive(PartialOrd, Ord)]
338+
pub struct InternedLifetimeParamId {
339+
pub loc: LifetimeParamId,
340+
}
341+
impl ::std::fmt::Debug for InternedLifetimeParamId {
342+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
343+
f.debug_tuple(stringify!(InternedLifetimeParamId))
344+
.field(&format_args!("{:04x}", self.0.index()))
345+
.finish()
346+
}
347+
}
335348

336349
impl_intern_key!(InternedConstParamId, ConstParamId);
337350

src/tools/rust-analyzer/crates/hir-ty/src/display.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,10 +1432,10 @@ impl HirDisplay for Ty {
14321432
match f.closure_style {
14331433
ClosureStyle::Hide => return write!(f, "{TYPE_HINT_TRUNCATION}"),
14341434
ClosureStyle::ClosureWithId => {
1435-
return write!(f, "{{closure#{:?}}}", id.0.as_u32());
1435+
return write!(f, "{{closure#{:?}}}", id.0.index());
14361436
}
14371437
ClosureStyle::ClosureWithSubst => {
1438-
write!(f, "{{closure#{:?}}}", id.0.as_u32())?;
1438+
write!(f, "{{closure#{:?}}}", id.0.index())?;
14391439
return hir_fmt_generics(f, substs.as_slice(Interner), None, None);
14401440
}
14411441
_ => (),

0 commit comments

Comments
 (0)