-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE when casting &mut Trait to *mut Trait, same for casting &Trait to *const Trait #19109
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
Comments
duplicate of #18998 |
@oli-obk |
i don't think the legitimacy has anything to do with the error. these are already implicitly converted. so the explicit conversion is unnecessary anyway. trait Trait { }
fn function_trait(t: &mut Trait) {
let x : *mut Trait = t;
}
fn main() {} |
That the implicit conversion works while the explicit one doesn't is an interesting observation… Take this issue as "the explicit conversion does not work while it should" and the other one as "ICE when doing an incorrect type case to a raw trait pointer". |
maybe the explicit conversion that are also implictly possible should be sugar for an implicit conversion instead of having its own code. Not sure how easy that is to detect. |
Fixed now, just needs a test! |
fix: Do not show safety hints for extern items lacking semantics
This ICEs with the following message:
The text was updated successfully, but these errors were encountered: