blob: 96d19203109a5761b2cb11717a2c0f44f3b324b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, 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 {}
//[full]~^ ERROR constant expression depends on a generic parameter
//[min]~^^ ERROR generic parameters may not be used in const operations
impl<T: Foo> MyTrait for T where Is<{T::VAL == 6}>: True {}
//[full]~^ ERROR constant expression depends on a generic parameter
//[min]~^^ ERROR generic parameters may not be used in const operations
//[min]~| ERROR conflicting implementations of trait `MyTrait`
fn main() {}
|