]> git.proxmox.com Git - rustc.git/blob - src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / rfc-2632-const-trait-impl / super-traits-fail-2.rs
1 #![feature(const_trait_impl)]
2
3 // revisions: yy yn ny nn
4
5 #[cfg_attr(any(yy, yn), const_trait)]
6 trait Foo {
7 fn a(&self);
8 }
9
10 #[cfg_attr(any(yy, ny), const_trait)]
11 trait Bar: ~const Foo {}
12 //[ny,nn]~^ ERROR: ~const can only be applied to `#[const_trait]`
13
14 const fn foo<T: Bar>(x: &T) {
15 x.a();
16 //[yn,yy]~^ ERROR the trait bound
17 }
18
19 fn main() {}