2024-12-05 16:36:30 +00:00
|
|
|
//@ compile-flags: -Znext-solver
|
|
|
|
|
//@ check-pass
|
|
|
|
|
|
|
|
|
|
#![feature(const_trait_impl)]
|
|
|
|
|
#![allow(refining_impl_trait)]
|
|
|
|
|
|
|
|
|
|
#[const_trait]
|
|
|
|
|
pub trait Foo {
|
2025-03-11 12:08:45 +00:00
|
|
|
fn method(self) -> impl [const] Bar;
|
2024-12-05 16:36:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[const_trait]
|
|
|
|
|
pub trait Bar {}
|
|
|
|
|
|
|
|
|
|
struct A<T>(T);
|
2025-03-11 12:08:45 +00:00
|
|
|
impl<T> const Foo for A<T> where A<T>: [const] Bar {
|
|
|
|
|
fn method(self) -> impl [const] Bar {
|
2024-12-05 16:36:30 +00:00
|
|
|
self
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {}
|