We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9cd140e + 34ae968 commit ee43f34Copy full SHA for ee43f34
src/test/ui/const-generics/generic_const_exprs/issue-94293.rs
@@ -0,0 +1,31 @@
1
+// check-pass
2
+
3
+#![feature(generic_const_exprs)]
4
+#![allow(incomplete_features)]
5
+#![deny(const_evaluatable_unchecked)]
6
7
+pub struct If<const CONDITION: bool>;
8
+pub trait True {}
9
+impl True for If<true> {}
10
11
+pub struct FixedI8<const FRAC: u32> {
12
+ pub bits: i8,
13
+}
14
15
+impl<const FRAC_LHS: u32, const FRAC_RHS: u32> PartialEq<FixedI8<FRAC_RHS>> for FixedI8<FRAC_LHS>
16
+where
17
+ If<{ FRAC_RHS <= 8 }>: True,
18
+{
19
+ fn eq(&self, _rhs: &FixedI8<FRAC_RHS>) -> bool {
20
+ unimplemented!()
21
+ }
22
23
24
+impl<const FRAC: u32> PartialEq<i8> for FixedI8<FRAC> {
25
+ fn eq(&self, rhs: &i8) -> bool {
26
+ let rhs_as_fixed = FixedI8::<0> { bits: *rhs };
27
+ PartialEq::eq(self, &rhs_as_fixed)
28
29
30
31
+fn main() {}
0 commit comments