forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#128376 - compiler-errors:finish-ur-vegetables, r=jieyouxu Mark `Parser::eat`/`check` methods as `#[must_use]` These methods return a `bool`, but we probably should either use these values or explicitly throw them away (e.g. when we just want to unconditionally eat a token if it exists). I changed a few places from `eat` to `expect`, but otherwise I tried to leave a comment explaining why the `eat` was okay. This also adds a test for the `pattern_type!` macro, which used to silently accept a missing `is` token.
- Loading branch information
Showing
10 changed files
with
51 additions
and
18 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//@ known-bug: #123809 | ||
type Positive = std::pat::pattern_type!(std::pat:: is 0..); | ||
type Positive = std::pat::pattern_type!(std::pat is 0..); | ||
|
||
pub 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,8 @@ | ||
#![feature(core_pattern_type, core_pattern_types)] | ||
|
||
use std::pat::pattern_type; | ||
|
||
fn main() { | ||
let x: pattern_type!(i32 0..1); | ||
//~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, or `is`, found `0` | ||
} |
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,8 @@ | ||
error: expected one of `!`, `(`, `+`, `::`, `<`, or `is`, found `0` | ||
--> $DIR/missing-is.rs:6:30 | ||
| | ||
LL | let x: pattern_type!(i32 0..1); | ||
| ^ expected one of `!`, `(`, `+`, `::`, `<`, or `is` | ||
|
||
error: aborting due to 1 previous error | ||
|