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
INSP: Add #[repr(...)]
quick fix for E0308 error
#8087
Conversation
This quick fix was strongly inspired by this commit that added a quick fix for changing function return type. Would appreciate any recommendations on improving user-facing messages and errors. |
#[repr(...)]
quick fix for E0308 error
src/test/kotlin/org/rust/ide/inspections/typecheck/ChangeReprAttributeFixTest.kt
Outdated
Show resolved
Hide resolved
if (element.containingCrate?.origin != PackageOrigin.WORKSPACE) return null | ||
|
||
// fix only works for integral expressions inside enums. expression type should not be an alias | ||
if (actualTy.isIntegral && actualTy.aliasedBy == null && findEnumOwner(element) != null) |
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.
28a125b
to
bf40047
Compare
I have rebased the branch on master and pushed some minor changes. |
bf40047
to
3ce84d4
Compare
#[repr(...)]
quick fix for E0308 error#[repr(...)]
quick fix for E0308 error
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.
bors r+
Build succeeded: |
Congratulations, guys! i tried to finish this a few months ago but couldn't run the test suit, glad you got around to it 😄 |
Fixes #7894.
changelog: Add a quick fix for type mismatch E0308 error that adds a
#[repr(...)]
attribute to a enum:=>