Skip to content

Commit 1fb939d

Browse files
committed
Bump salsa
1 parent bff3e1e commit 1fb939d

File tree

10 files changed

+28
-29
lines changed

10 files changed

+28
-29
lines changed

Cargo.lock

Lines changed: 11 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ debug = 2
4848

4949
# ungrammar = { path = "../ungrammar" }
5050

51-
# salsa = { path = "../salsa" }
51+
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

crates/base-db/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ macro_rules! impl_intern_key {
4343
impl ::std::fmt::Debug for $id {
4444
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4545
f.debug_tuple(stringify!($id))
46-
.field(&format_args!("{:04x}", self.0.as_u32()))
46+
.field(&format_args!("{:04x}", self.0.index()))
4747
.finish()
4848
}
4949
}

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)]

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

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
_ => (),

crates/hir-ty/src/mapping.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,30 +137,30 @@ pub fn from_assoc_type_id(id: AssocTypeId) -> TypeAliasId {
137137
pub fn from_placeholder_idx(db: &dyn HirDatabase, idx: PlaceholderIndex) -> TypeOrConstParamId {
138138
assert_eq!(idx.ui, chalk_ir::UniverseIndex::ROOT);
139139
// SAFETY: We cannot really encapsulate this unfortunately, so just hope this is sound.
140-
let interned_id = FromId::from_id(unsafe { Id::from_u32(idx.idx.try_into().unwrap()) });
140+
let interned_id = FromId::from_id(unsafe { Id::from_index(idx.idx.try_into().unwrap()) });
141141
db.lookup_intern_type_or_const_param_id(interned_id)
142142
}
143143

144144
pub fn to_placeholder_idx(db: &dyn HirDatabase, id: TypeOrConstParamId) -> PlaceholderIndex {
145145
let interned_id = db.intern_type_or_const_param_id(id);
146146
PlaceholderIndex {
147147
ui: chalk_ir::UniverseIndex::ROOT,
148-
idx: interned_id.as_id().as_u32() as usize,
148+
idx: interned_id.as_id().index() as usize,
149149
}
150150
}
151151

152152
pub fn lt_from_placeholder_idx(db: &dyn HirDatabase, idx: PlaceholderIndex) -> LifetimeParamId {
153153
assert_eq!(idx.ui, chalk_ir::UniverseIndex::ROOT);
154154
// SAFETY: We cannot really encapsulate this unfortunately, so just hope this is sound.
155-
let interned_id = FromId::from_id(unsafe { Id::from_u32(idx.idx.try_into().unwrap()) });
155+
let interned_id = FromId::from_id(unsafe { Id::from_index(idx.idx.try_into().unwrap()) });
156156
db.lookup_intern_lifetime_param_id(interned_id)
157157
}
158158

159159
pub fn lt_to_placeholder_idx(db: &dyn HirDatabase, id: LifetimeParamId) -> PlaceholderIndex {
160160
let interned_id = db.intern_lifetime_param_id(id);
161161
PlaceholderIndex {
162162
ui: chalk_ir::UniverseIndex::ROOT,
163-
idx: interned_id.as_id().as_u32() as usize,
163+
idx: interned_id.as_id().index() as usize,
164164
}
165165
}
166166

crates/ide-db/src/prime_caches.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,5 +272,5 @@ fn crate_name(db: &RootDatabase, krate: Crate) -> Symbol {
272272
.display_name
273273
.as_deref()
274274
.cloned()
275-
.unwrap_or_else(|| Symbol::integer(salsa::plumbing::AsId::as_id(&krate).as_u32() as usize))
275+
.unwrap_or_else(|| Symbol::integer(salsa::plumbing::AsId::as_id(&krate).index() as usize))
276276
}

crates/ide/src/view_crate_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl<'a> dot::Labeller<'a, Crate, Edge<'a>> for DotCrateGraph<'_> {
7979
}
8080

8181
fn node_id(&'a self, n: &Crate) -> Id<'a> {
82-
let id = n.as_id().as_u32();
82+
let id = n.as_id().index();
8383
Id::new(format!("_{id:?}")).unwrap()
8484
}
8585

crates/span/src/hygiene.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,14 @@ impl<'db> SyntaxContext {
326326
None
327327
} else {
328328
// SAFETY: By our invariant, this is either a root (which we verified it's not) or a valid `salsa::Id`.
329-
unsafe { Some(salsa::Id::from_u32(self.0)) }
329+
unsafe { Some(salsa::Id::from_index(self.0)) }
330330
}
331331
}
332332

333333
#[inline]
334334
fn from_salsa_id(id: salsa::Id) -> Self {
335335
// SAFETY: This comes from a Salsa ID.
336-
unsafe { Self::from_u32(id.as_u32()) }
336+
unsafe { Self::from_u32(id.index()) }
337337
}
338338

339339
#[inline]

0 commit comments

Comments
 (0)