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#123648 - oli-obk:pattern_types_syntax, r=compiler-errors Avoid ICEing without the pattern_types feature gate fixes rust-lang#123643
- Loading branch information
Showing
4 changed files
with
44 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//! This test ensures we do not ICE for unimplemented | ||
//! patterns unless the feature gate is enabled. | ||
|
||
#![feature(core_pattern_type)] | ||
#![feature(core_pattern_types)] | ||
|
||
use std::pat::pattern_type; | ||
|
||
type Always = pattern_type!(Option<u32> is Some(_)); | ||
//~^ ERROR: pattern types are unstable | ||
|
||
type Binding = pattern_type!(Option<u32> is x); | ||
//~^ ERROR: pattern types are unstable | ||
|
||
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,23 @@ | ||
error[E0658]: pattern types are unstable | ||
--> $DIR/unimplemented_pat.rs:9:15 | ||
| | ||
LL | type Always = pattern_type!(Option<u32> is Some(_)); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information | ||
= help: add `#![feature(pattern_types)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error[E0658]: pattern types are unstable | ||
--> $DIR/unimplemented_pat.rs:12:16 | ||
| | ||
LL | type Binding = pattern_type!(Option<u32> is x); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #123646 <https://github.com/rust-lang/rust/issues/123646> for more information | ||
= help: add `#![feature(pattern_types)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |