about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
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
2015-09-03std: Account for CRLF in {str, BufRead}::linesAlex Crichton-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
2015-09-04Auto merge of #28170 - nagisa:loopctl-label-spans, r=alexcrichtonbors-12/+21
r? @alexcrichton
2015-09-03Use consistent terminology for byte string literalsVadim Petrochenkov-23/+23
Avoid confusion with binary integer literals and binary operator expressions in libsyntax
2015-09-03Use proper span for break and continue labelsSimonas Kazlauskas-12/+21
Fixes #28109
2015-09-02Auto merge of #28138 - nrc:hir, r=nikomatsakisbors-41/+5
r? @nikomatsakis Trying to land this first stab, which basically just duplicates the AST. Will file issues for the various things I've got in mind to improve.
2015-09-03Add an intital HIR and lowering stepNick Cameron-41/+5
2015-09-02Auto merge of #28117 - marcusklaas:continue-break, r=alexcrichtonbors-2/+2
Fixes https://github.com/rust-lang/rust/issues/28108.
2015-09-02Fix overly long spans for break and continueMarcus Klaas-2/+2
The spans of break and continue would include the next token.
2015-09-01Auto merge of #28137 - nrc:remove-non-multi, r=huonwbors-151/+2
This is a [breaking-change] for syntax extension authors. The fix is to use MultiModifier or MultiDecorator, which have the same functionality but are more flexible. Users of syntax extensions are unaffected.
2015-09-01Remove the Modifier and Decorator kinds of syntax extensions.Nick Cameron-151/+2
This is a [breaking-change] for syntax extension authors. The fix is to use MultiModifier or MultiDecorator, which have the same functionality but are more flexible. Users of syntax extensions are unaffected.
2015-08-31Closures are not generated code.Nick Cameron-6/+1
2015-08-31Auto merge of #28007 - Ms2ger:FnKind, r=nrcbors-27/+25
There is no longer a need for that pattern, since enums are now qualified.
2015-08-30Auto merge of #28106 - marcusklaas:continue, r=eddybbors-1/+0
Fixes https://github.com/rust-lang/rust/issues/28105.
2015-08-30Assign correct span to continue expressionMarcus Klaas-1/+0
Fixes https://github.com/rust-lang/rust/issues/28105.
2015-08-30Make a macro a const fn and remove outdated NBTobias Bucher-2/+0
2015-08-29Auto merge of #28077 - jonas-schievink:attr-gateage, r=huonwbors-117/+125
This allows marking attributes as whitelisted/crate-only independent of their feature gate status. Closes #24213
2015-08-29Allow #[derive()] to generate unsafe trait implsMichael Layzell-1/+23
2015-08-29Handle gateage of built-in attributes seperatelyJonas Schievink-117/+125
This allows marking attributes as whitelisted/crate-only independent of their feature gate status. Closes #24213
2015-08-28Rollup merge of #28033 - Manishearth:compilerexpn, r=eddybManish Goregaokar-64/+80
We were using them for every expansion, instead of using `Name`. Also converted `CompilerExpansion` into an enum so its nicer to use and takes up less space. Will profile later, but this should be a small improvement in memory usage. r? @eddyb
2015-08-28Move ExpnInfo to NameManish Goregaokar-32/+33
2015-08-27Enumify CompilerExpansion in ExpnInfoManish Goregaokar-53/+68
2015-08-26Rename FnKind variants and stop re-exporting them from the visit module.Ms2ger-27/+25
There is no longer a need for that pattern, since enums are now qualified.
2015-08-24Remove #[start] as well as #[main] in --testWilliam Throwe-9/+6
Fixes #11766.
2015-08-24Move main removal to its own pass in --test modeWilliam Throwe-39/+56
This handles the case where the #[main] function is buried deeper in the ast than we search for #[test] functions. I'm not sure why one would want to do that, but since it works in standard compilation it should also work for tests.
2015-08-24Mark main-like functions allow(dead_code) in testsWilliam Throwe-15/+34
Fixes #12327.
2015-08-24Move entry point identification logic to libsyntaxWilliam Throwe-0/+43
Identifying entry points will be useful in --test mode, which is handled in libsyntax.
2015-08-24Auto merge of #27239 - apasel422:issue-19102, r=huonwbors-1/+7
closes #19102
2015-08-24Auto merge of #27857 - Manishearth:improve-fnkind, r=pnkfelixbors-7/+6
Since enums are namespaced now, should we also remove the `Fk` prefixes from `FnKind` and remove the reexport? (The reexport must be removed because otherwise it clashes with glob imports containing `ItemFn`). IMO writing `FnKind::Method` is much clearer than `FkMethod`.
2015-08-24move def-id to rustc crateNiko Matsakis-38/+1
2015-08-22Auto merge of #27913 - birkenfeld:remove_suffix_len, r=alexcrichtonbors-27/+0
The methods gave wrong results for TyIs and TyUs, whose suffix len should be 5 nowadays. But since they were only used for parsing, and unneeded for that since 606a309d, remove them rather than fixing. I hope this is ok to do, since all of rustc is considered unstable...
2015-08-21Auto merge of #27613 - GSam:binop, r=nrcbors-3/+30
In the case where there are no paren in the AST, the pretty printer doesn't correctly print binary operations where precedence is concerned. Parenthesis may be missing due to some kind of expansion or manipulation of the AST. Example: Pretty printer prints Expr(*, Expr(+, 1, 1), 2) as 1 + 1 * 2, as opposed to (1 + 1) * 2 r? @nrc