about summary refs log tree commit diff
path: root/src/test/ui/parser
AgeCommit message (Collapse)AuthorLines
2019-12-12Use `Option` in `ImplItemKind::Const`.Mazdak Farrokhzad-0/+23
2019-12-12Alias `TraitItem` & `ImplItem`.Mazdak Farrokhzad-6/+67
Allow defaultness on trait items syntactically.
2019-12-03Accurately portray raw identifiers in error messagesEsteban Küber-4/+4
When refering to or suggesting raw identifiers, refer to them with `r#`. Fix #65634.
2019-12-02syntax: Introduce a struct `MacArgs` for macro argumentsVadim Petrochenkov-3/+3
2019-11-27Rollup merge of #66718 - VirrageS:use_comma, r=CentrilTyler Mandry-17/+40
Refactor `parse_enum_item` to use `parse_delim_comma_seq` Followup after https://github.com/rust-lang/rust/pull/66641 Some errors got more verbose but I think they make sense with the help message.
2019-11-26Refactor 'parse_enum_item' to use 'parse_delim_comma_seq'Janusz Marcinkiewicz-17/+40
2019-11-24Auto merge of #66592 - estebank:raw-raw-ah-ah-ah, r=cramertjbors-20/+0
Rework raw ident suggestions Use heuristics to determine whethersuggesting raw identifiers is appropriate. Account for raw identifiers when printing a path in a `use` suggestion. Fix #66126.
2019-11-23Rework raw ident suggestionsEsteban Küber-20/+0
Use heuristics to determine whethersuggesting raw identifiers is appropriate. Account for raw identifiers when printing a path in a `use` suggestion.
2019-11-23Rollup merge of #66539 - estebank:let-ty, r=CentrilMazdak Farrokhzad-7/+21
Point at type in `let` assignment on type errors Fix #61067.
2019-11-22Rollup merge of #66183 - Centril:empty-vis-trait-decl, r=petrochenkovMazdak Farrokhzad-25/+91
*Syntactically* permit visibilities on trait items & enum variants Fixes #65041 Suppose we have `$vis trait_item` or `$vis enum_variant` and `$vis` is a `:vis` macro fragment. Before this PR, this would fail to parse. This is now instead allowed as per language team consensus in https://github.com/rust-lang/rust/issues/65041#issuecomment-538105286. (See added tests for elaboration.) Moreover, we now also permit visibility modifiers on trait items & enum variants *syntactically* but reject them with semantic checks (in `ast_validation`): ```rust #[cfg(FALSE)] trait Foo { pub fn bar(); } // OK #[cfg(FALSE)] enum E { pub U } // OK ```
2019-11-21Point at type in `let` assignment on type errorsEsteban Küber-7/+21
2019-11-18Surround types with backticks in type errorsEsteban Küber-29/+29
2019-11-18Remove E0308 note when primary label has all infoEsteban Küber-118/+10
2019-11-18review comments: tweak prefix stringsEsteban Küber-30/+30
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-16/+16
2019-11-16Add test for issue 63116Alex Macleod-0/+27
2019-11-15Rollup merge of #66407 - JohnTitor:add-ice-tests, r=CentrilMazdak Farrokhzad-0/+20
Add more tests for fixed ICEs Closes #36122 (fixed in 1.20.0) Closes #58094 (fixed in #66054) Also, fix mistaken test case, from #30904 to #30906 (cc @eddyb) r? @Centril
2019-11-15Apply suggestion from CentrilYuki Okushi-1/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-11-15Add test for issue-58094Yuki Okushi-0/+20
2019-11-15add a unit test for #62524Guanqun Lu-0/+38
2019-11-14Rollup merge of #66361 - Centril:66357, r=pnkfelixYuki Okushi-0/+30
parser: don't use `unreachable!()` in `fn unexpected`. Fixes #66357 r? @estebank
2019-11-14Rollup merge of #66351 - JohnTitor:tweak-range-err-msg, r=CentrilYuki Okushi-48/+24
Tweak non-char/numeric in range pattern diagnostic Fixes #66283 r? @estebank
2019-11-13parser: don't use `unreachable!()` in `fn unexpected`.Mazdak Farrokhzad-0/+30
2019-11-13Tweak non-char/numeric in range pattern diagnosticYuki Okushi-48/+24
2019-11-11fix an ICE in macro's diagnostic messageGuanqun Lu-3/+37
2019-11-11syntactically allow visibility on trait item & enum variantMazdak Farrokhzad-25/+91
2019-11-08Rollup merge of #66007 - estebank:remove-here, r=CentrilMazdak Farrokhzad-87/+87
Remove "here" from "expected one of X here"
2019-11-07Rollup merge of #65974 - Centril:matcher-friendly-gating, r=petrochenkovMazdak Farrokhzad-0/+14
A scheme for more macro-matcher friendly pre-expansion gating Pre-expansion gating will now avoid gating macro matchers that did not result in `Success(...)`. That is, the following is now OK despite `box 42` being a valid `expr` and that form being pre-expansion gated: ```rust macro_rules! m { ($e:expr) => { 0 }; // This fails on the input below due to `, foo`. (box $e:expr, foo) => { 1 }; // Successful matcher, we should get `2`. } fn main() { assert_eq!(1, m!(box 42, foo)); } ``` Closes https://github.com/rust-lang/rust/issues/65846. r? @petrochenkov cc @Mark-Simulacrum
2019-11-07test that extern lits accept raw strings annd escapesMazdak Farrokhzad-0/+26
2019-11-07test that parser is oblivious to set of ABIsMazdak Farrokhzad-0/+17
2019-11-07parser: allow ABIs from literal macro fragmentsMazdak Farrokhzad-4/+30
2019-11-06Remove "here" from "expected one of X here"Esteban Küber-87/+87
2019-11-06rollback gating for failing macro matchersMazdak Farrokhzad-0/+14
2019-11-06Rollup merge of #66054 - petrochenkov:delspan, r=estebankMazdak Farrokhzad-7/+27
syntax: Avoid span arithmetic for delimiter tokens The +/-1 logic is from the time where the whole group had a single span and the delimiter spans had to be calculated from it. Now the delimiters have their own spans which are constructed by lexer or proc macro API and can be used directly. If those spans are not perfect, then it should be fixed by tweaking the corresponding lexer logic rather than by trying to add or substract `1` from the span boundaries. Fixes https://github.com/rust-lang/rust/issues/62524 r? @estebank
2019-11-04Auto merge of #65838 - estebank:resilient-recovery, r=Centrilbors-33/+132
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-03syntax: Avoid span arithmetics for delimiter tokensVadim Petrochenkov-7/+27
2019-11-02Auto merge of #66004 - eddyb:revert-early-gate, r=petrochenkovbors-5/+16
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-10-31Revert "pre-expansion gate exclusive_range_pattern"Eduard-Mihai Burtescu-5/+16
This reverts commit 665a876e307933c6480a6c55a3e38e88937aff2c.
2019-10-31Update ui testsGuillaume Gomez-2/+4
2019-10-30Do not complain about missing `fn main()` in some casesEsteban Küber-85/+18
2019-10-30Reduce ammount of errors given unclosed delimiterEsteban Küber-3/+169
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-29Rollup merge of #65809 - roblabla:eficall-abi, r=nagisaMazdak Farrokhzad-1/+1
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-28Rollup merge of #65640 - estebank:recover-missing-semi, r=CentrilMazdak Farrokhzad-38/+39
Use heuristics to recover parsing of missing `;` - Detect `,` and `:` typos where `;` was intended. - When the next token could have been the start of a new statement, detect a missing semicolon. Fix #48160, fix #44767 (after adding note about statements).
2019-10-28review commentsEsteban Küber-1/+1
2019-10-28Tweak unexpected token wordingEsteban Küber-25/+26
2019-10-28Use heuristics to recover parsing of missing `;`Esteban Küber-24/+24
- 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-27Point at local similarly named element and tweak references to variantsEsteban Küber-2/+2
Point at the span for the definition of ADTs internal to the current crate. Look at the leading char of the ident to determine whether we're expecting a likely fn or any of a fn, a tuple struct or a tuple variant. Turn fn `add_typo_suggestion` into a `Resolver` method.
2019-10-26Rollup merge of #65773 - estebank:sugg-whitespace, r=CentrilMazdak Farrokhzad-0/+75
Increase spacing for suggestions in diagnostics Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages. r? @Centril
2019-10-25Add new EFIAPI ABIroblabla-1/+1
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-24Increase spacing for suggestions in diagnosticsEsteban Küber-0/+75
Make the spacing between the code snippet and verbose structured suggestions consistent with note and help messages.