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

[book] fix the cycle fallback section to match current code #528

Merged
merged 3 commits into from
Aug 7, 2024

Conversation

carljm
Copy link
Contributor

@carljm carljm commented Jul 25, 2024

Update the book section on cycle fallbacks to match what actually worked for me with the current Salsa code in main branch.

Copy link

netlify bot commented Jul 25, 2024

Deploy Preview for salsa-rs ready!

Name Link
🔨 Latest commit 148abe3
🔍 Latest deploy log https://app.netlify.com/sites/salsa-rs/deploys/66a7c33bd35c6200089e5679
😎 Deploy Preview https://deploy-preview-528--salsa-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@carljm carljm marked this pull request as ready for review July 25, 2024 03:35
Copy link
Member

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

Looks great, left a few nits. Is there a test case or example we can point people at?

book/src/cycles/fallback.md Outdated Show resolved Hide resolved
book/src/cycles/fallback.md Outdated Show resolved Hide resolved
@carljm
Copy link
Contributor Author

carljm commented Jul 29, 2024

Is there a test case or example we can point people at?

Good call, I'll add a link to

salsa/tests/cycles.rs

Lines 132 to 141 in cd339fc

#[salsa::tracked(recovery_fn=recover_a)]
fn cycle_a(db: &dyn Db, abc: ABC) -> Result<(), Error> {
abc.a(db).invoke(db, abc)
}
fn recover_a(db: &dyn Db, cycle: &salsa::Cycle, abc: ABC) -> Result<(), Error> {
Err(Error {
cycle: cycle.participant_keys().map(|k| format!("{k:?}")).collect(),
})
}

@nikomatsakis nikomatsakis added this pull request to the merge queue Aug 7, 2024
Merged via the queue into salsa-rs:master with commit 05c7fbe Aug 7, 2024
6 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