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

salsa-macros: handle invalid inputs in a way friendlier to rust-analyzer #604

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

jhgg
Copy link
Contributor

@jhgg jhgg commented Oct 24, 2024

fixes #580 by taking a similar strategy to tokio-rs/tokio#4162

i did this in all proc macros so that they would all work as well, however it is trivial to just dial this down to just tracked if that's desired.

this however, does have a potential downside which is that the compiler error messages are a bit more verbose because rustc is now checking the input tokens as well if the macro expansion fails. you can see these in the additional lines added to the compiler fail tests.

Copy link

netlify bot commented Oct 24, 2024

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit 10d14f0
🔍 Latest deploy log https://app.netlify.com/sites/salsa-rs/deploys/671adca7c8447200086759f0

Copy link

codspeed-hq bot commented Oct 24, 2024

CodSpeed Performance Report

Merging #604 will not alter performance

Comparing jhgg:proc-macro-friendliness-for-ra (10d14f0) with master (254c749)

Summary

✅ 8 untouched benchmarks

@nikomatsakis nikomatsakis added this pull request to the merge queue Oct 25, 2024
Merged via the queue into salsa-rs:master with commit 5eed7e9 Oct 25, 2024
10 checks passed
@jhgg jhgg deleted the proc-macro-friendliness-for-ra branch October 26, 2024 19:56
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.

salsa::tracked proc-macro on fns/impls should handle invalid inputs
2 participants