about summary refs log tree commit diff
path: root/src/libsyntax/parse
AgeCommit message (Collapse)AuthorLines
2019-03-24Separate variant id and variant constructor id.David Wood-5/+6
This commit makes two changes - separating the `NodeId` that identifies an enum variant from the `NodeId` that identifies the variant's constructor; and no longer creating a `NodeId` for `Struct`-style enum variants and structs. Separation of the variant id and variant constructor id will allow the rest of RFC 2008 to be implemented by lowering the visibility of the variant's constructor without lowering the visbility of the variant itself. No longer creating a `NodeId` for `Struct`-style enum variants and structs mostly simplifies logic as previously this `NodeId` wasn't used. There were various cases where the `NodeId` wouldn't be used unless there was an unit or tuple struct or enum variant but not all uses of this `NodeId` had that condition, by removing this `NodeId`, this must be explicitly dealt with. This change mostly applied cleanly, but there were one or two cases in name resolution and one case in type check where the existing logic required a id for `Struct`-style enum variants and structs.
2019-03-23Tweak unsupported negative trait bounds messageEsteban Küber-7/+14
2019-03-23syntax: Remove warning for unnecessary path disambiguatorsVadim Petrochenkov-21/+10
2019-03-23Auto merge of #59058 - petrochenkov:assocrecov3, r=estebankbors-88/+82
syntax: Better recovery for `$ty::AssocItem` and `ty!()::AssocItem` This PR improves on https://github.com/rust-lang/rust/pull/46788 covering a few missing cases. Fixes https://github.com/rust-lang/rust/issues/52307 Fixes https://github.com/rust-lang/rust/issues/53776 r? @estebank
2019-03-22Reword type ascription note to reduce verbosityEsteban Küber-5/+1
2019-03-22Review commentEsteban Küber-2/+2
2019-03-22Expand suggestions for type ascription parse errorsEsteban Küber-13/+66
2019-03-22Rollup merge of #59322 - estebank:diag-tweak, r=davidtwcoMazdak Farrokhzad-23/+28
Tweak incorrect escaped char diagnostic
2019-03-22Rollup merge of #59266 - estebank:struct-parse-recovery, r=petrochenkovMazdak Farrokhzad-10/+20
Do not complain about non-existing fields after parse recovery When failing to parse struct-like enum variants, the ADT gets recorded as having no fields. Record that we have actually recovered during parsing of this variant to avoid complaing about non-existing fields when actually using it. Fix #57361.
2019-03-22Auto merge of #59031 - estebank:recover-from-comaless, r=petrochenkovbors-3/+33
Recover from missing comma between enum variants and from bad `pub` kw Fix #56579. Fix #56473.
2019-03-20Tweak incorrect escaped char diagnosticEsteban Küber-23/+28
2019-03-19review commentsEsteban Küber-1/+3
2019-03-18Auto merge of #58872 - rep-nop:diagnostic-fix-56031, r=petrochenkovbors-3/+11
Adds help message in error for invalid `impl for T` syntax Fixes #56031.
2019-03-17Do not complain about non-existing fields after parse recoveryEsteban Küber-10/+18
When failing to parse struct-like enum variants, the ADT gets recorded as having no fields. Record that we have actually recovered during parsing of this variant to avoid complaing about non-existing fields when actually using it.
2019-03-16Simplify checkEsteban Küber-5/+1
2019-03-16parse full visibility when recoveringEsteban Küber-5/+9
2019-03-16Recover from incorrect `pub` kw in "reasonable" placesEsteban Küber-1/+13
2019-03-16Recover from missing comma between enum variantsEsteban Küber-2/+20
2019-03-16Fix rebaseVadim Petrochenkov-2/+0
2019-03-16Refactor away `NestedMetaItemKind`Vadim Petrochenkov-3/+2
Remove methods `Attribute::span` and `MetaItem::span` duplicating public fields
2019-03-16Rename `MetaItem::ident` to `MetaItem::path`Vadim Petrochenkov-4/+4
2019-03-16syntax: Introduce `Ident::can_be_raw`Vadim Petrochenkov-11/+5
2019-03-14Do not complain about unmentioned fields in recovered patternsEsteban Küber-1/+1
When the parser has to recover from malformed code in a pattern, do not complain about missing fields.
2019-03-13add suggestions to invalid macro item errorAndy Russell-20/+25
2019-03-13Rollup merge of #58876 - estebank:numeric-lifetime, r=petrochenkovMazdak Farrokhzad-3/+15
Parse lifetimes that start with a number and give specific error Fix #58786.
2019-03-12Address review commentsVadim Petrochenkov-2/+6
2019-03-12syntax: Optimize `maybe_whole`/`maybe_whole_expr` slightlyVadim Petrochenkov-14/+14
2019-03-12syntax: Better recovery for `$ty::AssocItem` and `ty!()::AssocItem`Vadim Petrochenkov-73/+63
2019-03-09review commentsEsteban Küber-4/+4
2019-03-09Expose new_sub_parser_from_filetopecongiro-1/+1
This function is useful when external tools like rustfmt want to parse internal files without parsing a whole crate.
2019-03-09fixes rust-lang#56766Saleem Jaffer-0/+16
2019-03-09Auto merge of #59012 - pietroalbini:rollup, r=pietroalbinibors-28/+32
Rollup of 24 pull requests Successful merges: - #58080 (Add FreeBSD armv6 and armv7 targets) - #58204 (On return type `impl Trait` for block with no expr point at last semi) - #58269 (Add librustc and libsyntax to rust-src distribution.) - #58369 (Make the Entry API of HashMap<K, V> Sync and Send) - #58861 (Expand where negative supertrait specific error is shown) - #58877 (Suggest removal of `&` when borrowing macro and appropriate) - #58883 (Suggest appropriate code for unused field when destructuring pattern) - #58891 (Remove stray ` in the docs for the FromIterator implementation for Option) - #58893 (race condition in thread local storage example) - #58906 (Monomorphize generator field types for debuginfo) - #58911 (Regression test for #58435.) - #58912 (Regression test for #58813) - #58916 (Fix release note problems noticed after merging.) - #58918 (Regression test added for an async ICE.) - #58921 (Add an explicit test for issue #50582) - #58926 (Make the lifetime parameters of tcx consistent.) - #58931 (Elide invalid method receiver error when it contains TyErr) - #58940 (Remove JSBackend from config.toml) - #58950 (Add self to mailmap) - #58961 (On incorrect cfg literal/identifier, point at the right span) - #58963 (libstd: implement Error::source for io::Error) - #58970 (delay_span_bug in wfcheck's ty.lift_to_tcx unwrap) - #58984 (Teach `-Z treat-err-as-bug` to take a number of errors to emit) - #59007 (Add a test for invalid const arguments) Failed merges: - #58959 (Add release notes for PR #56243) r? @ghost
2019-03-08Parse lifetimes that start with a number and give specific errorEsteban Küber-6/+18
2019-03-08Rollup merge of #58984 - estebank:multi-treat-err-as-bug, r=oli-obkPietro Albini-2/+2
Teach `-Z treat-err-as-bug` to take a number of errors to emit `-Z treat-err-as-bug` will cause `rustc` to panic after the first error is reported, like previously. `-Z treat-err-as-bug=2` will cause `rustc` to panic after 2 errors have been reported. Fix #58983.
2019-03-08Rollup merge of #58961 - estebank:issue-58462, r=varkorPietro Albini-2/+2
On incorrect cfg literal/identifier, point at the right span CC #58462
2019-03-08Improve recovery for missing trait in a trait implVadim Petrochenkov-11/+11
2019-03-07Adds diagnostic message and UI test.Wesley Norris-1/+9
2019-03-07Fix with_emitter callersEsteban Küber-1/+1
2019-03-06Make `-Z treat-err-as-bug` take a number of errors to be emittedEsteban Küber-1/+1
`-Z treat-err-as-bug=0` will cause `rustc` to panic after the first error is reported. `-Z treat-err-as-bug=2` will cause `rustc` to panic after 3 errors have been reported.
2019-03-06Rely on drop to emit unclosed delimsEsteban Küber-1/+0
2019-03-06Simplify codeEsteban Küber-24/+14
2019-03-06Always emit mismatched delim errors, never panicEsteban Küber-3/+2
2019-03-06Collect unclosed delimiters in parent parserEsteban Küber-4/+13
2019-03-06Emit missing unclosed delimiter errorsEsteban Küber-11/+15
2019-03-06Panic when unmatched delimiters aren't emittedEsteban Küber-0/+7
2019-03-06Emit unclosed delimiters during recoveryEsteban Küber-0/+1
2019-03-06Bail when encountering a second unexpected token in the same spanEsteban Küber-4/+10
2019-03-06Do not panic on missing close parenEsteban Küber-1/+3
Fix #58856.
2019-03-06Surround found token with `Esteban Küber-1/+1
2019-03-05On incorrect cfg literal/identifier, point at the right spanEsteban Küber-1/+1