Revert "pre-expansion gate try_blocks"

This reverts commit 1935ba658c.
This commit is contained in:
Eduard-Mihai Burtescu 2019-10-31 18:28:36 +02:00
parent 73bde2f0ce
commit 8645ac4218
3 changed files with 7 additions and 7 deletions

View File

@ -518,6 +518,9 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
"type ascription is experimental");
}
}
ast::ExprKind::TryBlock(_) => {
gate_feature_post!(&self, try_blocks, e.span, "`try` expression is experimental");
}
ast::ExprKind::Block(_, opt_label) => {
if let Some(label) = opt_label {
gate_feature_post!(&self, label_break_value, label.ident.span,

View File

@ -1,12 +1,9 @@
// compile-flags: --edition 2018
#[cfg(FALSE)]
fn foo() {
let try_result: Option<_> = try { //~ ERROR `try` blocks are unstable
pub fn main() {
let try_result: Option<_> = try { //~ ERROR `try` expression is experimental
let x = 5;
x
};
assert_eq!(try_result, Some(5));
}
fn main() {}

View File

@ -1,5 +1,5 @@
error[E0658]: `try` blocks are unstable
--> $DIR/feature-gate-try_blocks.rs:5:33
error[E0658]: `try` expression is experimental
--> $DIR/feature-gate-try_blocks.rs:4:33
|
LL | let try_result: Option<_> = try {
| _________________________________^