about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2017-08-09extended information for E0552 unrecognized representation hintZack M. Davis-1/+30
2017-08-09extended information for E0554 feature attributes only work on nightliesZack M. Davis-2/+16
It's more pleasing to use the inner-attribute syntax (`#!` rather than `#`) in the error message, as that is how `feature` attributes in particular will be declared (as they apply to the entire crate).
2017-08-08Auto merge of #43698 - MaloJaffre:confusables, r=eddybbors-19/+125
Update the list of confusable characters Also reorder and space the list to make it clearer for futures updates and to come closer to the original list. This was tedious but somewhat rewarding! Thanks @est31 for the instructions. Fixes #43629. r? @est31
2017-08-07Hint correct extern constant syntaxKornel-1/+3
2017-08-07Reexport all SyntaxExtension variantsOliver Schneider-10/+10
2017-08-06fixing doctest failures in resurfaced extended informationZack M. Davis-10/+22
After repatriating error explanations to the global registry, some lurking doctest failures surfaced and needed to be chased down. Sadly, a few doctests needed to be ignored due to a not-yet-understood regression in the doctest `compile_fail` functionality (filed #43707).
2017-08-06de-orphan extended informationZack M. Davis-1/+1
Bizarrely, librustc_passes, librustc_plugin, librustc_mir, and libsyntax weren't getting their error explanations registered. Resolves #35284.
2017-08-06Fix typo in unicode_chars.rsMalo Jaffré-1/+1
2017-08-06Update the list of confusable charactersMalo Jaffré-19/+125
Also reorder and space the list to make it clearer for futures updates and to come closer to the original list. Thanks @est31 for the instructions. Fixes #43629. r? @est31
2017-08-02Auto merge of #43584 - arielb1:unused-reads, r=eddybbors-2/+3
Fix quadratic performance with lots of use statements This fixes 2 problems that caused quadratic performance when lots of use-statements were present. After this patch, performance is linear (and very fast) even with 1M uses. Fixes #43572. Fixes #43573. r? @eddyb
2017-08-01Fixed all unnecessary muts in language coreIsaac van Bakel-3/+3
2017-08-01syntax: avoid loading the same source-file multiple timesAriel Ben-Yehuda-2/+3
We already had a cache for file contents, but we read the source-file before testing the cache, causing obvious slowness, so this just avoids loading the source-file when the cache already has the contents.
2017-07-30default binding modes: add pat_binding_modesTobias Schottdorf-7/+8
This PR kicks off the implementation of the [default binding modes RFC][1] by introducing the `pat_binding_modes` typeck table mentioned in the [mentoring instructions][2]. `pat_binding_modes` is populated in `librustc_typeck/check/_match.rs` and used wherever the HIR would be scraped prior to this PR. Unfortunately, one blemish, namely a two callers to `contains_explicit_ref_binding`, remains. This will likely have to be removed when the second part of [1], the `pat_adjustments` table, is tackled. Appropriate comments have been added. See #42640. [1]: https://github.com/rust-lang/rfcs/pull/2005 [2]: https://github.com/rust-lang/rust/issues/42640#issuecomment-313535089
2017-07-30Auto merge of #43551 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-2/+12
Rollup of 8 pull requests - Successful merges: #43409, #43501, #43509, #43512, #43513, #43536, #43544, #43549 - Failed merges:
2017-07-29Rollup merge of #43501 - topecongiro:span-to-whereclause, r=nrcMark Simulacrum-2/+12
Add Span to ast::WhereClause This PR adds `Span` field to `ast::WhereClause`. The motivation here is to make rustfmt's life easier when recovering comments before and after where clause. r? @nrc
2017-07-29Auto merge of #43009 - GuillaumeGomez:unused-doc-comments, r=nrcbors-5/+11
Throw errors when doc comments are added where they're unused #42617
2017-07-28syntax: Capture a `TokenStream` when parsing itemsAlex Crichton-11/+150
This is then later used by `proc_macro` to generate a new `proc_macro::TokenTree` which preserves span information. Unfortunately this isn't a bullet-proof approach as it doesn't handle the case when there's still other attributes on the item, especially inner attributes. Despite this the intention here is to solve the primary use case for procedural attributes, attached to functions as outer attributes, likely bare. In this situation we should be able to now yield a lossless stream of tokens to preserve span information.
2017-07-29Add Span to ast::WhereClausetopecongiro-2/+12
2017-07-28syntax: Add `tokens: Option<TokenStream>` to ItemAlex Crichton-9/+33
This commit adds a new field to the `Item` AST node in libsyntax to optionally contain the original token stream that the item itself was parsed from. This is currently `None` everywhere but is intended for use later with procedural macros.
2017-07-28Remove support for `gen arg`Alex Crichton-26/+1
2017-07-28Fix printingJohn Kåre Alsaker-5/+3
2017-07-28Fix tidy warningsAlex Crichton-1/+1
2017-07-28Generator literal supportJohn Kåre Alsaker-1/+63
2017-07-28Auto merge of #43432 - pczarn:macro-parser-description, r=jseyfriedbors-100/+102
Make the macro parser theory description more accurate The macro parser is described as an NFA, not an Earley parser.
2017-07-27Avoid duplicated errors for generic arguments in macro pathsVadim Petrochenkov-1/+1
2017-07-27Give span to angle bracketed generic argumentsVadim Petrochenkov-26/+18
2017-07-27Discern between `Path` and `Path<>` in ASTVadim Petrochenkov-20/+14
2017-07-27Simplify parsing of pathsVadim Petrochenkov-249/+143
2017-07-27Make a lint insteadGuillaume Gomez-32/+7
2017-07-27Throw errors when doc comments are added where they're unusedGuillaume Gomez-5/+36
2017-07-27Auto merge of #43489 - petrochenkov:mutref, r=GuillaumeGomezbors-2/+12
Better diagnostics and recovery for `mut ref` in patterns Fixes https://github.com/rust-lang/rust/issues/43286 Supersedes https://github.com/rust-lang/rust/pull/43451 r? @GuillaumeGomez
2017-07-27Auto merge of #43477 - est31:master, r=alexcrichtonbors-1/+1
Switch to begin_panic again In https://github.com/rust-lang/rust/pull/42938 we made the compiler emit a call to begin_panic_new in order to pass column info to it. Now with stage0 updated (https://github.com/rust-lang/rust/pull/43320), we can safely change begin_panic and start emitting calls for it again.
2017-07-26Auto merge of #43373 - alexcrichton:stabilize-1.20.0, r=aturonbors-5/+2
Stabilize more APIs for the 1.20.0 release In addition to the few stabilizations that have already landed, this cleans up the remaining APIs that are in `final-comment-period` right now to be stable by the 1.20.0 release
2017-07-26Better diagnostics and recovery for `mut ref` in patternsVadim Petrochenkov-2/+12
2017-07-26Rollup merge of #43463 - nrc:catch-span, r=petrochenkovMark Simulacrum-1/+1
Fix the spans of catch blocks to include the `do`
2017-07-25Switch to begin_panic againest31-1/+1
In https://github.com/rust-lang/rust/pull/42938 we made the compiler emit a call to begin_panic_new in order to pass column info to it. Now with stage0 updated (https://github.com/rust-lang/rust/pull/43320), we can safely change begin_panic and start emitting calls for it again.
2017-07-25Stabilize the `compile_error_macro` featureAlex Crichton-5/+2
Stabilizes: * `compile_error!` as a macro defined by rustc Closes #40872
2017-07-25Fix the spans of catch blocks to include the `do`Nick Cameron-1/+1
2017-07-24Rollup merge of #43421 - alexcrichton:add-some-build-scripts, r=Mark-SimulacrumMark Simulacrum-0/+15
rustc: Add some build scripts for librustc crates This commit adds some "boilerplate" build scripts to librustc/libsyntax crates to declare dependencies on various environment variables that are configured throughout the build. Cargo recently gained the ability to depend on environment variables in build scripts which can help trigger recompilation of a crate. This should fix weird bugs where after you make a commit or a few days later you'll get weird "not built with the same compiler" errors hopefully.
2017-07-24Make the macro parser theory description more accuratePiotr Czarnecki-100/+102
2017-07-23Auto merge of #43096 - estebank:ascription-help, r=nikomatsakisbors-1/+16
Point at `:` when using it instead of `;` When triggering type ascription in such a way that we can infer a statement end was intended, add a suggestion for the change. Always point out the reason for the expectation of a type is due to type ascription. Fix #42057, #41928.
2017-07-23Auto merge of #43386 - oli-obk:suggestions, r=nikomatsakisbors-1/+1
Adjust new suggestions to the suggestion guidelines Addresses https://github.com/rust-lang/rust/pull/42033#discussion_r127694915 guidelines are https://github.com/rust-lang/rust/blob/master//src/librustc_errors/diagnostic.rs#L212-L224
2017-07-23Lambda expressions honor no struct literal restrictionAleksey Kladov-1/+4
2017-07-22rustc: Add some build scripts for librustc cratesAlex Crichton-0/+15
This commit adds some "boilerplate" build scripts to librustc/libsyntax crates to declare dependencies on various environment variables that are configured throughout the build. Cargo recently gained the ability to depend on environment variables in build scripts which can help trigger recompilation of a crate. This should fix weird bugs where after you make a commit or a few days later you'll get weird "not built with the same compiler" errors hopefully.
2017-07-22Auto merge of #43352 - estebank:macro-span-replacement, r=petrochenkovbors-7/+52
Use the macro structure spans instead of the invocation Fix #42104, CC #2887.
2017-07-21make JSON error byte position start at top of fileZack M. Davis-3/+2
The `hi` and `lo` offsets in a span are relative to a `CodeMap`, but this doesn't seem to be terribly useful for tool consumers who don't have the codemap, but might want the byte offset within an actual file? Resolves #35164.
2017-07-21Review commentsEsteban Küber-5/+6
2017-07-21Adjust new suggestions to the suggestion guidelinesOliver Schneider-1/+1
2017-07-20Use the macro structure spans instead of the invocationEsteban Küber-7/+51
2017-07-18Catch expression does not require semicolon to be a statementAleksey Kladov-1/+2