about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
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-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-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
2017-07-18Unify rules about commas in match arms and semicolons in expressionsAleksey Kladov-10/+2
2017-07-17Add flag to hide code on inline suggestionsEsteban Küber-3/+3
Now there's a way to add suggestions that hide the suggested code when presented inline, to avoid weird wording when short code snippets are added at the end.
2017-07-17Change some helps to suggestionsOliver Schneider-2/+2
2017-07-16Point at `:` when using it instead of `;`Esteban Küber-1/+16
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.
2017-07-15Auto merge of #43224 - jseyfried:fix_macro_idents_regression, r=nrcbors-1/+2
macros: fix regression involving identifiers in `macro_rules!` patterns. Fixes #42019. r? @nrc
2017-07-15Auto merge of #43185 - durka:thread-local-pub-restricted, r=alexcrichtonbors-8/+19
support pub(restricted) in thread_local! (round 2) Resurrected #40984 now that the issue blocking it was fixed. Original description: `pub(restricted)` was stabilized in #40556 so let's go! Here is a [playground](https://play.rust-lang.org/?gist=f55f32f164a6ed18c219fec8f8293b98&version=nightly&backtrace=1). I changed the interface of `__thread_local_inner!`, which is supposedly unstable but this is not checked for macros (#34097 cc @petrochenkov @jseyfried), so this may be an issue.
2017-07-13Fix regression involving identifiers in `macro_rules!` patterns.Jeffrey Seyfried-1/+2
2017-07-11let #[allow_internal_unstable] cover :visAlex Burka-8/+19
2017-07-11Make a few functions non-publicMark Simulacrum-9/+4
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