Skip to content

feat: Unwind with specific type when encountering an unexpected cycle #856

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

Merged
merged 1 commit into from
May 22, 2025

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented May 9, 2025

Closes #704

Copy link

netlify bot commented May 9, 2025

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit 4a7cfdd
🔍 Latest deploy log https://app.netlify.com/projects/salsa-rs/deploys/682ed253ee20ec0008c188ec

Copy link

codspeed-hq bot commented May 9, 2025

CodSpeed Performance Report

Merging #856 will degrade performances by 5.46%

Comparing Veykril:veykril/push-svwrmptylysy (4a7cfdd) with master (2d4321e)

Summary

❌ 1 (👁 1) regressions
✅ 11 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
👁 amortized[Input] 3 µs 3.2 µs -5.46%

@Veykril Veykril force-pushed the veykril/push-svwrmptylysy branch from 0690fcc to 4a7cfdd Compare May 22, 2025 07:29
@Veykril Veykril enabled auto-merge May 22, 2025 07:29
@Veykril Veykril changed the title Unwind with specific type when encountering an unexpected cycle feat: Unwind with specific type when encountering an unexpected cycle May 22, 2025
@Veykril Veykril added this pull request to the merge queue May 22, 2025
Merged via the queue into salsa-rs:master with commit 4327d6b May 22, 2025
11 checks passed
@Veykril Veykril deleted the veykril/push-svwrmptylysy branch May 22, 2025 07:52
@github-actions github-actions bot mentioned this pull request May 22, 2025
@ChayimFriedman2
Copy link
Contributor

This caused cycles in r-a to not print the backtrace or anything, which is quite confusing - is there something we can do to prevent it from just panicking? Why not panic with a string?

@Veykril
Copy link
Member Author

Veykril commented May 29, 2025

Oh, that's what I forgot to do on the rust-analyze side, type cast the payload to this new type 🤦 We can also make this capture a backtrace here fwiw

is there something we can do to prevent it from just panicking?

I am not sure I understand what you mean with this.

@ChayimFriedman2
Copy link
Contributor

is there something we can do to prevent it from just panicking?

I am not sure I understand what you mean with this.

Oh, I realize I was quite unclear - I meant prevent it from just panicking, causing e.g. tests to fail, with nothing printed.

@Veykril
Copy link
Member Author

Veykril commented May 29, 2025

Ah, no, I believe Rust (or well, libtest) doesn't allow you do that. It just catches panic payloads and tries to downcast them to a string.

@Veykril
Copy link
Member Author

Veykril commented May 29, 2025

We could maybe toggle behavior here with an env var? (not a feature flag as that invalidates the build cache) Though I guess unless the default is to panic it wouldn't make a lot of sense either

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.

Panic with predictable value if there is no initial fn in cycle
4 participants