about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2017-07-11Refactor cur_cmnt_and_lit away.Mark Simulacrum-46/+38
The literal index was increased in only next_lit, so it isn't necessary: code now uses an iterator. The cur_cmnt field is also moved to be increased in print_comment instead of after each call to print_comment.
2017-07-11Refactor methods onto Printer struct.Mark Simulacrum-322/+315
No (intentional) changes to behavior. This is intended to avoid the anti-pattern of having to import individual methods throughout code.
2017-07-11Auto merge of #42913 - kennytm:fix-40569-ident-without-backtrack, r=jseyfriedbors-4/+70
Only match a fragment specifier the if it starts with certain tokens. When trying to match a fragment specifier, we first predict whether the current token can be matched at all. If it cannot be matched, don't bother to push the Earley item to `bb_eis`. This can fix a lot of issues which otherwise requires full backtracking (#42838). In this PR the prediction treatment is not done for `:item`, `:stmt` and `:tt`, but it could be expanded in the future. Fixes #24189. Fixes #26444. Fixes #27832. Fixes #34030. Fixes #35650. Fixes #39964. Fixes the 4th comment in #40569. Fixes the issue blocking #40984.
2017-07-10Auto merge of #43109 - pnkfelix:fix-link_args-gate, r=nikomatsakisbors-7/+6
Fix feature gate for `#[link_args(..)]` attribute Fix feature gate for `#[link_args(..)]` attribute so that it will fire regardless of context of attribute. See also #29596 and #43106
2017-07-10Fix feature gate for `#[link_args(..)]` attribute so that it will fireFelix S. Klock II-7/+6
regardless of context of attribute. Extend the gating test to include the attribute in "weird" places.
2017-07-10Store all generic arguments for method calls in ASTVadim Petrochenkov-58/+36
2017-07-08Auto merge of #43097 - PlasmaPower:large-align, r=eddybbors-5/+5
Raise alignment limit from 2^15 to 2^31 - 1 Fixes #42960
2017-07-08Auto merge of #43019 - kevinmehall:cleanup-errors, r=nikomatsakisbors-1/+0
Remove unused code from librustc_errors While extracting librustc_errors into a [reusable library](https://github.com/kevinmehall/codemap-diagnostic), I noticed some obsolete code that the `dead_code` warning missed because it was marked `pub` but not used elsewhere.
2017-07-08Lower alignment limit down to 2^31 - 1 (from LLVM)Lee Bousfield-3/+3
2017-07-08Raised alignment limit from 2^15 to 2^31Lee Bousfield-5/+5
2017-07-07Auto merge of #42809 - seanmonstar:stable-associated-consts, r=nikomatsakisbors-14/+3
remove associated_consts feature gate Currently struggling to run tests locally (something about jemalloc target missing). cc #29646
2017-07-07syntax: Apply recovery for casts to type ascriptionVadim Petrochenkov-46/+53
Fix spans, add some comments
2017-07-07Fix spans for binary operator expression with interpolated identifiersVadim Petrochenkov-5/+12
2017-07-07Only match a fragment specifier the if it starts with certain tokens.kennytm-4/+70
Fixes #24189. Fixes #26444. Fixes #27832. Fixes #34030. Fixes #35650. Fixes #39964. Fixes the 4th comment in #40569. Fixes the issue blocking #40984.
2017-07-06Remove unused code from librustc_errorsKevin Mehall-1/+0
2017-07-06Only underline suggestion if it is not the only code being shownEsteban Küber-1/+1
2017-07-06Add extra whitespace for suggestionsEsteban Küber-4/+4
2017-07-06remove associated_consts feature gateSean McArthur-14/+3
2017-07-06Disallow `$($v:vis)*`. Fix #42755.kennytm-0/+1
2017-07-06Auto merge of #42727 - alexcrichton:allocators-new, r=eddybbors-7/+23
rustc: Implement the #[global_allocator] attribute This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/1974 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-07-05rustc: Implement the #[global_allocator] attributeAlex Crichton-7/+23
This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/197 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-07-05Merge remote-tracking branch 'origin/master' into proc_macro_apiAlex Crichton-59/+75
2017-07-02Output line column info when panickingest31-5/+6
2017-06-29Auto merge of #42902 - petrochenkov:keydcrate, r=jseyfriedbors-50/+41
Make `$crate` a keyword Fixes https://github.com/rust-lang/rust/issues/42898 r? @jseyfried or @nrc
2017-06-29Give a tracking-issue number for unsized tuple coercion.Masaki Hara-1/+1
2017-06-29Move unsized_tuple_coercion behind a feature gate.Masaki Hara-0/+6
2017-06-29Change some terminology around keywords and reserved identifierspetrochenkov-42/+33
2017-06-29Make `$crate` a keywordVadim Petrochenkov-8/+8
2017-06-29Rollup merge of #42886 - durka:pplmm-mwe, r=petrochenkovAriel Ben-Yehuda-1/+3
syntax: allow negative integer literal expression to be interpolated as pattern Fixes #42820. r? @jseyfried
2017-06-27syntax: allow negative integer literal expression to be interpolated as patternAlex Burka-1/+3
2017-06-26Update and fix a few testsAlex Crichton-2/+2
2017-06-26Address review comments.Jeffrey Seyfried-17/+39
2017-06-26Add `LazyTokenStream`.Jeffrey Seyfried-80/+122
2017-06-26Implement `quote!` and other `proc_macro` API.Jeffrey Seyfried-41/+245
2017-06-26Clean up `tokenstream::Cursor` and `proc_macro`.Jeffrey Seyfried-27/+27
2017-06-26Simplify `hygiene::Mark` application, andJeffrey Seyfried-118/+109
remove variant `Token::SubstNt` in favor of `quoted::TokenTree::MetaVar`.
2017-06-24Add a feature gate for the `#[allow_fail]` attributePaul Woolcock-1/+8
2017-06-24add `allow_fail` test attributePaul Woolcock-3/+12
This change allows the user to add an `#[allow_fail]` attribute to tests that will cause the test to compile & run, but if the test fails it will not cause the entire test run to fail. The test output will show the failure, but in yellow instead of red, and also indicate that it was an allowed failure.
2017-06-23Removed as many "```ignore" as possible.kennytm-8/+10
Replaced by adding extra imports, adding hidden code (`# ...`), modifying examples to be runnable (sorry Homura), specifying non-Rust code, and converting to should_panic, no_run, or compile_fail. Remaining "```ignore"s received an explanation why they are being ignored.
2017-06-21Rollup merge of #42620 - wesleywiser:compile_error, r=brsonCorey Farwell-0/+5
Add compile_error! Related to #40872
2017-06-19Bump version and stage0 compilerAlex Crichton-4/+0
2017-06-19Add compile_error!Wesley Wiser-0/+5
Related to #40872
2017-06-18Auto merge of #42593 - ibabushkin:on-demand-external-source, r=eddybbors-47/+40
Implement lazy loading of external crates' sources. Fixes #38875 Fixes #38875. This is a follow-up to #42507. When a (now correctly translated) span from an external crate is referenced in a error, warning or info message, we still don't have the source code being referenced. Since stuffing the source in the serialized metadata of an rlib is extremely wasteful, the following scheme has been implemented: * File maps now contain a source hash that gets serialized as well. * When a span is rendered in a message, the source hash in the corresponding file map(s) is used to try and load the source from the corresponding file on disk. If the file is not found or the hashes don't match, the failed attempt is recorded (and not retried). * The machinery fetching source lines from file maps is augmented to use the lazily loaded external source as a secondary fallback for file maps belonging to external crates. This required a small change to the expected stderr of one UI test (it now renders a span, where previously was none). Further work can be done based on this - some of the machinery previously used to hide external spans is possibly obsolete and the hashing code can be reused in different places as well. r? @eddyb
2017-06-16Auto merge of #42690 - frewsxcv:rollup, r=frewsxcvbors-31/+45
Rollup of 5 pull requests - Successful merges: #42616, #42651, #42654, #42656, #42685 - Failed merges:
2017-06-16Rollup merge of #42656 - VBChunguk:struct-field-attributes, r=nikomatsakisCorey Farwell-31/+2
Remove struct_field_attributes feature gate Part of #41681. ~This PR only removes the feature gate; this *does not* update any documentations.~ This PR removes the feature gate and the corresponding chapter of the Unstable Book. I'm not very sure about the changes I made though... Just followed the stabilization guideline. r? @nikomatsakis
2017-06-16Rollup merge of #42616 - estebank:span-fix, r=nikomatsakisCorey Farwell-0/+43
Position span label correctly when it isn't last Fix #42595. Before: ``` 15 | map.entry("e").or_insert(0) += 1; | ---------------------------^^^^^ot use `+=` on type `&mut {integer}` ``` After: ``` 15 | map.entry("e").or_insert(0) += 1; | ---------------------------^^^^^ | | | cannot use `+=` on type `&mut {integer}` ```
2017-06-16Auto merge of #42578 - estebank:recover-binop, r=nikomatsakisbors-9/+94
Learn to parse `a as usize < b` Parsing `a as usize > b` always works, but `a as usize < b` was a parsing error because the parser would think the `<` started a generic type argument for `usize`. The parser now attempts to parse as before, and if a DiagnosticError is returned, try to parse again as a type with no generic arguments. If this fails, return the original `DiagnosticError`. Fix #22644.
2017-06-15Position span label correctly when it isn't lastEsteban Küber-0/+43
2017-06-15Review commentsEsteban Küber-99/+71
- generate error instead of warning - remove `RewindPoint` and just keep a copy of `Parser` to rewind state. - `dont_parse_generics: bool` -> `parse_generics: bool` - remove `eat_lt` - move error handling code to separate method
2017-06-15Remove struct_field_attributes feature gateWonwoo Choi-31/+2