-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Clean up cast categorization #97649
Comments
add cast kind of from_exposed_addr (int-to-ptr casts) This is basically the dual to rust-lang#97582, for int2ptr casts. Cc `@tmiasko` rust-lang#97649
add cast kind of from_exposed_addr (int-to-ptr casts) This is basically the dual to rust-lang/rust#97582, for int2ptr casts. Cc `@tmiasko` rust-lang/rust#97649
Besides that, I've taken a look at some of the surrounding stuff. My rough guess is that the principled thing to do here would be as follows: First, stop sharing types (specifically As to what this
I'm not sure who is best to ask about the viability of this plan, so cc @oli-obk I guess? |
Fully agreed.
The source and dest type are available anyway, right? In MIR at least, the source is an operand and that always has a type. So only a destination type would be needed. Miri indeed mostly ignores the |
|
I do prefer full enumeration of all casts, mostly because it keeps biting us to redo categorization everywhere. |
I would say they are great candidates for the new |
Remove `mir::CastKind::Misc` As discussed in rust-lang#97649 `mir::CastKind::Misc` is not clear, this PR addresses that by creating a new enum variant for every valid cast. r? `@oli-obk`
Remove `mir::CastKind::Misc` As discussed in rust-lang#97649 `mir::CastKind::Misc` is not clear, this PR addresses that by creating a new enum variant for every valid cast. r? ``@oli-obk``
Remove `mir::CastKind::Misc` As discussed in rust-lang#97649 `mir::CastKind::Misc` is not clear, this PR addresses that by creating a new enum variant for every valid cast. r? ```@oli-obk```
Remove `mir::CastKind::Misc` As discussed in rust-lang#97649 `mir::CastKind::Misc` is not clear, this PR addresses that by creating a new enum variant for every valid cast. r? ````@oli-obk````
Remove `mir::CastKind::Misc` As discussed in rust-lang#97649 `mir::CastKind::Misc` is not clear, this PR addresses that by creating a new enum variant for every valid cast. r? ````@oli-obk````
Currently, our classification of casts is kind of a mess:
mir::CastKind
, but it has aMisc
variant and most casts fall in that category (this is what ends up in the MIR).ty::cast::CastKind
that has a seemingly independent classification (no idea where this is used).CastTy
type, but can it really represent all types in a cast? If yes, I'd expect to seeunwrap
s around here.thir::ExprKind
, we haveCast
andPointer
expressions, the latter also being casts.I don't know how these all relate, but it looks like some cleanup is dearly necessary here.
The text was updated successfully, but these errors were encountered: