parent
73bde2f0ce
commit
8645ac4218
3 changed files with 7 additions and 7 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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() {}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
| _________________________________^
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue