summary refs log tree commit diff
path: root/src/libsyntax/fold.rs
AgeCommit message (Collapse)AuthorLines
2016-08-13Rename empty/bang to neverAndrew Cann-1/+1
Split Ty::is_empty method into is_never and is_uninhabited
2016-08-13Remove obsolete divergence related stuffAndrew Cann-1/+0
Replace FnOutput with Ty Replace FnConverging(ty) with ty Purge FnDiverging, FunctionRetTy::NoReturn and FunctionRetTy::None
2016-08-13Start implementation of RFC 1216 (make ! a type)Andrew Cann-0/+1
Add `TyKind::Empty` and fix resulting build errors.
2016-08-12syntax: add anonymized type syntax, i.e. impl TraitA+TraitB.Eduard Burtescu-0/+3
2016-07-04Revert "Change `fold_tt` and `fold_tts` to take token trees by value ↵Jeffrey Seyfried-19/+27
(instead of by reference)" This reverts commit 5bf7970ac70b4e7781e7b2f3816720aa62fac6fd.
2016-06-29Give `ast::ExprKind::Paren` no-op expressions the same node ids as their ↵Jeffrey Seyfried-2/+11
children.
2016-06-26Rollup merge of #34436 - jseyfried:no_block_expr, r=eddybJeffrey Seyfried-2/+1
To allow these braced macro invocation, this PR removes the optional expression from `ast::Block` and instead uses a `StmtKind::Expr` at the end of the statement list. Currently, braced macro invocations in blocks can expand into statements (and items) except when they are last in a block, in which case they can only expand into expressions. For example, ```rust macro_rules! make_stmt { () => { let x = 0; } } fn f() { make_stmt! {} //< This is OK... let x = 0; //< ... unless this line is commented out. } ``` Fixes #34418.
2016-06-26Rollup merge of #34339 - jseyfried:thin_vec, r=petrochenkov,ManishearthJeffrey Seyfried-8/+5
Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`.
2016-06-26Rollup merge of #34316 - jseyfried:refactor_ast_stmt, r=eddybJeffrey Seyfried-43/+34
Refactor away `ast::Decl`, refactor `ast::Stmt`, and rename `ast::ExprKind::Again` to `ast::ExprKind::Continue`.
2016-06-26Rollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrcJeffrey Seyfried-30/+19
Miscellaneous low priority cleanup in `libsyntax`.
2016-06-26Rollup merge of #34385 - cgswords:tstream, r=nrcJeffrey Seyfried-0/+1
syntax-[breaking-change] cc #31645 (Only breaking because ast::TokenTree is now tokenstream::TokenTree.) This pull request refactors TokenTrees into their own file as src/libsyntax/tokenstream.rs, moving them out of src/libsyntax/ast.rs, in order to prepare for an accompanying TokenStream implementation (per RFC 1566).
2016-06-25Rollup merge of #34403 - jonathandturner:move_liberror, r=alexcrichtonJeffrey Seyfried-1/+2
This PR refactors the 'errors' part of libsyntax into its own crate (librustc_errors). This is the first part of a few refactorings to simplify error reporting and potentially support more output formats (like a standardized JSON output and possibly an --explain mode that can work with the user's code), though this PR stands on its own and doesn't assume further changes. As part of separating out the errors crate, I have also refactored the code position portion of codemap into its own crate (libsyntax_pos). While it's helpful to have the common code positions in a separate crate for the new errors crate, this may also enable further simplifications in the future.
2016-06-25Rollup merge of #34368 - petrochenkov:astqpath, r=ManishearthJeffrey Seyfried-6/+5
The AST part of https://github.com/rust-lang/rust/pull/34365 plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645
2016-06-23Remove field `expr` of `ast::Block`Jeffrey Seyfried-2/+1
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-1/+2
2016-06-21Refactored tokentrees into their own files in preparation for tokenstreams. ↵cgswords-0/+1
Modified tests to point to the new file now.
2016-06-20Merge PatKind::QPath into PatKind::Path in ASTVadim Petrochenkov-6/+5
2016-06-19Generalize and abstract `ThinAttributes`Jeffrey Seyfried-6/+5
2016-06-17Rename `ast::ExprKind::Again` -> `ast::ExprKind::Continue`Jeffrey Seyfried-1/+1
2016-06-17Fix falloutJeffrey Seyfried-42/+33
2016-06-14Change `fold_tt` and `fold_tts` to take token trees by value (instead of by ↵Jeffrey Seyfried-29/+19
reference)
2016-06-14Refactor away field `ctxt` of `ast::Mac_`Jeffrey Seyfried-1/+0
2016-06-13Add support for macro expansion inside trait itemsJoseph Dunne-0/+3
2016-05-27Rollup merge of #33644 - petrochenkov:selfast, r=nrcManish Goregaokar-32/+1
The AST part of https://github.com/rust-lang/rust/pull/33505. https://github.com/rust-lang/rust/pull/33505 isn't landed yet, so this PR is based on top of it. r? @nrc plugin-[breaking-change] cc #31645 @Manishearth
2016-05-27Rollup merge of #33639 - petrochenkov:dotdot, r=nmatsakisManish Goregaokar-3/+5
cc https://github.com/rust-lang/rust/issues/33627 r? @nikomatsakis plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645 @Manishearth
2016-05-26Implement `..` in tuple (struct) patternsVadim Petrochenkov-3/+5
2016-05-25Add a new AST-only type variant `ImplicitSelf`Vadim Petrochenkov-2/+1
2016-05-25Remove ExplicitSelf from ASTVadim Petrochenkov-31/+1
2016-05-24syntax/hir: give loop labels a spanGeorg Brandl-4/+8
This makes the "shadowing labels" warning *not* print the entire loop as a span, but only the lifetime. Also makes #31719 go away, but does not fix its root cause (the span of the expanded loop is still wonky, but not used anymore).
2016-04-25Rollup merge of #33041 - petrochenkov:path, r=nrc,ManishearthManish Goregaokar-14/+7
Paths are mostly parsed without taking whitespaces into account, e.g. `std :: vec :: Vec :: new ()` parses successfully, however, there are some special cases involving keywords `super`, `self` and `Self`. For example, `self::` is considered a path start only if there are no spaces between `self` and `::`. These restrictions probably made sense when `self` and friends weren't keywords, but now they are unnecessary. The first two commits remove this special treatment of whitespaces by removing `token::IdentStyle` entirely and therefore fix https://github.com/rust-lang/rust/issues/14109. This change also affects naked `self` and `super` (which are not tightly followed by `::`, obviously) they can now be parsed as paths, however they are still not resolved correctly in imports (cc @jseyfried, see `compile-fail/use-keyword.rs`), so https://github.com/rust-lang/rust/issues/29036 is not completely fixed. The third commit also makes `super`, `self`, `Self` and `static` keywords nominally (before this they acted as keywords for all purposes) and removes most of remaining \"special idents\". The last commit (before tests) contains some small improvements - some qualified paths with type parameters are parsed correctly, `parse_path` is not used for parsing single identifiers, imports are sanity checked for absence of type parameters - such type parameters can be generated by syntax extensions or by macros when https://github.com/rust-lang/rust/issues/10415 is fixed (~~soon!~~already!). This patch changes some pretty basic things in `libsyntax`, like `token::Token` and the keyword list, so it's a plugin-[breaking-change]. r? @eddyb
2016-04-24syntax: Merge keywords and remaining special idents in one listVadim Petrochenkov-2/+2
Simplify the macro used for generation of keywords Make `Keyword::ident` private
2016-04-24syntax: Make static/super/self/Self keywords + special ident cleanupVadim Petrochenkov-1/+1
2016-04-24syntax: Get rid of token::IdentStyleVadim Petrochenkov-12/+5
2016-04-24thread tighter span for closures aroundNiko Matsakis-3/+4
Track the span corresponding to the `|...|` part of the closure.
2016-04-14Visit visibilities in the ast visitor's `walk_*` functionsJeffrey Seyfried-1/+1
2016-04-06Rollup merge of #32570 - eddyb:tis-but-a-front, r=nikomatsakisManish Goregaokar-8/+0
r? @nikomatsakis Conflicts: src/librustc_save_analysis/lib.rs src/libsyntax/ast_util.rs
2016-04-06Move span into `StructField`Vadim Petrochenkov-9/+7
2016-04-06Get rid of ast::StructFieldKindVadim Petrochenkov-6/+6
2016-04-06syntax: dismantle ast_util.Eduard Burtescu-8/+0
2016-04-02Add `Crate` and `Restricted` variants to `ast::Visibility`Jeffrey Seyfried-3/+17
2016-03-14Add `default` as contextual keyword, and parse it for impl items.Aaron Turon-0/+1
2016-03-07implement the `?` operatorJorge Aparicio-1/+2
The `?` postfix operator is sugar equivalent to the try! macro, but is more amenable to chaining: `File::open("foo")?.metadata()?.is_dir()`. `?` is accepted on any *expression* that can return a `Result`, e.g. `x()?`, `y!()?`, `{z}?`, `(w)?`, etc. And binds more tightly than unary operators, e.g. `!x?` is parsed as `!(x?)`. cc #31436
2016-02-27libsyntax: parse inclusive rangesAlex Burka-2/+3
2016-02-13Split ast::PatKind::Enum into tuple struct and path patternsVadim Petrochenkov-2/+5
2016-02-13Rename ast::Pat_ and its variantsVadim Petrochenkov-18/+18
2016-02-12Use more autoderef in libsyntaxJonas Schievink-1/+1
2016-02-11Remove some unnecessary indirection from AST structuresVadim Petrochenkov-65/+65
2016-02-11[breaking-change] don't glob export ast::PathListItem_ variantsOliver 'ker' Schneider-4/+4
2016-02-11[breaking-change] don't glob export ast::Visibility variantsOliver 'ker' Schneider-1/+1
2016-02-11[breaking-change] don't glob export ast::TraitItemKind variantsOliver 'ker' Schneider-6/+6