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.

28 lines
385 B
Rust
Raw Normal View History

2021-09-02 14:29:04 +00:00
//@ build-pass
2023-08-06 13:20:55 +00:00
#![feature(const_trait_impl, effects)]
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() {}