add test
This commit is contained in:
parent
b5f680e748
commit
f825d6c6cc
26
src/test/ui/const-generics/const_trait_fn-issue-88433.rs
Normal file
26
src/test/ui/const-generics/const_trait_fn-issue-88433.rs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// build-pass
|
||||||
|
|
||||||
|
#![feature(const_trait_impl)]
|
||||||
|
|
||||||
|
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() {}
|
Loading…
Reference in New Issue
Block a user