about summary refs log tree commit diff
path: root/src/libsyntax/parse/diagnostics.rs
AgeCommit message (Collapse)AuthorLines
2019-10-16move diagnostics.rs into parser/Mazdak Farrokhzad-1483/+0
2019-10-15move maybe_report_invalid_custom_discriminants to feature_gateMazdak Farrokhzad-52/+3
2019-10-14Rollup merge of #65363 - Centril:less-pprust, r=Mark-SimulacrumMazdak Farrokhzad-1/+1
Remove implicit dependencies on syntax::pprust Part of https://github.com/rust-lang/rust/pull/65324. The main goal here is to facilitate the eventual move of pprust out from libsyntax and because an AST definition typically should not depend on its pretty printer. r? @estebank
2019-10-13ast: remove implicit pprust dependency via Display.Mazdak Farrokhzad-1/+1
Instead just use `pprust::path_to_string(..)` where needed. This has two benefits: a) The AST definition is now independent of printing it. (Therefore we get closer to extracting a data-crate.) b) Debugging should be easier as program flow is clearer.
2019-10-13syntax: simplify maybe_annotate_with_ascriptionMazdak Farrokhzad-9/+11
2019-10-05Rollup merge of #64909 - estebank:turbofish-reloaded, r=CentrilTyler Mandry-13/+150
When encountering chained operators use heuristics to recover from bad turbofish
2019-10-03review commentsEsteban Küber-25/+32
2019-10-03review commentsEsteban Küber-20/+17
2019-10-03review commentsEsteban Küber-36/+43
2019-10-03Account for missing turbofish in paths tooEsteban Küber-4/+43
2019-10-03review commentsEsteban Küber-38/+49
2019-10-03When encountering chained operators use heuristics to recover from bad turbofishEsteban Küber-12/+88
2019-10-02syntax: improve parameter without type suggestionsDavid Wood-8/+24
This commit improves the suggestions provided when function parameters do not have types: - A new suggestion is added for arbitrary self types, which suggests adding `self: ` before the type. - Existing suggestions are now provided when a `<` is found where a `:` was expected (previously only `,` and `)` or trait items), this gives suggestions in the case where the unnamed parameter type is generic in a free function. - The suggestion that a type name be provided (e.g. `fn foo(HashMap<u32>)` -> `fn foo(HashMap: TypeName<u32>)`) will no longer occur when a `<` was found instead of `:`. - The ident will not be used for recovery when a `<` was found instead of `:`. Signed-off-by: David Wood <david@davidtw.co>
2019-09-30syntax: cleanup method parsing.Mazdak Farrokhzad-1/+1
2019-09-26Rename `Item.node` to `Item.kind`varkor-1/+1
2019-09-26Rename `Ty.node` to `Ty.kind`varkor-5/+5
2019-09-26Rename `Pat.node` to `Pat.kind`varkor-7/+7
2019-09-26Rename `Expr.node` to `Expr.kind`varkor-3/+3
For both `ast::Expr` and `hir::Expr`.
2019-09-23Auto merge of #64272 - Mark-Simulacrum:parallel-handler, r=estebankbors-7/+1
Refactor librustc_errors::Handler API This should be reviewed by-commit. The last commit moves all fields into an inner struct behind a single lock; this is done to prevent possible deadlocks in a multi-threaded compiler, as well as inconsistent state observation.
2019-09-20factor out pluralisation remains after #64280gaolei-4/+4
2019-09-17Remove Handler::cancelMark Rousskov-7/+1
2019-09-09Resolve attributes in several placesCaio-1/+8
Arm, Field, FieldPat, GenericParam, Param, StructField and Variant
2019-09-07Apply suggestions from code reviewAlexander Regueiro-1/+1
2019-09-07Aggregation of cosmetic changes made during work on REPL PRs: libsyntaxAlexander Regueiro-38/+38
2019-09-05Bail out when encountering likely missing turbofish in parserEsteban Küber-1/+4
When encountering a likely intended turbofish without `::`, bubble up the diagnostic instead of emitting it to allow the parser to recover more gracefully and avoid uneccessary type errors that are likely to be wrong.
2019-08-27Cleanup: Consistently use `Param` instead of `Arg` #62426Kevin Per-17/+17
2019-08-14Merge Variant and Variant_Caio-6/+5
2019-07-30Unsupport the await!(..) macro.Mazdak Farrokhzad-4/+19
2019-07-30Rollup merge of #62928 - Centril:recover-parens-around-for-head, r=estebankMazdak Farrokhzad-37/+81
Syntax: Recover on `for ( $pat in $expr ) $block` Fixes #62724 by adding some recovery: ``` error: unexpected closing `)` --> $DIR/recover-for-loop-parens-around-head.rs:10:23 | LL | for ( elem in vec ) { | --------------^ | | | opening `(` | help: remove parenthesis in `for` loop: `elem in vec` ``` The last 2 commits are drive-by cleanups. r? @estebank
2019-07-28Add 'span_to_snippet' shortcut.Mazdak Farrokhzad-6/+6
2019-07-28Use chaining for diagnosics in parser.Mazdak Farrokhzad-33/+33
2019-07-28Recover 'for ( $pat in $expr ) $block'.Mazdak Farrokhzad-0/+44
2019-07-27Lint attributes on function argumentsCaio-1/+1
2019-07-19review commentsEsteban Küber-7/+7
2019-07-19Handle more cases of typos misinterpreted as type ascriptionEsteban Küber-42/+49
2019-07-16normalize use of backticks in compiler messages for libsyntax/parseSamy Kacimi-1/+1
https://github.com/rust-lang/rust/issues/60532
2019-07-13review commentEsteban Küber-1/+1
2019-07-13Detect `fn` with a body in an `extern` blockEsteban Küber-0/+37
2019-07-10Move pp::Printer helpers to direct implMark Rousskov-2/+0
2019-06-29Remove io::Result from syntax::printMark Rousskov-6/+6
Since we're now writing directly to the vector, there's no need to thread results through the whole printing infrastructure
2019-06-26remove old fixmeMark Mansi-1/+1
2019-06-21Implement arbitrary_enum_discriminantJohn Wrenn-19/+29
2019-06-12Auto merge of #60669 - c410-f3r:attrs-fn, r=petrochenkovbors-4/+4
Allow attributes in formal function parameters Implements https://github.com/rust-lang/rust/issues/60406. This is my first contribution to the compiler and since this is a large and complex project, I am not fully aware of the consequences of the changes I have made. **TODO** - [x] Forbid some built-in attributes. - [x] Expand cfg/cfg_attr
2019-06-09Allow attributes in formal function parametersCaio-4/+4
2019-06-08syntax: Remove `Deref` impl from `Token`Vadim Petrochenkov-1/+1
2019-06-07parser: `self.span` -> `self.token.span`Vadim Petrochenkov-35/+35
2019-06-06Some code cleanup and tidy/test fixesVadim Petrochenkov-7/+8
2019-06-06syntax: Remove duplicate span from `token::Ident`Vadim Petrochenkov-3/+3
2019-06-06syntax: Use `Token` in `Parser`Vadim Petrochenkov-6/+6
2019-06-06syntax: Rename `Token` into `TokenKind`Vadim Petrochenkov-6/+6