about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-03-22Rollup merge of #59266 - estebank:struct-parse-recovery, r=petrochenkovMazdak Farrokhzad-16/+26
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-22Rollup merge of #59170 - varkor:const-generics-rustdoc, r=QuietMisdreavus,eddybMazdak Farrokhzad-2/+2
Add const generics to rustdoc Split out from #53645. This work is a collaborative effort with @yodaldevoid. The `FIXME`s are waiting on a refactor to `LazyConst`. I'll address these in a follow up, but I thought it would be better to implement the rest now to avoid bitrot. r? @QuietMisdreavus
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-2/+4
2019-03-19Rollup merge of #59116 - estebank:comma-sugg, r=petrochenkovMazdak Farrokhzad-3/+5
Be more discerning on when to attempt suggesting a comma in a macro invocation Fix #58796.
2019-03-18Rename typarams to param_namesvarkor-2/+2
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
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-15/+23
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-17Make meta-item API compatible with `LocalInternedString::get` soundness fixVadim Petrochenkov-38/+38
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-94/+77
Remove methods `Attribute::span` and `MetaItem::span` duplicating public fields
2019-03-16Rename `MetaItem::ident` to `MetaItem::path`Vadim Petrochenkov-37/+36
2019-03-16syntax: Introduce `Ident::can_be_raw`Vadim Petrochenkov-11/+5
2019-03-16syntax_ext: Validate `#[proc_macro_derive]` input betterVadim Petrochenkov-2/+2
Tweak some error wording
2019-03-16syntax: Do not accidentally treat multi-segment meta-items as single-segmentVadim Petrochenkov-111/+109
2019-03-16Rollup merge of #59169 - tmandry:allow-features-flag, r=cramertjkennytm-4/+28
Add `-Z allow_features=...` flag Adds a compiler option to allow only whitelisted features. For projects on nightly that want to prevent feature-creep (and maybe, someday, move off of nightly). Not being able to enforce this has been a problem on Fuchsia and at other big companies. This doesn't support filtering edition feature flags, but someone is welcome to add that if they need it.
2019-03-16Rollup merge of #59079 - euclio:macro-semi, r=estebankkennytm-20/+25
add suggestions to invalid macro item error r? @estebank
2019-03-15rustc: rename item_path to def_path (except the module in ty).Eduard-Mihai Burtescu-1/+1
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-14Add `-Z allow_features=...` flagTyler Mandry-4/+28
2019-03-13add suggestions to invalid macro item errorAndy Russell-20/+25
2019-03-13Fix operator precedenceEsteban Küber-2/+2
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-11Be more discerning on when to attempt suggesting a comma in a macro invocationEsteban Küber-3/+5
2019-03-11Auto merge of #58021 - ishitatsuyuki:57667-fix, r=RalfJungbors-33/+6
Fix fallout from #57667
2019-03-09review commentsEsteban Küber-4/+4
2019-03-09Rollup merge of #59045 - topecongiro:expose-new_sub_parser_from_file, r=CentrilMazdak Farrokhzad-1/+1
Expose new_sub_parser_from_file This function is useful when external tools like rustfmt want to parse internal files without parsing a whole crate. cc https://github.com/rust-lang/rustfmt/issues/3427.
2019-03-09Rollup merge of #58762 - petrochenkov:unwind, r=Mark-SimulacrumMazdak Farrokhzad-32/+18
Mention `unwind(aborts)` in diagnostics for `#[unwind]` Simplify input validation for `#[unwind]`, add tests cc https://github.com/rust-lang/rust/issues/58760 r? @Mark-Simulacrum
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-09Fix fallout from #57667ishitatsuyuki-33/+6
2019-03-09fixes rust-lang#56766Saleem Jaffer-0/+16
2019-03-09Auto merge of #59012 - pietroalbini:rollup, r=pietroalbinibors-29/+33
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-3/+3
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-08Rollup merge of #58861 - estebank:fix-negative-traits, r=petrochenkovPietro Albini-24/+28
Expand where negative supertrait specific error is shown Fix #58857. r? @petrochenkov
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-2/+2
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