-
Notifications
You must be signed in to change notification settings - Fork 13.4k
assertion failed: (left == right) && (right == left)
(left: 1
, right: 0
)
#8516
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I tried looking into this a bit. The failed assertion is in I'm not particularly familiar with this code (or really, any of the compiler yet), but the null case in this enum is of course |
Indeed, that assertion is wrong and should be deleted. A variant with size-0 contents is eligible to be a null pointer, but since size-0 types like The test |
Updated code, new assertion: #[feature(struct_variant)];
enum Either {
One(()),
Other { left:~str, right:~str}
}
static one : Either = One(());
fn main () {}
|
This doesn't need |
I haven't looked at Rust or this issue in several months; if there's Carl Eastlund On Sun, Mar 2, 2014 at 5:19 AM, Eduard Burtescu notifications@github.heygears.comwrote:
|
@eddyb the issue description doesn't really need updating, especially since there's no specifics still. |
I'm sure I commented on this somewhere at some point since I wrote that last comment — I was assuming that an undef could be wrapped in a struct to make it not-undef (because undef is used for alignment padding, because we have to add our own for constants in some cases), but that doesn't actually work. So the |
Here's the program:
Here's the error message:
The text was updated successfully, but these errors were encountered: