summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2016-08-01Avoid processing `feature`s on unconfigured crates.Jeffrey Seyfried-1/+1
2016-08-01Make `ext::base::expr_to_string` work correctly with `include!` macro ↵Jeffrey Seyfried-0/+6
invocations
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-47/+27
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-07-02Rollup merge of #34531 - GuillaumeGomez:libsyntax_err_codes, r=jonathandturnerManish Goregaokar-55/+142
Add error codes in libsyntax r? @jonathandturner Fixes #34526
2016-06-30Add comments on error code listGuillaume Gomez-27/+27
2016-06-30Auto merge of #34541 - jseyfried:rollup, r=jseyfriedbors-22/+17
Rollup of 5 pull requests - Successful merges: #34105, #34305, #34512, ~~#34531,~~ #34547
2016-06-29Fix testsggomez-1/+1
2016-06-29Rollup merge of #34495 - jseyfried:only_ident_macro_invocations, r=eddybManish Goregaokar-1/+1
Forbid type parameters and global paths in macro invocations Fixes #28558. This is a [breaking-change]. For example, the following would break: ```rust macro_rules! m { () => { () } } fn main() { m::<T>!(); // Type parameters are no longer allowed in macro invocations ::m!(); // Global paths are no longer allowed in macro invocations } ``` Any breakage can be fixed by removing the type parameters or the leading `::` (respectively). r? @eddyb
2016-06-29Rollup merge of #34459 - jseyfried:expansion_cleanup, r=nrcManish Goregaokar-37/+20
Miscellaneous macro expansion cleanup and groundwork r? @nrc
2016-06-29Rollup merge of #34446 - jseyfried:refactor_decorators, r=nrcManish Goregaokar-78/+33
Treat `MultiDecorator`s as a special case of `MultiModifier`s This deals with #32950 by using @durka's [option 1](https://github.com/rust-lang/rust/pull/33769#issuecomment-221774136). r? @nrc
2016-06-29Fix pretty-printing of lifetime boundSeo Sanghyeon-22/+17
2016-06-29Add error codes in libsyntaxggomez-55/+142
2016-06-29Give `ast::ExprKind::Paren` no-op expressions the same node ids as their ↵Jeffrey Seyfried-2/+11
children.
2016-06-29Refactor away `parser.commit_stmt_expecting()`Jeffrey Seyfried-5/+1
2016-06-29Treat `MultiDecorator`s as a special case of `MultiModifier`sJeffrey Seyfried-78/+33
2016-06-28cleanup: refactor away `ast::NodeIdAssigner`Jeffrey Seyfried-10/+0
2016-06-28cleanup: use `DummyResult` to implement `MacroGenerable::dummy`Jeffrey Seyfried-19/+17
2016-06-28cleanup: don't count attributes on an item in a statement position as on the ↵Jeffrey Seyfried-8/+3
statement
2016-06-27Auto merge of #34424 - jseyfried:breaking_batch, r=Manishearthbors-5165/+2221
Batch up libsyntax breaking changes Batch of the following syntax-[breaking-change] changes: - #34213: Add a variant `Macro` to `TraitItemKind` - #34368: Merge the variant `QPath` of `PatKind` into the variant `PatKind::Path` - #34385: Move `syntax::ast::TokenTree` into a new module `syntax::tokenstream` - #33943: - Remove the type parameter from `visit::Visitor` - Remove `attr::WithAttrs` -- use `attr::HasAttrs` instead. - Change `fold_tt`/`fold_tts` to take token trees by value and avoid wrapping token trees in `Rc`. - Remove the field `ctxt` of `ast::Mac_` - Remove inherent method `attrs()` of types -- use the method `attrs` of `HasAttrs` instead. - #34316: - Remove `ast::Decl`/`ast::DeclKind` and add variants `Local` and `Item` to `StmtKind`. - Move the node id for statements from the `StmtKind` variants to a field of `Stmt` (making `Stmt` a struct instead of an alias for `Spanned<StmtKind>`) - Rename `ast::ExprKind::Again` to `Continue`. - #34339: Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>` - Use `.into()` in convert between `Vec<Attribute>` and `ThinVec<Attribute>` - Use autoderef instead of `.as_attr_slice()` - #34436: Remove the optional expression from `ast::Block` and instead use a `StmtKind::Expr` at the end of the statement list. - #34403: Move errors into a separate crate (unlikely to cause breakage)
2016-06-27Fix `Cargo.toml`sJeffrey Seyfried-1/+2
2016-06-27Forbid type parameters and global paths in macro invocationsJeffrey Seyfried-1/+1
2016-06-26Auto merge of #34450 - jseyfried:fix_include_path, r=nrcbors-1/+2
Revert a change to the relative path for macro-expanded `include!`s Fixes #34431 (c.f. discussion in that issue). r? @nrc
2016-06-26Rollup merge of #34436 - jseyfried:no_block_expr, r=eddybJeffrey Seyfried-96/+72
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-202/+177
Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`.
2016-06-26Rollup merge of #34316 - jseyfried:refactor_ast_stmt, r=eddybJeffrey Seyfried-349/+289
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-333/+237
Miscellaneous low priority cleanup in `libsyntax`.
2016-06-26Rollup merge of #34385 - cgswords:tstream, r=nrcJeffrey Seyfried-262/+304
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-3852/+994
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-30/+18
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-25Rollup merge of #34213 - josephDunne:trait_item_macros, r=jseyfriedJeffrey Seyfried-87/+175
**syntax-[breaking-change]** cc #31645 New `TraitItemKind::Macro` variant This change adds support for macro expansion inside trait items by adding the new `TraitItemKind::Macro` and associated parsing code.
2016-06-24reexport errors from syntax. fix failing cfail testJonathan Turner-1/+4
2016-06-24Fix codemap tests to not double importJonathan Turner-1/+0
2016-06-24Improve `syntax::ast::*` type docs (examples, etc)Vincent Esche-36/+135
2016-06-24Reexport syntax_pos in codemap and fix some cfail testsJonathan Turner-1/+1
2016-06-24Revert a change to the relative path for macro-expanded `include!`sJeffrey Seyfried-1/+2
2016-06-24Add `ecx.stmt_semi()` and fix issues with the pretty-printerJeffrey Seyfried-3/+18
2016-06-23Refactor away duplicate method `ecx.block_all()`Jeffrey Seyfried-11/+6
2016-06-23make old school mode a bit more configurableJonathan Turner-18/+32
2016-06-23Remove field `expr` of `ast::Block`Jeffrey Seyfried-98/+52
2016-06-23Add missing refernce to RenderedLineJonathan Turner-1/+1
2016-06-23Move test helper functions to consolidated codemap testingJonathan Turner-63/+64
2016-06-23Actually consolidate the CodeMap testsJonathan Turner-517/+517
2016-06-23Consolidate codemap tests and fix more errors for travisJonathan Turner-2/+821
2016-06-23Address more travis errorsJonathan Turner-4/+7
2016-06-23Address comments and fix travis warningJonathan Turner-2/+2
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-3850/+153
2016-06-23Auto merge of #34253 - jseyfried:improve_multi_modifiers, r=nrcbors-92/+66
Allow `MultiItemModifier`s to expand into zero or many items Fixes #34223. r? @nrc
2016-06-23Cleanup commentsJeffrey Seyfried-4/+4
2016-06-21Refactored tokentrees into their own files in preparation for tokenstreams. ↵cgswords-262/+304
Modified tests to point to the new file now.
2016-06-20Merge PatKind::QPath into PatKind::Path in ASTVadim Petrochenkov-30/+18