]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/occurs-check/unify-n-nplusone.rs
Rollup merge of #106661 - mjguzik:linux_statx, r=Mark-Simulacrum
[rust.git] / tests / ui / const-generics / occurs-check / unify-n-nplusone.rs
1 #![feature(generic_const_exprs)]
2 #![allow(incomplete_features)]
3
4 // This test would tries to unify `N` with `N + 1` which must fail the occurs check.
5
6 fn bind<const N: usize>(value: [u8; N]) -> [u8; N + 1] {
7     todo!()
8 }
9
10 fn sink(_: [u8; 5]) {}
11
12 fn main() {
13     let mut arr = Default::default();
14     arr = bind(arr); //~ ERROR mismatched types
15     sink(arr);
16 }