-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
ICE in object_safety.rs due to method receiver not having a layout #57276
Comments
There is also the straightforward solution of not doing the layout checks if the layout is un-computable. But it seems like |
Triage: This is no longer ICE with the latest nightly, seems #78422 fixed it. |
It's ICE'd again (https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=dcac74ce4f9ee21c114a7659c5e86783), too late to add a regression test :(, removing the label.
|
The following code causes an ICE,
Error: the type `T` has an unknown layout
:Similar to #56806,
receiver_is_dispatchable
succeeds, and then there is an ICE during the layout sanity checks. In this case, it is because the method receiver is a type parameter and has no layout.receiver_is_dispatchable
checks that the following predicate holds:In this case, it reduces to
T: DispatchFromDyn<T>
, which is provided by a where clause. In #56806, it reduced toBox<dyn Trait>: DispatchFromDyn<Box<dyn Trait>>
. The check passes in both cases, and then there is an ICE during the layout sanity checks.One way to fix both of these cases would be to add an extra requirement to
receiver_is_dispatchable
: thatReceiver
andReceiver[Self => U]
are not the same type. I'm not sure if there are any edge cases that that doesn't cover.cc @varkor #57229
The text was updated successfully, but these errors were encountered: