summary refs log tree commit diff
path: root/src/libsyntax/ext/build.rs
AgeCommit message (Collapse)AuthorLines
2016-07-25General MetaItem encapsulation rewrites.cgswords-17/+6
2016-06-26Rollup merge of #34436 - jseyfried:no_block_expr, r=eddybJeffrey Seyfried-26/+26
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-3/+3
Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`.
2016-06-26Rollup merge of #34316 - jseyfried:refactor_ast_stmt, r=eddybJeffrey Seyfried-7/+20
Refactor away `ast::Decl`, refactor `ast::Stmt`, and rename `ast::ExprKind::Again` to `ast::ExprKind::Continue`.
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-24Add `ecx.stmt_semi()` and fix issues with the pretty-printerJeffrey Seyfried-0/+5
2016-06-23Refactor away duplicate method `ecx.block_all()`Jeffrey Seyfried-7/+2
2016-06-23Remove field `expr` of `ast::Block`Jeffrey Seyfried-25/+20
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-1/+2
2016-06-20Merge PatKind::QPath into PatKind::Path in ASTVadim Petrochenkov-1/+1
2016-06-19Generalize and abstract `ThinAttributes`Jeffrey Seyfried-3/+3
2016-06-17Fix falloutJeffrey Seyfried-7/+20
2016-05-26Implement `..` in tuple (struct) patternsVadim Petrochenkov-2/+2
2016-05-09rustc: Implement custom panic runtimesAlex Crichton-1/+1
This commit is an implementation of [RFC 1513] which allows applications to alter the behavior of panics at compile time. A new compiler flag, `-C panic`, is added and accepts the values `unwind` or `panic`, with the default being `unwind`. This model affects how code is generated for the local crate, skipping generation of landing pads with `-C panic=abort`. [RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md Panic implementations are then provided by crates tagged with `#![panic_runtime]` and lazily required by crates with `#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic runtime must match the final product, and if the panic strategy is not `abort` then the entire DAG must have the same panic strategy. With the `-C panic=abort` strategy, users can expect a stable method to disable generation of landing pads, improving optimization in niche scenarios, decreasing compile time, and decreasing output binary size. With the `-C panic=unwind` strategy users can expect the existing ability to isolate failure in Rust code from the outside world. Organizationally, this commit dismantles the `sys_common::unwind` module in favor of some bits moving part of it to `libpanic_unwind` and the rest into the `panicking` module in libstd. The custom panic runtime support is pretty similar to the custom allocator support with the only major difference being how the panic runtime is injected (takes the `-C panic` flag into account).
2016-04-25Rollup merge of #33041 - petrochenkov:path, r=nrc,ManishearthManish Goregaokar-5/+3
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-5/+3
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-3/+3
2016-04-24thread tighter span for closures aroundNiko Matsakis-8/+29
Track the span corresponding to the `|...|` part of the closure.
2016-04-06Move span into `StructField`Vadim Petrochenkov-2/+3
2016-04-06Get rid of ast::StructFieldKindVadim Petrochenkov-1/+2
2016-02-13Split ast::PatKind::Enum into tuple struct and path patternsVadim Petrochenkov-1/+5
2016-02-13Rename ast::Pat_ and its variantsVadim Petrochenkov-9/+9
2016-02-11Remove some unnecessary indirection from AST structuresVadim Petrochenkov-23/+23
2016-02-11[breaking-change] don't glob export ast::PathListItem_ variantsOliver 'ker' Schneider-1/+6
2016-02-11[breaking-change] don't glob export ast::StrStyle variantsOliver 'ker' Schneider-1/+1
2016-02-11[breaking-change] don't glob export ast::Visibility variantsOliver 'ker' Schneider-2/+2
2016-02-11[breaking-change] don't glob export ast::Mutablity variantsOliver 'ker' Schneider-5/+8
2016-02-11[breaking-change] don't glob export ast::MetaItem_Oliver 'ker' Schneider-3/+3
2016-02-11[breaking-change] don't glob export ast::Item_ variantsOliver 'ker' Schneider-10/+10
2016-02-11[breaking-change] don't pub export ast::Stmt_ variantsOliver Schneider-4/+4
2016-02-11[breaking-change] don't pub export ast::IntLitType variantsOliver Schneider-4/+4
2016-02-11[breaking-change] don't pub export ast::Lit_ variantsOliver Schneider-11/+12
2016-02-11[breaking-change] don't pub export ast::Ty_ variantsOliver Schneider-7/+7
2016-02-11[breaking-change] remove the sign from integer literals in the astOliver Schneider-2/+7
2016-02-11[breaking-change] don't glob export ast::{UintTy, IntTy} variantsOliver Schneider-4/+4
2016-02-11[breaking-change] don't glob export ast::Expr_ variantsOliver Schneider-26/+26
2016-02-11[breaking-change] don't glob export ast::Decl_ variantsOliver Schneider-3/+3
2016-02-11[breaking-change] don't glob export ast::CaptureClause variantsOliver Schneider-2/+2
2016-02-11[breaking-change] don't glob import/export syntax::abi enum variantsOliver Schneider-2/+2
2016-02-11[breaking-change] don't glob export ast::BlockCheckMode variantsOliver Schneider-4/+2
2016-02-11[breaking-change] don't glob import ast::FunctionRetTy variantsOliver Schneider-1/+1
2016-02-11[breaking-change] don't glob export ast::BinOp_Oliver Schneider-2/+2
2016-02-11[breaking-change] don't glob export ast::UnOp variantsOliver Schneider-1/+2
2015-12-22Stop re-exporting PathParameters's variants.Ms2ger-2/+2
2015-12-21Auto merge of #30460 - Ms2ger:BindingMode, r=alexcrichtonbors-3/+3
2015-12-20Stop re-exporting the ast::BindingMode variants.Ms2ger-3/+3
2015-12-18Deprecate name `OwnedSlice` and don't use itVadim Petrochenkov-13/+12
2015-12-14[breaking-change] move ast_util functions to methodsfaineance-5/+4
2015-11-26Add syntax support for attributes on expressions and all syntaxMarvin Löbel-0/+3
nodes in statement position. Extended #[cfg] folder to allow removal of statements, and of expressions in optional positions like expression lists and trailing block expressions. Extended lint checker to recognize lint levels on expressions and locals.
2015-10-31Remove PatWildMultiVadim Petrochenkov-1/+1