diff options
| author | Andrew Cann <shum@canndrew.org> | 2016-08-02 15:56:20 +0800 |
|---|---|---|
| committer | Andrew Cann <shum@canndrew.org> | 2016-08-13 21:37:09 +0800 |
| commit | fadabe08f52ce524a0cbb5af327e55db61198024 (patch) | |
| tree | 7240d1e35980a8c2eefa26741b63a174b55fc016 /src/libsyntax | |
| parent | f0a8b6d43f26907ac7d7abc35510878f61551fbf (diff) | |
| download | rust-fadabe08f52ce524a0cbb5af327e55db61198024.tar.gz rust-fadabe08f52ce524a0cbb5af327e55db61198024.zip | |
Rename empty/bang to never
Split Ty::is_empty method into is_never and is_uninhabited
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/fold.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/visit.rs | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 9046a44fdc6..f8a5cb0b04a 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1358,8 +1358,8 @@ pub enum TyKind { Rptr(Option<Lifetime>, MutTy), /// A bare function (e.g. `fn(usize) -> bool`) BareFn(P<BareFnTy>), - /// The empty type (`!`) - Empty, + /// The never type (`!`) + Never, /// A tuple (`(A, B, C, D,...)`) Tup(Vec<P<Ty>> ), /// A path (`module::module::...::Type`), optionally diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index efedc7229e6..734d8d44256 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -287,7 +287,7 @@ declare_features! ( (active, relaxed_adts, "1.12.0", Some(35626)), // The `!` type - (active, bang_type, "1.13.0", Some(35121)) + (active, never_type, "1.13.0", Some(35121)) ); declare_features! ( @@ -966,8 +966,8 @@ impl<'a> Visitor for PostExpansionVisitor<'a> { gate_feature_post!(&self, conservative_impl_trait, ty.span, "`impl Trait` is experimental"); } - ast::TyKind::Empty => { - gate_feature_post!(&self, bang_type, ty.span, + ast::TyKind::Never => { + gate_feature_post!(&self, never_type, ty.span, "The `!` type is experimental"); }, _ => {} @@ -978,7 +978,7 @@ impl<'a> Visitor for PostExpansionVisitor<'a> { 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, + ast::TyKind::Never => return, _ => (), }; visit::walk_ty(self, output_ty) diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 6c5cbdc645a..b257ab98987 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -373,7 +373,7 @@ pub fn noop_fold_ty<T: Folder>(t: P<Ty>, fld: &mut T) -> P<Ty> { decl: fld.fold_fn_decl(decl) })) } - TyKind::Empty => node, + TyKind::Never => node, TyKind::Tup(tys) => TyKind::Tup(tys.move_map(|ty| fld.fold_ty(ty))), TyKind::Paren(ty) => TyKind::Paren(fld.fold_ty(ty)), TyKind::Path(qself, path) => { diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 4f54f529322..118096d9d48 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1396,7 +1396,7 @@ impl<'a> Parser<'a> { TyKind::Tup(ts) } } else if self.eat(&token::Not) { - TyKind::Empty + TyKind::Never } else if self.check(&token::BinOp(token::Star)) { // STAR POINTER (bare pointer?) self.bump(); diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index a5d512f14ec..24d8198191e 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -976,7 +976,7 @@ impl<'a> State<'a> { try!(self.print_opt_lifetime(lifetime)); try!(self.print_mt(mt)); } - ast::TyKind::Empty => { + ast::TyKind::Never => { word(&mut self.s, "!")?; }, ast::TyKind::Tup(ref elts) => { diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 228409b8207..8b03afdeb36 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -323,7 +323,7 @@ pub fn walk_ty<V: Visitor>(visitor: &mut V, typ: &Ty) { walk_list!(visitor, visit_lifetime, opt_lifetime); visitor.visit_ty(&mutable_type.ty) } - TyKind::Empty => {}, + TyKind::Never => {}, TyKind::Tup(ref tuple_element_types) => { walk_list!(visitor, visit_ty, tuple_element_types); } |
