diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2015-02-03 11:34:05 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2015-02-03 11:56:16 -0500 |
| commit | 04311341197ddabc420a8cffc0d26c12228d445b (patch) | |
| tree | 4c28b4373079ca63d53bfe6ee1250500113cf982 /src/libsyntax/ast.rs | |
| parent | 47f18659ff629792f49b5ed87e870687703831fe (diff) | |
| download | rust-04311341197ddabc420a8cffc0d26c12228d445b.tar.gz rust-04311341197ddabc420a8cffc0d26c12228d445b.zip | |
Remove the explicit closure kind syntax from the parser and AST;
upgrade the inference based on expected type so that it is able to infer the fn kind in isolation even if the full signature is not available (and we could perhaps do better still in some cases, such as extracting just the types of the arguments but not the return value).
Diffstat (limited to 'src/libsyntax/ast.rs')
| -rw-r--r-- | src/libsyntax/ast.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index d7283db25a5..34eeedeaa76 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -48,7 +48,6 @@ pub use self::TraitItem::*; pub use self::Ty_::*; pub use self::TyParamBound::*; pub use self::UintTy::*; -pub use self::ClosureKind::*; pub use self::UnOp::*; pub use self::UnsafeSource::*; pub use self::VariantKind::*; @@ -736,7 +735,7 @@ pub enum Expr_ { // FIXME #6993: change to Option<Name> ... or not, if these are hygienic. ExprLoop(P<Block>, Option<Ident>), ExprMatch(P<Expr>, Vec<Arm>, MatchSource), - ExprClosure(CaptureClause, Option<ClosureKind>, P<FnDecl>, P<Block>), + ExprClosure(CaptureClause, P<FnDecl>, P<Block>), ExprBlock(P<Block>), ExprAssign(P<Expr>, P<Expr>), @@ -1687,13 +1686,6 @@ impl ForeignItem_ { } } -#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] -pub enum ClosureKind { - FnClosureKind, - FnMutClosureKind, - FnOnceClosureKind, -} - /// The data we save and restore about an inlined item or method. This is not /// part of the AST that we parse from a file, but it becomes part of the tree /// that we trans. |
