-
Notifications
You must be signed in to change notification settings - Fork 1
[3/n] [daft-derive] attempt to better annotate semantic errors #60
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
[3/n] [daft-derive] attempt to better annotate semantic errors #60
Conversation
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1 [skip ci]
- name: Test without ui_test | ||
run: just powerset nextest run -E 'not binary(ui_test)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to use nextest for this because cargo test doesn't provide a way to exclude a binary.
# The intent is to keep this updated as new stable versions are relased. | ||
|
||
[toolchain] | ||
channel = "1.85.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to check this in because the new file that got added produces slightly different output on 1.81.
error[E0277]: the trait bound `NonDiffable: Diffable` is not satisfied | ||
--> tests/fixtures/invalid/struct-field-not-diffable.rs:5:10 | ||
| | ||
5 | #[derive(Diffable)] | ||
| ^^^^^^^^ the trait `Diffable` is not implemented for `NonDiffable` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wish I could squelch these errors -- sadly not possible at the moment due to rust-lang/rust#48214.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it.
error[E0277]: the trait bound `NonDiffable: Diffable` is not satisfied | ||
--> tests/fixtures/invalid/struct-field-not-diffable.rs:8:5 | ||
| | ||
8 | b: NonDiffable, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome :)
Created using spr 1.3.6-beta.1 [skip ci]
Add some span info to try and annotate semantic errors better (such as
highlighting the name of the field that's not diffable).
This isn't perfect for now because we still produce some call-site errors, but
at least we produce one error that's attributed directly to the field name so
rust-analyzer should be happy. I tried adding more bounds but ran into
rust-lang/rust#48214.