rust/tests/ui/const-generics/issues/issue-85031-2.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
364 B
Rust
Raw Normal View History

// check-pass
2023-01-11 13:42:27 -06:00
// known-bug: unknown
// This should not compile, as the compiler should not know
// `A - 0` is satisfied `?x - 0` if `?x` is inferred to `A`.
2021-08-19 13:13:57 -05:00
#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
2021-08-19 13:13:57 -05:00
pub struct Ref<'a>(&'a i32);
impl<'a> Ref<'a> {
pub fn foo<const A: usize>() -> [(); A - 0] {
Self::foo()
}
}
fn main() {}