-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Manual PartialEq impl not found for const generics. #94661
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
This is not a bug, this is intended. |
@ChayimFriedman2 Is there any way to manually implement PartialEq like I have it then? I am trying to get |
Your PartialEq implementation doesn't satisfy the transitivity requirement ( Static(1) == Dynamic == Static(2) => Static(1) == Static(2) ). Exactly because of the existence of this kind of ill-formed PartialEq implementation, the compiler cannot trust a custom PartialEq implementation for const generic dispatch. |
Closing as works as intended. |
I tried this code:
I expected to see this happen: I expected to be able to use DimType as a const generic type. I am able to use it when I derive PartialEq and Eq, but when I manually derive PartialEq it doesn't work.
Instead, this happened: I get an error:
tensor::DimType must be annotated with #[derive(PartialEq, Eq)] to be used as the type of a const parameter
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: