diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2015-01-04 09:51:37 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2015-01-05 17:22:15 -0500 |
| commit | 714a5b7f5e960c885030fac4b357ec1304f539f9 (patch) | |
| tree | 350ba54b254f93ffb466f5a9e17d77389211ad2f /src/libsyntax | |
| parent | 5f7f2c9a0592bc1627781767ec8228aaad3e5364 (diff) | |
| download | rust-714a5b7f5e960c885030fac4b357ec1304f539f9.tar.gz rust-714a5b7f5e960c885030fac4b357ec1304f539f9.zip | |
remove TyClosure
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ast_map/mod.rs | 3 | ||||
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/fold.rs | 11 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 19 | ||||
| -rw-r--r-- | src/libsyntax/visit.rs | 8 |
7 files changed, 2 insertions, 57 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index c9d27e304ff..e779821342a 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1220,8 +1220,6 @@ pub enum Ty_ { TyPtr(MutTy), /// A reference (`&'a T` or `&'a mut T`) TyRptr(Option<Lifetime>, MutTy), - /// A closure (e.g. `|uint| -> bool`) - TyClosure(P<ClosureTy>), /// A bare function (e.g. `fn(uint) -> bool`) TyBareFn(P<BareFnTy>), /// A tuple (`(A, B, C, D,...)`) diff --git a/src/libsyntax/ast_map/mod.rs b/src/libsyntax/ast_map/mod.rs index ce7b964959f..cf09e2777f7 100644 --- a/src/libsyntax/ast_map/mod.rs +++ b/src/libsyntax/ast_map/mod.rs @@ -859,9 +859,6 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> { fn visit_ty(&mut self, ty: &'ast Ty) { match ty.node { - TyClosure(ref fd) => { - self.visit_fn_decl(&*fd.decl); - } TyBareFn(ref fd) => { self.visit_fn_decl(&*fd.decl); } diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index f8ac34cfe29..cb6277069e1 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -364,12 +364,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { } fn visit_ty(&mut self, t: &ast::Ty) { - if let ast::TyClosure(ref closure) = t.node { - // this used to be blocked by a feature gate, but it should just - // be plain impossible right now - assert!(closure.onceness != ast::Once); - } - visit::walk_ty(self, t); } diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 35b2e5dbc53..396b0033b81 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -414,17 +414,6 @@ pub fn noop_fold_ty<T: Folder>(t: P<Ty>, fld: &mut T) -> P<Ty> { TyRptr(region, mt) => { TyRptr(fld.fold_opt_lifetime(region), fld.fold_mt(mt)) } - TyClosure(f) => { - TyClosure(f.map(|ClosureTy {unsafety, onceness, bounds, decl, lifetimes}| { - ClosureTy { - unsafety: unsafety, - onceness: onceness, - bounds: fld.fold_bounds(bounds), - decl: fld.fold_fn_decl(decl), - lifetimes: fld.fold_lifetime_defs(lifetimes) - } - })) - } TyBareFn(f) => { TyBareFn(f.map(|BareFnTy {lifetimes, unsafety, abi, decl}| BareFnTy { lifetimes: fld.fold_lifetime_defs(lifetimes), diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index cc67079e538..9bc91a95841 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -55,7 +55,7 @@ use ast::{SelfExplicit, SelfRegion, SelfStatic, SelfValue}; use ast::{Delimited, SequenceRepetition, TokenTree, TraitItem, TraitRef}; use ast::{TtDelimited, TtSequence, TtToken}; use ast::{TupleVariantKind, Ty, Ty_, TypeBinding}; -use ast::{TypeField, TyFixedLengthVec, TyClosure, TyBareFn}; +use ast::{TypeField, TyFixedLengthVec, TyBareFn}; use ast::{TyTypeof, TyInfer, TypeMethod}; use ast::{TyParam, TyParamBound, TyParen, TyPath, TyPolyTraitRef, TyPtr, TyQPath}; use ast::{TyRptr, TyTup, TyU32, TyVec, UnUniq}; @@ -1252,13 +1252,7 @@ impl<'a> Parser<'a> { variadic: false }); - TyClosure(P(ClosureTy { - unsafety: unsafety, - onceness: Many, - bounds: bounds, - decl: decl, - lifetimes: lifetime_defs, - })) + panic!("stub"); } pub fn parse_unsafety(&mut self) -> Unsafety { diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 61b7aa408a8..e44cc2257c2 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -714,25 +714,6 @@ impl<'a> State<'a> { Some(&generics), None)); } - ast::TyClosure(ref f) => { - let generics = ast::Generics { - lifetimes: f.lifetimes.clone(), - ty_params: OwnedSlice::empty(), - where_clause: ast::WhereClause { - id: ast::DUMMY_NODE_ID, - predicates: Vec::new(), - }, - }; - try!(self.print_ty_fn(None, - Some('&'), - f.unsafety, - f.onceness, - &*f.decl, - None, - &f.bounds, - Some(&generics), - None)); - } ast::TyPath(ref path, _) => { try!(self.print_path(path, false)); } diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 054a288a69e..737f1b73b32 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -404,14 +404,6 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) { visitor.visit_ty(&**tuple_element_type) } } - TyClosure(ref function_declaration) => { - for argument in function_declaration.decl.inputs.iter() { - visitor.visit_ty(&*argument.ty) - } - walk_fn_ret_ty(visitor, &function_declaration.decl.output); - walk_ty_param_bounds_helper(visitor, &function_declaration.bounds); - walk_lifetime_decls_helper(visitor, &function_declaration.lifetimes); - } TyBareFn(ref function_declaration) => { for argument in function_declaration.decl.inputs.iter() { visitor.visit_ty(&*argument.ty) |
