We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Self
Into
#[derive(Into)] pub struct A( [u8; Self::SIZE]); impl A { const SIZE: usize = 32; }
This generates following code:
#[allow(clippy::unused_unit)] #[automatically_derived] impl derive_more::core::convert::From<A> for ( [u8; Self::SIZE] ) { #[inline] fn from(value: A) -> Self { (<[u8; Self::SIZE] as derive_more::core::convert::From<_>>::from(value.0)) } }
Which is clearly problematic because for [u8; Self::SIZE] doesn't make sense.
for [u8; Self::SIZE]
Self in such cases should be replaced with struct name.
The text was updated successfully, but these errors were encountered:
Seems related #335.
Sorry, something went wrong.
This workaround compiles, but the struct name needs to be kept in sync:
#[derive(Into)] pub struct A([u8; A::SIZE]);
Another workaround is to manually impl From<A> for [u8; A::SIZE].
impl From<A> for [u8; A::SIZE]
No branches or pull requests
This generates following code:
Which is clearly problematic because
for [u8; Self::SIZE]
doesn't make sense.Self
in such cases should be replaced with struct name.The text was updated successfully, but these errors were encountered: