File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
src/test/ui/const-generics/issues Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ #![ feature( const_generics) ]
2+ #![ allow( incomplete_features) ]
3+
4+ trait Foo {
5+ const VAL : usize ;
6+ }
7+
8+ trait MyTrait { }
9+
10+ trait True { }
11+ struct Is < const T : bool > ;
12+ impl True for Is < { true } > { }
13+
14+ impl < T : Foo > MyTrait for T where Is < { T :: VAL == 5 } > : True { }
15+ //~^ ERROR constant expression depends on a generic parameter
16+ impl < T : Foo > MyTrait for T where Is < { T :: VAL == 6 } > : True { }
17+ //~^ ERROR constant expression depends on a generic parameter
18+
19+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error: constant expression depends on a generic parameter
2+ --> $DIR/issue-64494.rs:14:53
3+ |
4+ LL | impl<T: Foo> MyTrait for T where Is<{T::VAL == 5}>: True {}
5+ | ^^^^
6+ |
7+ = note: this may fail depending on what value the parameter takes
8+
9+ error: constant expression depends on a generic parameter
10+ --> $DIR/issue-64494.rs:16:53
11+ |
12+ LL | impl<T: Foo> MyTrait for T where Is<{T::VAL == 6}>: True {}
13+ | ^^^^
14+ |
15+ = note: this may fail depending on what value the parameter takes
16+
17+ error: aborting due to 2 previous errors
18+
You can’t perform that action at this time.
0 commit comments