]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/issues/issue-85031-2.rs
Rollup merge of #106779 - RReverser:patch-2, r=Mark-Simulacrum
[rust.git] / tests / ui / const-generics / issues / issue-85031-2.rs
1 // check-pass
2 // known-bug: unknown
3
4 // This should not compile, as the compiler should not know
5 // `A - 0` is satisfied `?x - 0` if `?x` is inferred to `A`.
6 #![allow(incomplete_features)]
7 #![feature(generic_const_exprs)]
8
9 pub struct Ref<'a>(&'a i32);
10
11 impl<'a> Ref<'a> {
12     pub fn foo<const A: usize>() -> [(); A - 0] {
13         Self::foo()
14     }
15 }
16
17 fn main() {}