2021-09-02 09:29:04 -05:00
|
|
|
// build-pass
|
|
|
|
|
|
|
|
#![feature(const_trait_impl)]
|
|
|
|
|
2022-08-28 01:27:31 -05:00
|
|
|
#[const_trait]
|
2021-09-02 09:29:04 -05: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() {}
|