summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2018-03-04Remove allocation from width of character function.Mark Simulacrum-3/+5
2018-02-11Auto merge of #47752 - mark-i-m:at-most-once-rep, r=nikomatsakisbors-53/+177
Implement `?` macro repetition See rust-lang/rfcs#2298 (with disposition merge)
2018-02-08Use the right tracking issueMark Mansi-3/+1
2018-02-08Add `rustc_args_required_const` to the feature whitelistAlex Crichton-0/+5
Unfortunately left out it means that when the `#![feature(proc_macro)]` flag is in effect it fails to find `rustc_args_required_const` for expansion. This version, however, is verified to work with stdsimd's requirements!
2018-02-07Rollup merge of #47613 - estebank:rustc_on_unimplemented, r=nikomatsakisManish Goregaokar-17/+14
Add filtering options to `rustc_on_unimplemented` - Add filtering options to `rustc_on_unimplemented` for local traits, filtering on `Self` and type arguments. - Add a way to provide custom notes. - Tweak binops text. - Add filter to detect wether `Self` is local or belongs to another crate. - Add filter to `Iterator` diagnostic for `&str`. Partly addresses #44755 with a different syntax, as a first approach. Fixes #46216, fixes #37522, CC #34297, #46806.
2018-02-05Stabilize use_nested_groupsPietro Albini-26/+2
2018-02-04Rollup merge of #47947 - goodmanjonathan:stabilize_match_beginning_vert, ↵kennytm-18/+4
r=petrochenkov Stabilize feature(match_beginning_vert) With this feature stabilized, match expressions can optionally have a `|` at the beginning of each arm. Reference PR: rust-lang-nursery/reference#231 Closes #44101
2018-02-03Auto merge of #47845 - Zoxc:gen-fixes, r=nikomatsakisbors-0/+1
Generator bugfixes r? @nikomatsakis
2018-02-02Rollup merge of #47914 - etaoins:improve-char-escape-in-lexer-msg, ↵kennytm-12/+19
r=petrochenkov Improve char escaping in lexer messages Currently ', " and \ are escaped as \', \" and \\ respectively. This leads to confusing messages such as `error: unknown start of token: \\` when encountering a single backslash. Fix by emitting printable ASCII characters directly. This will still escape \r, \n, \t and Unicode characters. Fixes #47902
2018-02-02Auto merge of #47465 - estebank:include-space-after-mut, r=nikomatsakisbors-2/+24
Include space in suggestion `mut` in bindings Fix #46614.
2018-02-01Fix test after rebaseEsteban Küber-5/+1
2018-02-01Remove support for `Self` in attributesEsteban Küber-7/+1
2018-02-01Fix testsEsteban Küber-1/+1
2018-02-01Rework `parse_ident_attr`Esteban Küber-25/+26
2018-02-01Add filtering options to `rustc_on_unimplemented`Esteban Küber-6/+12
- filter error on the evaluated value of `Self` - filter error on the evaluated value of the type arguments - add argument to include custom note in diagnostic - allow the parser to parse `Self` when processing attributes - add custom message to binops
2018-02-01Change offset to `0`Esteban Küber-1/+1
2018-02-01Auto merge of #47540 - Manishearth:suggestion, r=nrcbors-10/+36
Add approximate suggestions for rustfix This adds `span_approximate_suggestion()` that lets you emit a suggestion marked as "non-machine applicable" in the JSON output. UI users see no difference. This is for when rustc and clippy wish to emit suggestions which will make sense to the reader (e.g. they may have placeholders like `<type>`) but are not source-applicable, so that rustfix/etc can ignore these. fixes #39254
2018-02-01Improve char escaping in lexer messagesRyan Cumming-12/+19
Currently ', " and \ are escaped as \', \" and \\ respectively. This leads to confusing messages such as `error: unknown start of token: \\` when encountering a single backslash. Fix by emitting printable ASCII characters directly. This will still escape \r, \n, \t and Unicode characters. Fixes #47902
2018-01-31Auto merge of #45752 - estebank:highlight-primary, r=nikomatsakisbors-1/+3
Highlight code on diagnostics when underlined Highlight the label's span with the respective color: <img width="692" alt="" src="https://user-images.githubusercontent.com/1606434/32411026-a1842482-c18d-11e7-9933-6510eefbad19.png"> Fix #42112.
2018-01-30Update a few commentsMark Mansi-1/+4
2018-01-30stabilize match_beginning_vertJonathan Goodman-18/+4
2018-01-30Fix trailing whitespaceMark Mansi-1/+1
2018-01-30Improved tests + typo fixes + assertMark Mansi-0/+2
2018-01-30Add feature gate + testsMark Mansi-10/+76
2018-01-30Fix typo in error message + update testsMark Mansi-1/+1
2018-01-30Attempted fix for `?` kleene opMark Mansi-23/+21
2018-01-30Run rustfmt on macro_parser.rsMark Mansi-4/+6
2018-01-30Run rustfmt on quoted.rsMark Mansi-10/+21
2018-01-30Update the macro parser to allow at most once repetitions for `?` KleeneMark Mansi-16/+22
2018-01-30Allow `?` as a KleeneOp in the macro parserMark Mansi-46/+84
2018-01-30The `static` keyword can now begin expressionsJohn Kåre Alsaker-0/+1
2018-01-30Auto merge of #47870 - kennytm:rollup, r=kennytmbors-165/+524
Rollup of 12 pull requests - Successful merges: #47515, #47603, #47718, #47732, #47760, #47780, #47822, #47826, #47836, #47839, #47853, #47855 - Failed merges:
2018-01-30Rollup merge of #47732 - mark-i-m:markim_comments_0001, r=jseyfriedkennytm-126/+351
Run rustfmt and add doc comments to libsyntax/ext/tt/macro_parser.rs Similar to #47603 cc @theotherphil since you reviewed my other PR :smile: And because they are already assigned on #47603: r? @arielb1
2018-01-30Rollup merge of #47603 - mark-i-m:markim_comments_0000, r=jseyfriedkennytm-39/+173
Run rustfmt and add doc comments to libsyntax/ext/tt/quoted.rs I was already going to try to understand this code to try to implement rust-lang/rfcs#2298. I figured I would put that knowledge into comments and share... This PR contains _no changes_ to the code itself -- just formatting and comments. I'm not sure what the best way to do this is. I plan to make more such PR for other files, but I figured it would have fewer conflicts if I do it file by file...
2018-01-30Auto merge of #45294 - petrochenkov:prioplus, r=nikomatsakisbors-10/+25
syntax: Lower priority of `+` in `impl Trait`/`dyn Trait` Now you have to write `Fn() -> (impl A + B)` instead of `Fn() -> impl A + B`, this is consistent with priority of `+` in trait objects (`Fn() -> A + B` means `(Fn() -> A) + B`). To make this viable I changed the syntax to also permit `+` in return types in function declarations ``` fn f() -> dyn A + B { ... } // OK, don't have to write `-> (dyn A + B)` // This is acceptable, because `dyn A + B` here is an isolated type and // not part of a larger type with various operator priorities in play // like `dyn A + B` in `Fn() -> dyn A + B` despite syntax similarities. ``` but you still have to use `-> (dyn A + B)` in function types and function-like trait object types (see this PR's tests for examples). This can be a breaking change for code using `impl Trait` on nightly. The thing that is most likely to break is `&impl A + B`, it needs to be rewritten as `&(impl A + B)`. cc https://github.com/rust-lang/rust/issues/34511 https://github.com/rust-lang/rust/issues/44662 https://github.com/rust-lang/rfcs/pull/438
2018-01-29fix typosMark Mansi-4/+4
2018-01-29Update commentMark Mansi-1/+2
2018-01-29Toggle span highlighting on `-Zteach`Esteban Küber-1/+3
2018-01-29Add internal-only rustc_serialize_exclude_null attribute for making the ↵Manish Goregaokar-0/+8
field only exist in the json if the flag is passed
2018-01-29Add -Zapproximate-suggestionsManish Goregaokar-4/+18
2018-01-29Add approximate suggestions for rustfixManish Goregaokar-7/+11
This adds `span_approximate_suggestion()` that lets you emit a suggestion marked as "approximate" in the JSON output. UI users see no difference. This is for when rustc and clippy wish to emit suggestions which will make sense to the reader (e.g. they may have placeholders like `<type>`) but are not source-applicable, so that rustfix/etc can ignore these. fixes #39254
2018-01-28Auto merge of #47800 - Pulkit07:issue47755, r=sfacklerbors-3/+1
don't mention tasks in stability warnings of #[thread_local] #47755 This is a fix for issue #47755.
2018-01-28Auto merge of #47767 - estebank:as-suggestion, r=petrochenkovbors-0/+1
Correctly format `extern crate` conflict resolution help Closes #45799. Follow up to @Cldfire's #45820. If the `extern` statement that will have a suggestion ends on a `;`, synthesize a new span that doesn't include it.
2018-01-27Make `+` in `impl/dyn Trait` non-associativeVadim Petrochenkov-3/+19
2018-01-27syntax: Permit `+` in return types of function declarationsVadim Petrochenkov-6/+6
`+` is still disallowed in function types and function-like traits
2018-01-27syntax: Lower priority of `+` in `impl Trait`/`dyn Trait`Vadim Petrochenkov-4/+3
2018-01-27Fixed infinite loop issues and added some improved logging.David Wood-6/+20
2018-01-27Now handling case where span has same lo and hi.David Wood-1/+6
2018-01-27next_point now handles creating spans over multibyte characters.David Wood-5/+9
2018-01-27Replaced multi-byte character handling in end_point with potentially more ↵David Wood-23/+59
performant variant.