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