Update components/salsa-macro-rules/src/setup_interned_struct.rs

Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
This commit is contained in:
puuuuh 2024-10-04 13:17:15 +03:00 committed by puuuuh
parent 1e18334672
commit dcdf4d774d
No known key found for this signature in database
GPG key ID: 171E3E1356CEE151

View file

@ -67,7 +67,12 @@ macro_rules! setup_interned_struct {
type StructData<$db_lt> = ($($field_ty,)*); type StructData<$db_lt> = ($($field_ty,)*);
struct StructKey<$db_lt, $($indexed_ty: $zalsa::interned::Lookup<$field_ty>),*>($($indexed_ty,)* std::marker::PhantomData<&$db_lt ()>,); /// Key to use during hash lookups. Each field is some type that implements `Lookup<T>`
/// for the owned type. This permits interning with an `&str` when a `String` is required and so forth.
struct StructKey<$db_lt, $($indexed_ty: $zalsa::interned::Lookup<$field_ty>),*>(
$($indexed_ty,)*
std::marker::PhantomData<&$db_lt ()>,
);
impl<$db_lt, $($indexed_ty: $zalsa::interned::Lookup<$field_ty>),*> $zalsa::interned::Lookup<StructData<$db_lt>> impl<$db_lt, $($indexed_ty: $zalsa::interned::Lookup<$field_ty>),*> $zalsa::interned::Lookup<StructData<$db_lt>>
for StructKey<$db_lt, $($indexed_ty),*> { for StructKey<$db_lt, $($indexed_ty),*> {