blob: 4c755530b997901d42afbe3c15099c43af56b494 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#![feature(const_generics)]
#![allow(incomplete_features)]
trait Foo {
const VAL: usize;
}
trait MyTrait {}
trait True {}
struct Is<const T: bool>;
impl True for Is<{true}> {}
impl<T: Foo> MyTrait for T where Is<{T::VAL == 5}>: True {}
//~^ ERROR constant expression depends on a generic parameter
impl<T: Foo> MyTrait for T where Is<{T::VAL == 6}>: True {}
//~^ ERROR constant expression depends on a generic parameter
fn main() {}
|