diff options
Diffstat (limited to 'src/test/ui/const-generics/generic_const_exprs/issue-84669.rs')
-rw-r--r-- | src/test/ui/const-generics/generic_const_exprs/issue-84669.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-84669.rs b/src/test/ui/const-generics/generic_const_exprs/issue-84669.rs new file mode 100644 index 000000000..3933ff20a --- /dev/null +++ b/src/test/ui/const-generics/generic_const_exprs/issue-84669.rs @@ -0,0 +1,30 @@ +// build-pass + +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] + +trait Foo { + type Output; + + fn foo() -> Self::Output; +} + +impl Foo for [u8; 3] { + type Output = [u8; 1 + 2]; + + fn foo() -> [u8; 3] { + [1u8; 3] + } +} + +fn bug<const N: usize>() +where + [u8; N]: Foo, + <[u8; N] as Foo>::Output: AsRef<[u8]>, +{ + <[u8; N]>::foo().as_ref(); +} + +fn main() { + bug::<3>(); +} |