-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE when casting to trait object #17371
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
Labels
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Comments
I had a similar crash with slightly different repro, though I think it's the same bug so will add it here: trait T {}
struct S;
impl T for S {}
fn main() {
let s : &T = &{S as T};
}
|
Same here: trait A {}
fn main() {
0i as A;
} |
Dupe of #17441 (or rather, that bug was a dupe of this). This can be closed. |
Thanks @bkoropoff! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code is incorrect, since it tries to cast something to an unboxed trait object:
But it causes an ICE, when it should simply cause an error.
May be related to #17322
Error:
The text was updated successfully, but these errors were encountered: