]> git.proxmox.com Git - rustc.git/blame - src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / rfc-2632-const-trait-impl / assoc-type.rs
CommitLineData
74b04a01
XL
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
74b04a01 6#![feature(const_trait_impl)]
74b04a01
XL
7
8struct NonConstAdd(i32);
9
10impl 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
18trait Foo {
19 type Bar: std::ops::Add;
20}
21
22impl const Foo for NonConstAdd {
23 type Bar = NonConstAdd;
24}
25
26fn main() {}