]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs
Auto merge of #84589 - In-line:zircon-thread-name, r=JohnTitor
[rust.git] / src / test / ui / rfc-2632-const-trait-impl / assoc-type.rs
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 #![feature(const_trait_impl)]
7
8 struct NonConstAdd(i32);
9
10 impl std::ops::Add for NonConstAdd {
11     type Output = Self;
12
13     fn add(self, rhs: Self) -> Self {
14         NonConstAdd(self.0 + rhs.0)
15     }
16 }
17
18 trait Foo {
19     type Bar: std::ops::Add;
20 }
21
22 impl const Foo for NonConstAdd {
23     type Bar = NonConstAdd;
24 }
25
26 fn main() {}