-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add const generics failing test for pattern types
- Loading branch information
1 parent
ff24ef9
commit a2bdb99
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#![feature(pattern_types)] | ||
#![feature(core_pattern_types)] | ||
#![feature(core_pattern_type)] | ||
|
||
use std::pat::pattern_type; | ||
|
||
trait Foo {} | ||
|
||
impl<const START: u32, const END: u32> Foo for pattern_type!(u32 is START..=END) {} | ||
//~^ ERROR: range patterns must have constant range start and end | ||
//~| ERROR: range patterns must have constant range start and end | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: "range patterns must have constant range start and end" | ||
--> $DIR/const_generics.rs:9:69 | ||
| | ||
LL | impl<const START: u32, const END: u32> Foo for pattern_type!(u32 is START..=END) {} | ||
| ^^^^^ | ||
|
||
error: "range patterns must have constant range start and end" | ||
--> $DIR/const_generics.rs:9:77 | ||
| | ||
LL | impl<const START: u32, const END: u32> Foo for pattern_type!(u32 is START..=END) {} | ||
| ^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|