about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
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
2016-06-20Remove unit testsJeffrey Seyfried-445/+3
2016-06-20Fix hygiene regressionJeffrey Seyfried-151/+44
2016-06-18Auto merge of #34295 - jseyfried:cfg_decoration, r=eddybbors-6/+25
Perform `cfg` attribute processing on decorator-generated items Fixes https://users.rust-lang.org/t/unused-attribute-warning-for-custom-derive-attribute/6180. r? @nrc
2016-06-19Generalize and abstract `ThinAttributes`Jeffrey Seyfried-202/+181
2016-06-18Auto merge of #34310 - erickt:tuple-struct-attrs, r=nrcbors-1/+2
Pretty-print attributes on tuple structs and add tests This adds support to the pretty printer to print attributes added to tuple struct elements. Furthermore, it adds a test that makes sure we will print attributes on all variant data types.
2016-06-17Fix panic when using debugGuillaume Gomez-1/+1
2016-06-17Pretty-print attributes on tuple structs and add testsErick Tryzelaar-1/+2
This adds support to the pretty printer to print attributes added to tuple struct elements. Furthermore, it adds a test that makes sure we will print attributes on all variant data types.
2016-06-17Rename `ast::ExprKind::Again` -> `ast::ExprKind::Continue`Jeffrey Seyfried-6/+6
2016-06-17Fix falloutJeffrey Seyfried-328/+267
2016-06-17Refactor away `ast::Decl` and refactor `ast::Stmt`Jeffrey Seyfried-16/+14
2016-06-16Auto merge of #34315 - Manishearth:rollup, r=Manishearthbors-859/+859
Rollup of 4 pull requests - Successful merges: #34298, #34302, #34307, #34312 - Failed merges:
2016-06-17Rollup merge of #34312 - erickt:add-try, r=nikomatsakisManish Goregaokar-859/+859
Revert using ? for try! in the libsyntax pretty printer The use of ...?instead of try!(...) in libsyntax makes extracting libsyntax into syntex quite painful since it's not stable yet. This makes backports take a much longer time and causes a lot of problems for the syntex dependencies. Even if it was, it'd take a few release cycles until syntex would be able to use it. Since it's not stable and that this feature is just syntax sugar, it would be most helpful if we could remove it. cc #34311
2016-06-16Auto merge of #34272 - jseyfried:simplify_gated_cfg_checking, r=nrcbors-169/+95
Simplify gated cfg checking r? @nrc
2016-06-16Revert using ? for try! in the libsyntax pretty printerErick Tryzelaar-859/+859
The use of ...?instead of try!(...) in libsyntax makes extracting libsyntax into syntex quite painful since it's not stable yet. This makes backports take a much longer time and causes a lot of problems for the syntex dependencies. Even if it was, it'd take a few release cycles until syntex would be able to use it. Since it's not stable and that this feature is just syntax sugar, it would be most helpful if we could remove it. cc #34311
2016-06-16Simplify gated cfg checkingJeffrey Seyfried-169/+95
2016-06-16Auto merge of #34187 - luser:extern-crate-abspaths, r=michaelwoeristerbors-41/+76
Add an abs_path member to FileMap, use it when writing debug info. Fixes #34179. When items are inlined from extern crates, the filename in the debug info is taken from the FileMap that's serialized in the rlib metadata. Currently this is just FileMap.name, which is whatever path is passed to rustc. Since libcore and libstd are built by invoking rustc with relative paths, they wind up with relative paths in the rlib, and when linked into a binary the debug info uses relative paths for the names, but since the compilation directory for the final binary, tools trying to read source filenames will wind up with bad paths. We noticed this in Firefox with source filenames from libcore/libstd having bad paths. This change stores an absolute path in FileMap.abs_path, and uses that if available for writing debug info. This is not going to magically make debuggers able to find the source, but it will at least provide sensible paths.
2016-06-16Add an abs_path member to FileMap, use it when writing debug info.Ted Mielczarek-41/+76
When items are inlined from extern crates, the filename in the debug info is taken from the FileMap that's serialized in the rlib metadata. Currently this is just FileMap.name, which is whatever path is passed to rustc. Since libcore and libstd are built by invoking rustc with relative paths, they wind up with relative paths in the rlib, and when linked into a binary the debug info uses relative paths for the names, but since the compilation directory for the final binary, tools trying to read source filenames will wind up with bad paths. We noticed this in Firefox with source filenames from libcore/libstd having bad paths. This change stores an absolute path in FileMap.abs_path, and uses that if available for writing debug info. This is not going to magically make debuggers able to find the source, but it will at least provide sensible paths.
2016-06-16Auto merge of #34239 - jseyfried:fix_macro_use_scope_regression, r=nrcbors-20/+72
Revert a change in the scope of macros imported from crates to fix a regression Fixes #34212. The regression was caused by #34032, which changed the scope of macros imported from extern crates to match the scope of macros imported from modules. r? @nrc
2016-06-16Auto merge of #34216 - jseyfried:nested_cfg_attr, r=nrcbors-1/+1
Support nested `cfg_attr` attributes Support arbitrarily deeply nested `cfg_attr` attributes (e.g. `#[cfg_attr(foo, cfg_attr(bar, baz))]`). This makes configuration idempotent. Currently, the nighties do not support any `cfg_attr` nesting. Stable and beta support just one level of `cfg_attr` nesting (expect for attributes on macro-expanded nodes, where no nesting is supported). This is a [breaking-change]. For example, the following would break: ```rust macro_rules! m { () => { #[cfg_attr(all(), cfg_attr(all(), cfg(foo)))] fn f() {} } } m!(); fn main() { f() } //~ ERROR unresolved name `f` ``` r? @nrc
2016-06-16Strip unconfigured nodes from decorator-generated ASTJeffrey Seyfried-4/+25
2016-06-16Avoid expanding decorator-generated items twiceJeffrey Seyfried-2/+0
2016-06-16Allow `MultiItemModifier`s to expand into zero or many itemsJeffrey Seyfried-12/+14
2016-06-16Refactor MultiModifier expansionJeffrey Seyfried-65/+34
2016-06-16Implement `HasAttrs` for `Annotatable`Jeffrey Seyfried-16/+19
2016-06-16Rollup merge of #34268 - zackmdavis:if_let_over_none_unit_arm, r=jseyfriedManish Goregaokar-37/+28
prefer `if let` to match with `None => ()` arm in some places Casual grepping revealed some places in the codebase (some of which antedated `if let`'s December 2014 stabilization in c200ae5a) where we were using a match with a `None => ()` arm where (in the present author's opinion) an `if let` conditional would be more readable. (Other places where matching to the unit value did seem to better express the intent were left alone.) It's likely that we don't care about making such trivial, non-functional, sheerly æsthetic changes. But if we do, this is a patch.
2016-06-16Rollup merge of #34207 - petrochenkov:nohyg, r=jseyfriedManish Goregaokar-4/+0
Remove last traces of identifier hygiene from HIR https://github.com/rust-lang/rust/pull/34095/commits/e783a0a5e39d5ae2fa147508197d09a51530fae8 removed the [last](https://github.com/rust-lang/rust/pull/33654#discussion_r63415218) [use](https://github.com/rust-lang/rust/pull/33654#discussion_r63416284) of hygiene at post-resolve compilation stages, so we can avoid renaming during lowering to HIR and just keep original names. r? @nrc
2016-06-15prefer `if let` to match with `None => ()` arm in some placesZack M. Davis-37/+28
Casual grepping revealed some places in the codebase (some of which antedated `if let`'s December 2014 stabilization in c200ae5a) where we were using a match with a `None => ()` arm where (in the present author's opinion) an `if let` conditional would be more readable. (Other places where matching to the unit value did seem to better express the intent were left alone.) It's likely that we don't care about making such trivial, non-functional, sheerly æsthetic changes. But if we do, this is a patch.
2016-06-14Remove the type parameter from `syntax::visit::Visitor`Jeffrey Seyfried-156/+137
2016-06-14Refactor away `WithAttrs` traitJeffrey Seyfried-39/+15
2016-06-14Change `fold_tt` and `fold_tts` to take token trees by value (instead of by ↵Jeffrey Seyfried-88/+68
reference)