Skip to content

Commit a2bdb99

Browse files
committed
Add const generics failing test for pattern types
1 parent ff24ef9 commit a2bdb99

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![feature(pattern_types)]
2+
#![feature(core_pattern_types)]
3+
#![feature(core_pattern_type)]
4+
5+
use std::pat::pattern_type;
6+
7+
trait Foo {}
8+
9+
impl<const START: u32, const END: u32> Foo for pattern_type!(u32 is START..=END) {}
10+
//~^ ERROR: range patterns must have constant range start and end
11+
//~| ERROR: range patterns must have constant range start and end
12+
13+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: "range patterns must have constant range start and end"
2+
--> $DIR/const_generics.rs:9:69
3+
|
4+
LL | impl<const START: u32, const END: u32> Foo for pattern_type!(u32 is START..=END) {}
5+
| ^^^^^
6+
7+
error: "range patterns must have constant range start and end"
8+
--> $DIR/const_generics.rs:9:77
9+
|
10+
LL | impl<const START: u32, const END: u32> Foo for pattern_type!(u32 is START..=END) {}
11+
| ^^^
12+
13+
error: aborting due to 2 previous errors
14+

0 commit comments

Comments
 (0)