We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4992eb2 commit c8f0abbCopy full SHA for c8f0abb
src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs
@@ -0,0 +1,28 @@
1
+// ignore-test
2
+
3
+// FIXME: This test should fail since, within a const impl of `Foo`, the bound on `Foo::Bar` should
4
+// require a const impl of `Add` for the associated type.
5
6
+#![allow(incomplete_features)]
7
+#![feature(const_trait_impl)]
8
+#![feature(const_fn)]
9
10
+struct NonConstAdd(i32);
11
12
+impl std::ops::Add for NonConstAdd {
13
+ type Output = Self;
14
15
+ fn add(self, rhs: Self) -> Self {
16
+ NonConstAdd(self.0 + rhs.0)
17
+ }
18
+}
19
20
+trait Foo {
21
+ type Bar: std::ops::Add;
22
23
24
+impl const Foo for NonConstAdd {
25
+ type Bar = NonConstAdd;
26
27
28
+fn main() {}
0 commit comments