about summary refs log tree commit diff
path: root/tests/ui/traits/const-traits/const-cond-for-rpitit.rs
blob: da83e054dd9bb8c0c7dc7decceea2652e1bd6cef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//@ compile-flags: -Znext-solver
//@ check-pass

#![feature(const_trait_impl)]
#![allow(refining_impl_trait)]

#[const_trait]
pub trait Foo {
    fn method(self) -> impl [const] Bar;
}

#[const_trait]
pub trait Bar {}

struct A<T>(T);
impl<T> const Foo for A<T> where A<T>: [const] Bar {
    fn method(self) -> impl [const] Bar {
        self
    }
}

fn main() {}