File tree Expand file tree Collapse file tree 4 files changed +45
-0
lines changed
src/test/ui/impl-trait/in-ctfe Expand file tree Collapse file tree 4 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ // This previously compiled, but broke with #101478.
2+ //
3+ // See that PR for more details.
14trait MyTrait : Copy {
25 const ASSOC : usize ;
36}
Original file line number Diff line number Diff line change 1+ // This previously compiled, but broke with #101478.
2+ //
3+ // See that PR for more details.
14trait MyTrait : Copy {
25 const ASSOC : usize ;
36}
Original file line number Diff line number Diff line change 1+ // This previously compiled, but broke with #101478.
2+ //
3+ // See that PR for more details.
4+ trait MyTrait : Copy {
5+ const ASSOC : u8 ;
6+ }
7+
8+ impl MyTrait for ( ) {
9+ const ASSOC : u8 = 0 ;
10+ }
11+
12+ const fn yeet ( ) -> impl MyTrait { }
13+
14+ const fn output < T : MyTrait > ( _: T ) -> u8 {
15+ <T as MyTrait >:: ASSOC
16+ }
17+
18+ const CT : u8 = output ( yeet ( ) ) ;
19+
20+ fn main ( ) {
21+ match 0 {
22+ CT => ( ) ,
23+ 1 .. => ( ) ,
24+ }
25+ }
Original file line number Diff line number Diff line change 1+ error: constant pattern depends on a generic parameter
2+ --> $DIR/match-arm-exhaustive.rs:19:9
3+ |
4+ LL | CT => (),
5+ | ^^
6+
7+ error: constant pattern depends on a generic parameter
8+ --> $DIR/match-arm-exhaustive.rs:19:9
9+ |
10+ LL | CT => (),
11+ | ^^
12+
13+ error: aborting due to 2 previous errors
14+
You can’t perform that action at this time.
0 commit comments