Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow interned values as tracked function arguments #523

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

MichaReiser
Copy link
Contributor

This fixes the second part of #521 where tracked functions didn't accept interned values

Copy link

netlify bot commented Jul 20, 2024

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit 9ba36eb
🔍 Latest deploy log https://app.netlify.com/sites/salsa-rs/deploys/669b617b25b7780008d65cce

@@ -93,6 +93,12 @@ macro_rules! setup_interned_struct {
}
}

impl<$db_lt> $zalsa::LookupId<$db_lt> for $Struct<$db_lt> {
fn lookup_id(id: salsa::Id, db: &$db_lt dyn $zalsa::Database) -> Self {
$Configuration::ingredient(db).interned_value(id)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure about this but it compiles and the test passes ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this looks good.

@@ -93,6 +93,12 @@ macro_rules! setup_interned_struct {
}
}

impl<$db_lt> $zalsa::LookupId<$db_lt> for $Struct<$db_lt> {
fn lookup_id(id: salsa::Id, db: &$db_lt dyn $zalsa::Database) -> Self {
$Configuration::ingredient(db).interned_value(id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this looks good.

@nikomatsakis nikomatsakis added this pull request to the merge queue Jul 22, 2024
Merged via the queue into salsa-rs:master with commit 431fd14 Jul 22, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants