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.

30 lines
449 B
Rust
Raw Normal View History

2021-09-02 09:29:04 -05:00
//@ build-pass
2024-06-14 07:16:15 -05:00
//@ compile-flags: -Znext-solver
2021-09-02 09:29:04 -05:00
2024-06-25 03:36:40 -05:00
#![allow(incomplete_features)]
#![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() {}