Files
rust/tests/ui/traits/const-traits/const-cond-for-rpitit.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
365 B
Rust
Raw Normal View History

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 {
fn method(self) -> impl [const] Bar;
2024-12-05 16:36:30 +00:00
}
#[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 {
2024-12-05 16:36:30 +00:00
self
}
}
fn main() {}