-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start handling pattern types at the HIR -> Ty conversion boundary
- Loading branch information
Showing
6 changed files
with
46 additions
and
7 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
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
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
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,9 @@ | ||
use rustc_macros::Diagnostic; | ||
use rustc_span::Span; | ||
|
||
#[derive(Diagnostic)] | ||
#[diag(hir_analysis_pattern_type_wild_pat)] | ||
pub struct WildPatTy { | ||
#[primary_span] | ||
pub span: Span, | ||
} |
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
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 |
---|---|---|
@@ -1,19 +1,25 @@ | ||
error[E0586]: inclusive range with no end | ||
--> $DIR/bad_pat.rs:9:43 | ||
--> $DIR/bad_pat.rs:7:43 | ||
| | ||
LL | type NonNullU32_2 = pattern_type!(u32 is 1..=); | ||
| ^^^ help: use `..` instead | ||
| | ||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) | ||
|
||
error[E0586]: inclusive range with no end | ||
--> $DIR/bad_pat.rs:11:40 | ||
--> $DIR/bad_pat.rs:9:40 | ||
| | ||
LL | type Positive2 = pattern_type!(i32 is 0..=); | ||
| ^^^ help: use `..` instead | ||
| | ||
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`) | ||
|
||
error: aborting due to 2 previous errors | ||
error: "wildcard patterns are not permitted for pattern types" | ||
--> $DIR/bad_pat.rs:11:33 | ||
| | ||
LL | type Wild = pattern_type!(() is _); | ||
| ^ | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0586`. |