mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
30 lines
449 B
Rust
30 lines
449 B
Rust
//@ build-pass
|
|
//@ compile-flags: -Znext-solver
|
|
|
|
#![allow(incomplete_features)]
|
|
#![feature(const_trait_impl, effects)]
|
|
|
|
#[const_trait]
|
|
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() {}
|