rust/tests/ui/const-generics/const_trait_fn-issue-88433.rs

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

29 lines
409 B
Rust
Raw Normal View History

2021-09-02 14:29:04 +00:00
//@ build-pass
2024-06-14 12:16:15 +00:00
//@ compile-flags: -Znext-solver
2021-09-02 14:29:04 +00:00
2024-10-30 18:03:44 +00:00
#![feature(const_trait_impl)]
2021-09-02 14:29:04 +00:00
2022-08-28 06:27:31 +00:00
#[const_trait]
2021-09-02 14:29:04 +00:00
trait Func<T> {
type Output;
fn call_once(self, arg: T) -> Self::Output;
}
struct Closure;
impl const Func<&usize> for Closure {
type Output = usize;
fn call_once(self, arg: &usize) -> Self::Output {
*arg
}
}
enum Bug<T = [(); Closure.call_once(&0) ]> {
V(T),
}
fn main() {}