about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-11-04Auto merge of #65838 - estebank:resilient-recovery, r=Centrilbors-48/+96
Reduce amount of errors given unclosed delimiter When in a file with a non-terminated item, catch the error and consume the block instead of trying to recover it on a more granular way in order to reduce the amount of unrelated errors that would be fixed after adding the missing closing brace. Also point out the possible location of the missing closing brace. Fix #63690.
2019-11-02Auto merge of #66004 - eddyb:revert-early-gate, r=petrochenkovbors-2/+110
Partially revert the early feature-gatings added in #65742. The intent here is to address #65860 ASAP (in time for beta, ideally), while leaving as much of #65742 around as possible, to make it easier to re-enable later. Therefore, I've only kept the parts of the revert that re-add the old (i.e. non-early) feature-gating checks that were removed in #65742, and the test reverts. I've disabled the new early feature-gating checks from #65742 entirely for now, but it would be easy to put them behind a `-Z` flag, or turn them into warnings, which would allow us to keep tests for both the early and late versions of the checks - assuming that's desirable. cc @nikomatsakis @Mark-Simulacrum @Centril
2019-11-01Rollup merge of #65995 - GuillaumeGomez:add-err-code-E0743, r=estebankTyler Mandry-3/+19
Add error code E0743 for "C-variadic has been used on a non-foreign function" Fixes https://github.com/rust-lang/rust/issues/65967
2019-10-31syntax: disable the new early feature-gatings added in #65742.Eduard-Mihai Burtescu-0/+15
2019-10-31Revert "pre-expansion gate trait_alias."Eduard-Mihai Burtescu-0/+9
This reverts commit 2d182b82ce5ecfe8090ba3d4e78f1cd72c072ef1.
2019-10-31Revert "pre-expansion gate associated_type_bounds"Eduard-Mihai Burtescu-1/+14
This reverts commit c17a1fd7d0ef0f1f546445d0c8bdb11be55e4be7.
2019-10-31Revert "pre-expansion gate crate_visibility_modifier"Eduard-Mihai Burtescu-0/+8
This reverts commit 04c661ba021730bc13d33c6d55cb9aad05026f36.
2019-10-31Revert "pre-expansion gate const_generics"Eduard-Mihai Burtescu-1/+11
This reverts commit 49cbfa1a6f6469ddbc0e88161e52104cc87aea9b.
2019-10-31Revert "pre-expansion gate decl_macro"Eduard-Mihai Burtescu-0/+5
This reverts commit 1f470ceac2202ecffe8a15acc1139edb9ad4a03b.
2019-10-31Revert "pre-expansion gate box_patterns"Eduard-Mihai Burtescu-1/+14
This reverts commit 2aff6b36d7ed5c25700669a92b4a43200ee0fe6b.
2019-10-31Revert "pre-expansion gate exclusive_range_pattern"Eduard-Mihai Burtescu-1/+6
This reverts commit 665a876e307933c6480a6c55a3e38e88937aff2c.
2019-10-31Revert "pre-expansion gate try_blocks"Eduard-Mihai Burtescu-0/+3
This reverts commit 1935ba658c576f14397c2c7a26a6642cf08f26a6.
2019-10-31Revert "pre-expansion gate label_break_value"Eduard-Mihai Burtescu-0/+6
This reverts commit 137ded8ab1edf5112c45e0b6854272ae2e9d3a6d.
2019-10-31Revert "pre-expansion gate box_syntax"Eduard-Mihai Burtescu-0/+6
This reverts commit e4ed8865786a787a7b0c045f7674569b6be0e9bc.
2019-10-31Revert "pre-expansion gate type_ascription"Eduard-Mihai Burtescu-0/+15
This reverts commit 15a6c09b6e8a977f2c6f5a73de01a20d00b37930.
2019-10-31Create new error E0743Guillaume Gomez-3/+19
2019-10-30Do not complain about missing `fn main()` in some casesEsteban Küber-8/+17
2019-10-30Reduce ammount of errors given unclosed delimiterEsteban Küber-44/+83
When in a file with a non-terminated item, catch the error and consume the block instead of trying to recover it more granularly in order to reduce the amount of unrelated errors that would be fixed after adding the missing closing brace. Also point out the possible location of the missing closing brace.
2019-10-29stabilize cfg(doctest)Guillaume Gomez-4/+2
2019-10-29Rollup merge of #65809 - roblabla:eficall-abi, r=nagisaMazdak Farrokhzad-0/+7
Add new EFIAPI ABI Fixes #54527 Adds a new ABI, "efiapi", which reflects the calling convention as specified by [the current spec UEFI spec](https://uefi.org/sites/default/files/resources/UEFI%20Spec%202_7_A%20Sept%206.pdf#G6.999903). When compiling for x86_64, we should select the `win64` ABI, while on all other architectures (Itanium, x86, ARM and ARM64 and RISC-V), we should select the `C` ABI. Currently, this is done by just turning it into the C ABI everywhere except on x86_64, where it's turned into the win64 ABI. Should we prevent this ABI from being used on unsupported architectures, and if so, how would this be done?
2019-10-29Rollup merge of #65294 - varkor:lint-inline-prototype, r=matthewjasperMazdak Farrokhzad-1/+1
Lint ignored `#[inline]` on function prototypes Fixes https://github.com/rust-lang/rust/issues/51280. - Adds a `unused_attribute` lint for `#[inline]` on function prototypes. - As a consequence, foreign items, impl items and trait items now have their attributes checked, which could cause some code to no longer compile (it was previously erroneously ignored).
2019-10-28review commentsEsteban Küber-42/+39
2019-10-28Tweak unexpected token wordingEsteban Küber-5/+5
2019-10-28Use heuristics to recover parsing of missing `;`Esteban Küber-76/+96
- Detect `,` and `:` typos where `;` was intended. - When the next token could have been the start of a new statement, detect a missing semicolon.
2019-10-28Auto merge of #65188 - matthewjasper:stabilize-const-constructor, r=Centrilbors-3/+2
Stabilize `const_constructor` # Stabilization proposal I propose that we stabilize `#![feature(const_constructor)]`. Tracking issue: https://github.com/rust-lang/rust/issues/61456 Version target: 1.40 (2019-11-05 => beta, 2019-12-19 => stable). ## What is stabilized ### User guide Tuple struct and tuple variant constructors are now considered to be constant functions. As such a call expression where the callee has a tuple struct or variant constructor "function item" type can be called: ```rust const fn make_options() { // These already work because they are special cased: Some(0); (Option::Some)(1); // These also work now: let f = Option::Some; f(2); {Option::Some}(3); <Option<_>>::Some(5); } ``` ### Motivation Consistency with other `const fn`. Consistency between syntactic path forms. This should also ensure that constructors implement `const Fn` traits and can be coerced to `const fn` function pointers, if they are introduced. ## Tests * [ui/consts/const_constructor/const-construct-call.rs](https://github.com/rust-lang/rust/blob/0d75ab2293a106eb674ac01860910cfc1580837e/src/test/ui/consts/const_constructor/const-construct-call.rs) - Tests various syntactic forms, use in both `const fn` and `const` items, and constructors in both the current and extern crates. * [ui/consts/const_constructor/const_constructor_qpath.rs](https://github.com/rust-lang/rust/blob/1850dfcdabf8258a1f023f26c2c59e96b869dd95/src/test/ui/consts/const_constructor/const_constructor_qpath.rs) - Tests that type qualified paths to enum variants are also considered to be `const fn`.(#64247) r? @oli-obk Closes #61456 Closes #64247
2019-10-28Rollup merge of #65792 - Centril:split-syntax-2, r=petrochenkovMazdak Farrokhzad-31/+125
rustc, rustc_passes: reduce deps on rustc_expand Part of #65324. r? @petrochenkov
2019-10-27Stabilize `const_constructor`Matthew Jasper-3/+2
2019-10-27rustc, rustc_passes: don't depend on syntax_expand.Mazdak Farrokhzad-0/+97
This is done by moving some data definitions to syntax::expand.
2019-10-27syntax/attr: reduce reliance on parserMazdak Farrokhzad-31/+28
2019-10-26review comments and tweaksEsteban Küber-1/+1
2019-10-26Rollup merge of #65761 - popzxc:document-ast, r=petrochenkovMazdak Farrokhzad-26/+112
libsyntax: Enhance documentation of the AST module This PR enhances documentation state to the `libsyntax/ast.rs` (as initiative caused by [rustc-guide#474](https://github.com/rust-lang/rustc-guide/issues/474)), by adding: - Module documentation. - Doc-comments (and a bit of usual comments) in non-obvious (as for me) places. - Minor style fixes to improve module readability.
2019-10-26libsyntax: Document ast moduleIgor Aleksanov-26/+112
Apply review suggestions Remove links in the module docs Flatten imports Apply review suggestions Remove useless comments Fix nits
2019-10-25Update bitflagsvarkor-1/+1
2019-10-25Add proper tracking issue for EFIAPIroblabla-1/+1
2019-10-25Add new EFIAPI ABIroblabla-0/+7
Adds a new ABI for the EFIAPI calls. This ABI should reflect the latest version of the UEFI specification at the time of commit (UEFI spec 2.8, URL below). The specification says that for x86_64, we should follow the win64 ABI, while on all other supported platforms (ia32, itanium, arm, arm64 and risc-v), we should follow the C ABI. To simplify the implementation, we will simply follow the C ABI on all platforms except x86_64, even those technically unsupported by the UEFI specification. https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf
2019-10-25Rollup merge of #65790 - Centril:move-report-invalid, r=davidtwcoMazdak Farrokhzad-19/+20
move report_invalid_macro_expansion_item to item.rs From https://github.com/rust-lang/rust/pull/65324. r? @Mark-Simulacrum
2019-10-25Rollup merge of #65789 - Centril:with-desugared-doc, r=davidtwcoMazdak Farrokhzad-29/+5
move Attribute::with_desugared_doc to librustdoc From https://github.com/rust-lang/rust/pull/65324. r? @varkor
2019-10-25Rollup merge of #65787 - Centril:panictry, r=davidtwcoMazdak Farrokhzad-17/+17
move panictry! to where it is used. From https://github.com/rust-lang/rust/pull/65324 r? @davidtwco
2019-10-25Rollup merge of #65074 - Rantanen:json-byte-pos, r=matkladMazdak Farrokhzad-4/+199
Fix the start/end byte positions in the compiler JSON output Track the changes made during normalization in the `SourceFile` and use this information to correct the `start_byte` and `end_byte` fields in the JSON output. This should ensure the start/end byte fields can be used to index the original file, even if Rust normalized the source code for parsing purposes. Both CRLF to LF and BOM removal are handled with this one. The rough plan was discussed with @matklad in rust-lang-nursery/rustfix#176 - although I ended up going with `u32` offset tracking so I wouldn't need to deal with `u32 + i32` arithmetics when applying the offset to the span byte positions. Fixes #65029
2019-10-25RFC 2008: StabilizationDavid Wood-7/+4
This commit stabilizes RFC 2008 (#44109) by removing the feature gate. Signed-off-by: David Wood <david@davidtw.co>
2019-10-25Rollup merge of #65747 - Centril:union-issue-fix, r=varkorMazdak Farrokhzad-5/+13
Adjust the tracking issue for `untagged_unions`. Makes https://github.com/rust-lang/rust/issues/55149 the new tracking issue for `untagged_unions`. Closes https://github.com/rust-lang/rust/issues/32836 which is the old tracking issue. r? @varkor
2019-10-25Rollup merge of #65742 - Centril:gate-pre-expansion-subset, r=davidtwcoMazdak Farrokhzad-126/+124
Pre-expansion gate most of the things This is a subset of https://github.com/rust-lang/rust/pull/64672. A crater run has already been done and this PR implements conclusions according to https://github.com/rust-lang/rust/pull/64672#issuecomment-542703363. r? @davidtwco cc @petrochenkov
2019-10-25move report_invalid_macro_expansion_item to item.rsMazdak Farrokhzad-19/+20
2019-10-25move Attribute::with_desugared_doc to librustdocMazdak Farrokhzad-29/+5
2019-10-25move panictry! to where it is used.Mazdak Farrokhzad-17/+17
2019-10-24Adjust the tracking issue for `untagged_unions`.Mazdak Farrokhzad-5/+13
Also elaborate on some feature gates in `active.rs`.
2019-10-24pre-expansion gate type_ascriptionMazdak Farrokhzad-15/+9
2019-10-24pre-expansion gate box_syntaxMazdak Farrokhzad-7/+6
2019-10-24pre-expansion gate label_break_valueMazdak Farrokhzad-6/+7
2019-10-24dedup GAT gate checksMazdak Farrokhzad-16/+21