diff options
| author | b-naber <bn263@gmx.de> | 2021-09-02 16:29:04 +0200 |
|---|---|---|
| committer | b-naber <bn263@gmx.de> | 2021-09-02 16:34:25 +0200 |
| commit | f825d6c6ccb5bc1eab9dfda96d3189f7092eb867 (patch) | |
| tree | ed682735211e7a58526775a3e21b2e537ff4e9fc | |
| parent | b5f680e7484dd96b1417c0219c5616ef2cd82d9d (diff) | |
| download | rust-f825d6c6ccb5bc1eab9dfda96d3189f7092eb867.tar.gz rust-f825d6c6ccb5bc1eab9dfda96d3189f7092eb867.zip | |
add test
| -rw-r--r-- | src/test/ui/const-generics/const_trait_fn-issue-88433.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/const_trait_fn-issue-88433.rs b/src/test/ui/const-generics/const_trait_fn-issue-88433.rs new file mode 100644 index 00000000000..8724fa69825 --- /dev/null +++ b/src/test/ui/const-generics/const_trait_fn-issue-88433.rs @@ -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() {} |
