about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2016-07-14Fix up some tidy-unfriendly spacingJonathan Turner-18/+18
2016-07-14DCE and fixing some internal testsJonathan Turner-98/+98
2016-07-14Implement latest rfc style using simpler renderingJonathan Turner-1/+1
2016-07-14Rename emit_struct->emitJonathan Turner-1/+1
2016-07-14Remove emit from emitter, leaving emit_structJonathan Turner-24/+1
2016-07-14Remove BasicEmitterJonathan Turner-5/+9
2016-07-14Make `ext::base::expr_to_string` work correctly with `include!` macro ↵Jeffrey Seyfried-0/+6
invocations
2016-07-14Remove irrelevant testsJeffrey Seyfried-169/+3
2016-07-14Implement `macro_rules!` placeholders and the macro scope mapJeffrey Seyfried-7/+46
2016-07-14Instead of renaming, treat differently marked identifiers as unequalJeffrey Seyfried-533/+11
2016-07-14Remove `IllegalCtxt`Jeffrey Seyfried-13/+9
2016-07-13Auto merge of #34772 - jseyfried:cleanup_interner, r=eddybbors-255/+69
Start cleaning up the string interner r? @eddyb
2016-07-13Auto merge of #34660 - jseyfried:fix_parse_stmt, r=nrcbors-115/+99
Fix bugs in macro-expanded statement parsing Fixes #34543. This is a [breaking-change]. For example, the following would break: ```rust macro_rules! m { () => { println!("") println!("") //^ Semicolons are now required on macro-expanded non-braced macro invocations //| in statement positions. let x = 0 //^ Semicolons are now required on macro-expanded `let` statements //| that are followed by more statements, so this would break. let y = 0 //< (this would still be allowed to reduce breakage in the wild) } fn main() { m!() } ``` r? @eddyb
2016-07-13Start a best-effort warning cycle.Jeffrey Seyfried-6/+37
2016-07-13cleanup: Refactor parser method `finish_parsing_statement` -> `parse_full_stmt`.Jeffrey Seyfried-13/+13
2016-07-13Allow macro-expanded macros in trailing expression positions to expand into ↵Jeffrey Seyfried-1/+2
statements: ```rust macro_rules! m { () => { let x = 1; x } } macro_rules! n { () => { m!() //< This can now expand into statements }} fn main() { n!(); } ``` and revert needless fallout fixes.
2016-07-13Fix bug in the pretty printer.Jeffrey Seyfried-3/+2
2016-07-12Parse macro-expanded statements like ordinary statements.Jeffrey Seyfried-3/+9
2016-07-12Clean up statement parsing without changing the semantics of `parse_stmt`.Jeffrey Seyfried-112/+59
2016-07-11Factor the `RefCell` out of the `Interner`.Jeffrey Seyfried-66/+41
2016-07-11Refactor `get_ident_interner` -> `with_ident_interner`.Jeffrey Seyfried-12/+13
2016-07-11Remove `Interner<T>` and rename `StrInterner` to `Interner`.Jeffrey Seyfried-139/+16
2016-07-11Encapsulate `RcStr` in `syntax::util::interner`.Jeffrey Seyfried-62/+25
2016-07-11Remove unused field `interner` from the parser.Jeffrey Seyfried-2/+0
2016-07-11Move E0533 to E0558 (because of external change)Guillaume Gomez-24/+24
2016-07-11Fix typosggomez-26/+28
2016-07-11Add E0537 error explanationGuillaume Gomez-1/+31
2016-07-11Add E0536 error explanationGuillaume Gomez-3/+27
2016-07-11Add E0535 error explanationGuillaume Gomez-1/+31
2016-07-11Add E0534 error explanationGuillaume Gomez-2/+35
2016-07-11Add E0533 error explanationGuillaume Gomez-2/+16
2016-07-08Rollup merge of #34691 - jseyfried:remove_erroneous_unit_struct_checks, r=nrcManish Goregaokar-72/+11
parser: Remove outdated checks for empty braced struct expressions (`S {}`) This is a pure refactoring. r? @nrc
2016-07-07Preliminary implementation for TokenStreams and TokenSlices, including unit ↵cgswords-39/+1121
tests and associated operations.
2016-07-06Auto merge of #34652 - jseyfried:fix_expansion_perf, r=nrcbors-53/+72
Fix expansion performance regression **syntax-[breaking-change] cc #31645** This fixes #34630 by reverting commit 5bf7970 of PR #33943, which landed in #34424. By removing the `Rc<_>` wrapping around `Delimited` and `SequenceRepetition` in `TokenTree`, 5bf7970 made cloning `TokenTree`s more expensive. While this had no measurable performance impact on the compiler's crates, it caused an order of magnitude performance regression on some macro-heavy code in the wild. I believe this is due to clones of `TokenTree`s in `macro_parser.rs` and/or `macro_rules.rs`. r? @nrc
2016-07-06Remove outdated checks for empty braced struct expressions (i.e. `UnitStruct ↵Jeffrey Seyfried-72/+11
{}`).
2016-07-06Auto merge of #34654 - jseyfried:configure_multi_modified, r=nrcbors-1/+5
Perform `cfg` attribute processing on `MultiModifier`-generated items Fixes https://users.rust-lang.org/t/unused-attribute-warning-for-custom-derive-attribute/6180. r? @nrc
2016-07-06Auto merge of #34546 - jseyfried:cfg_attr_path, r=nrcbors-3/+10
Support `cfg_attr` on `path` attributes Fixes #25544. This is technically a [breaking-change]. For example, the following would break: ```rust mod foo; // Suppose `foo.rs` existed in the appropriate location ```
2016-07-05Specific error message for missplaced doc commentsEsteban Küber-17/+45
Identify when documetation comments have been missplaced in the following places: * After a struct element: ```rust // file.rs: struct X { a: u8 /** document a */, } ``` ```bash $ rustc file.rs file.rs:2:11: 2:28 error: found documentation comment that doesn't document anything file.rs:2 a: u8 /** document a */, ^~~~~~~~~~~~~~~~~ file.rs:2:11: 2:28 help: doc comments must come before what they document, maybe a comment was intended with `//`? ``` * As the last line of a struct: ```rust // file.rs: struct X { a: u8, /// incorrect documentation } ``` ```bash $ rustc file.rs file.rs:3:5: 3:27 error: found a documentation comment that doesn't document anything file.rs:3 /// incorrect documentation ^~~~~~~~~~~~~~~~~~~~~~ file.rs:3:5: 3:27 help: doc comments must come before what they document, maybe a comment was intended with `//`? ``` * As the last line of a `fn`: ```rust // file.rs: fn main() { let x = 1; /// incorrect documentation } ``` ```bash $ rustc file.rs file.rs:3:5: 3:27 error: found a documentation comment that doesn't document anything file.rs:3 /// incorrect documentation ^~~~~~~~~~~~~~~~~~~~~~ file.rs:3:5: 3:27 help: doc comments must come before what they document, maybe a comment was intended with `//`? ``` Fix #27429, #30322
2016-07-05Strip unconfigured items from `MultiModifier`-expanded ASTJeffrey Seyfried-1/+5
2016-07-04Revert "Change `fold_tt` and `fold_tts` to take token trees by value ↵Jeffrey Seyfried-53/+72
(instead of by reference)" This reverts commit 5bf7970ac70b4e7781e7b2f3816720aa62fac6fd.
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