]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/issues/issue-85031-2.rs
Rollup merge of #106244 - atouchet:readme3, r=workingjubilee
[rust.git] / tests / ui / const-generics / issues / issue-85031-2.rs
1 // check-pass
2 // known-bug
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         //~^ WARN function cannot
14         Self::foo()
15     }
16 }
17
18 fn main() {}