// Allows tuple structs and variants in more contexts,
// Permits numeric fields in struct expressions and patterns.
- (active, relaxed_adts, "1.12.0", Some(35626))
+ (active, relaxed_adts, "1.12.0", Some(35626)),
+
+ // The `!` type
+ (active, bang_type, "1.13.0", Some(35121))
);
declare_features! (
gate_feature_post!(&self, conservative_impl_trait, ty.span,
"`impl Trait` is experimental");
}
+ ast::TyKind::Empty => {
+ gate_feature_post!(&self, bang_type, ty.span,
+ "The `!` type is experimental");
+ },
_ => {}
}
visit::walk_ty(self, ty)
}
+ fn visit_fn_ret_ty(&mut self, ret_ty: &ast::FunctionRetTy) {
+ if let ast::FunctionRetTy::Ty(ref output_ty) = *ret_ty {
+ match output_ty.node {
+ ast::TyKind::Empty => return,
+ _ => (),
+ };
+ visit::walk_ty(self, output_ty)
+ }
+ }
+
fn visit_expr(&mut self, e: &ast::Expr) {
match e.node {
ast::ExprKind::Box(_) => {
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your,
+// "The `!` type is experimental");
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn visit_vis(&mut self, vis: &Visibility) {
walk_vis(self, vis)
}
+ fn visit_fn_ret_ty(&mut self, ret_ty: &FunctionRetTy) {
+ walk_fn_ret_ty(self, ret_ty)
+ }
}
#[macro_export]
visitor.visit_pat(&argument.pat);
visitor.visit_ty(&argument.ty)
}
- walk_fn_ret_ty(visitor, &function_declaration.output)
+ visitor.visit_fn_ret_ty(&function_declaration.output)
}
pub fn walk_fn_kind<V: Visitor>(visitor: &mut V, function_kind: FnKind) {