You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Constants in patterns cannot depend on generic parameters, so, this should not recommend rewriting into a match when the constants depend on generic parameters.
match idx.cmp(&I::LEN){Ordering::Less => self.init.get_homo(idx),Ordering::Equal => Some(self.last.into()),Ordering::Greater => None}
which should work. There's a help message in the diagnostic that mentions to use cmp, but I can see how it's easy to miss. Might be a good idea to provide an actual suggestion.
Description
Constants in patterns cannot depend on generic parameters, so, this should not recommend rewriting into a match when the constants depend on generic parameters.
Example can be found in my
hetero
crate:Lint output:
If rewritten to a match, like the suggestion implies:
The following error is triggered:
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: