summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2015-09-22Encode/decode Names as stringsVadim Petrochenkov-2/+13
2015-09-22Auto merge of #28364 - petrochenkov:usegate, r=alexcrichtonbors-19/+20
Closes https://github.com/rust-lang/rust/issues/28075 Closes https://github.com/rust-lang/rust/issues/28388 r? @eddyb cc @brson
2015-09-21Change syntax::ast_util::stmt_id to not panic on macrosJethro Beekman-7/+10
This enables the Debug trait to work on syntax::ast::Stmt
2015-09-21Use ast::AsmDialect's variants qualified, and drop the pointless prefix.Ms2ger-6/+6
2015-09-21Auto merge of #28552 - apasel422:issue-28527, r=Manishearthbors-139/+114
Closes #28527. r? @Manishearth
2015-09-20Auto merge of #28534 - marcusklaas:fix-mod-inner-span, r=alexcrichtonbors-1/+1
Fixes https://github.com/rust-lang/rust/issues/28520. r? @alexcrichton or @nrc?
2015-09-20Replace `ast::Mac_` enum with structAndrew Paseltiner-139/+114
Closes #28527.
2015-09-20Fix the overly long inner spans of inline modsMarcus Klaas-1/+1
2015-09-20Auto merge of #28529 - Manishearth:rollup, r=Manishearthbors-26/+38
- Successful merges: #28463, #28507, #28522, #28525, #28526 - Failed merges:
2015-09-20Rollup merge of #28526 - Manishearth:expand-clone, r=eddybManish Goregaokar-24/+25
This reduces some clones of `Vec`s. These are not deep copies since the token tree is made using `Rc`s, so this won't be a major improvement. r? @eddyb
2015-09-20Auto merge of #28503 - marcusklaas:pub-extern, r=alexcrichtonbors-7/+4
Fixes https://github.com/rust-lang/rust/issues/28472.
2015-09-20Move tts instead of cloning in expansionManish Goregaokar-24/+25
2015-09-19Feature-gate `#[no_debug]` and `#[omit_gdb_pretty_printer_section]`Andrew Paseltiner-2/+13
Closes #28091.
2015-09-19Auto merge of #28345 - japaric:op-assign, r=nmatsakisbors-0/+6
Implements overload-able augmented/compound assignments, like `a += b` via the `AddAssign` trait, as specified in RFC [953] [953]: https://github.com/rust-lang/rfcs/blob/master/text/0953-op-assign.md r? @nikomatsakis
2015-09-19Auto merge of #28486 - nrc:pub-extern-crate, r=alexcrichtonbors-5/+12
Temporary 'fix' for #26775 r? @brson
2015-09-18Overloaded augmented assignmentsJorge Aparicio-0/+6
2015-09-19Include visibility modifier in span of foreign itemMarcus Klaas-7/+4
2015-09-18Auto merge of #28442 - nagisa:remove-enum-vis-field, r=alexcrichtonbors-14/+4
Followup on #28440 Do not merge before the referenced PR is merged. I will fix the PR once that is merged (or close if it is not)
2015-09-18Add feature gateVadim Petrochenkov-1/+20
2015-09-18Implement empty struct with braces (RFC 218)Vadim Petrochenkov-43/+28
2015-09-18Warn on `pub extern crate`.Nick Cameron-5/+12
Temporary 'fix' for #26775
2015-09-17Resolve prefix in imports with empty bracesVadim Petrochenkov-2/+1
2015-09-17Workaround for imports with empty bracesVadim Petrochenkov-2/+2
2015-09-17Correctly walk import lists in AST visitorsVadim Petrochenkov-19/+21
2015-09-17Remove Visibility field from enum variantsSimonas Kazlauskas-10/+3
Followup on #28440
2015-09-17libsyntax: forbid visibility modifiers for enum variantsAleksey Kladov-5/+2
fixes #28433
2015-09-17Fix the span for ! returnsNick Cameron-1/+1
2015-09-16Use ast attributes every where (remove HIR attributes).Nick Cameron-310/+350
This could be a [breaking-change] if your lint or syntax extension (is that even possible?) uses HIR attributes or literals.
2015-09-15Auto merge of #28351 - jonas-schievink:macro-bt, r=nrcbors-22/+37
The second commit in this PR will stop printing the macro definition site in backtraces, which cuts their length in half and increases readability (the definition site was only correct for local macros). The third commit will not print an invocation if the last one printed occurred at the same place (span). This will make backtraces caused by a self-recursive macro much shorter. (A possible alternative would be to capture the backtrace first, then limit it to a few frames at the start and end of the chain and print `...` inbetween. This would also work with multiple macros calling each other, which is not addressed by this PR - although the backtrace will still be halved) Example: ```rust macro_rules! m { ( 0 $($t:tt)* ) => ( m!($($t)*); ); () => ( fn main() {0} ); } m!(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0); ``` On a semi-recent nightly, this yields: ``` test.rs:3:21: 3:22 error: mismatched types: expected `()`, found `_` (expected (), found integral variable) [E0308] test.rs:3 () => ( fn main() {0} ); ^ test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:6:1: 6:35 note: expansion site test.rs:3:21: 3:22 help: run `rustc --explain E0308` to see a detailed explanation error: aborting due to previous error ``` After this patch: ``` test.rs:3:21: 3:22 error: mismatched types: expected `()`, found `_` (expected (), found integral variable) [E0308] test.rs:3 () => ( fn main() {0} ); ^ test.rs:2:23: 2:34 note: in this expansion of m! test.rs:6:1: 6:35 note: in this expansion of m! test.rs:3:21: 3:22 help: run `rustc --explain E0308` to see a detailed explanation error: aborting due to previous error ```
2015-09-14Auto merge of #28247 - christopherdumas:fix_28243, r=eddybbors-1/+1
as per #28243.
2015-09-14Fix tuple float bug.christopherdumas-1/+1
2015-09-14Print the file in which a macro was definedJonas Schievink-5/+14
2015-09-14Auto merge of #28358 - dotdash:nounwind, r=alexcrichtonbors-0/+4
This allows to skip the codegen for all the unneeded landing pads, reducing code size across the board by about 2-5%, depending on the crate. Compile times seem to be pretty unaffected though :-/
2015-09-13Add an attribute to mark function as unwindingBjörn Steinbrink-0/+4
2015-09-13Auto merge of #28286 - matklad:remove-dead-code, r=eddybbors-38/+31
There is a dead code in libsyntax/parser/parse.rs, when parsing structs. Two functions are involved: * [parse_item_struct](https://github.com/rust-lang/rust/blob/cd9c9f048f6aa0be091cd9835771ba0712bead4e/src/libsyntax/parse/parser.rs#L4691) * [parse_tuple_struct_body](https://github.com/rust-lang/rust/blob/cd9c9f048f6aa0be091cd9835771ba0712bead4e/src/libsyntax/parse/parser.rs#L4769) The problem is that both functions handle the case with unit structs. But because `parse_tuple_struct_body` is called from `parse_item_struct`, it never faces this case. This PR removes unit struct case from `parse_tuple_struct_body` function. I tested with `make -j8 check-statge1`.
2015-09-11Don't print duplicate macro backtrace framesJonas Schievink-6/+12
2015-09-11Remove some remains of virtual structs from the parserVadim Petrochenkov-16/+6
2015-09-10Don't print the macro definition site in backtracesJonas Schievink-6/+2
This halves the backtrace length. The definition site wasn't very useful anyways, since it may be invalid (for compiler expansions) or located in another crate. Since the macro name is still printed, grepping for it is still an easy way of finding the definition.
2015-09-10Make print_macro_backtrace non-recursiveJonas Schievink-22/+26
2015-09-10libsyntax: minor clean upAleksey Kladov-4/+4
Escape `{` in format strings as `{{`, instead of using a substitution
2015-09-08Auto merge of #28291 - nrc:shr_span_fix, r=sfacklerbors-1/+1
2015-09-08Fix span bug with >> and type bindingsNick Cameron-1/+1
2015-09-08Auto merge of #28246 - huonw:lang-tracking-issues, r=alexcrichtonbors-92/+127
This is similar to the libs version, which allow an `issue` field in the `#[unstable]` attribute. cc #28244
2015-09-08Allow tracking issues for lang features.Huon Wilson-92/+127
This is similar to the libs version, which allow an `issue` field in the `#[unstable]` attribute. cc #28244
2015-09-07libsyntax: restore lost error messageAleksey Kladov-1/+5
2015-09-07libsyntax: remove dead code from parser.rsAleksey Kladov-35/+24
Both `parse_tuple_struct_body` and `parse_item_struct` handled the case of unit like struct. The redundancy is removed, `parse_tuple_struct_body` now handles only real tuple structs.
2015-09-07Auto merge of #28175 - christopherdumas:master, r=nrcbors-2/+1
per #28168. This is my first contribution. I don't know who to "r?" for source code changes.
2015-09-06functional structure update syntax -> structure update syntaxchristopherdumas-2/+1
2015-09-06add MIR code (unused thus far)Niko Matsakis-3/+10
2015-09-04Auto merge of #28034 - alexcrichton:new-lines, r=aturonbors-1/+1
This commit is an implementation of [RFC 1212][rfc] which tweaks the behavior of the `str::lines` and `BufRead::lines` iterators. Both iterators now account for `\r\n` sequences in addition to `\n`, allowing for less surprising behavior across platforms (especially in the `BufRead` case). Splitting *only* on the `\n` character can still be achieved with `split('\n')` in both cases. The `str::lines_any` function is also now deprecated as `str::lines` is a drop-in replacement for it. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1212-line-endings.md Closes #28032