about summary refs log tree commit diff
path: root/src/librustc_parse/parser/diagnostics.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-1643/+0
2020-08-20Capture tokens for Pat used in macro_rules! argumentAaron Hill-2/+9
This extends PR #73293 to handle patterns (Pat). Unlike expressions, patterns do not support custom attributes, so we only need to capture tokens during macro_rules! argument parsing.
2020-08-17rust_ast::ast => rustc_astUjjwal Sharma-4/+4
2020-08-15replaced log with tracingGurpreet Singh-1/+1
2020-08-06rustc_ast: Stop using "string typing" for doc comment tokensVadim Petrochenkov-1/+1
Explicitly store their kind and style retrieved during lexing in the token
2020-07-31Reduce verbosity of some type ascription errorsEsteban Küber-0/+1
* Deduplicate type ascription LHS errors * Remove duplicated `:` -> `::` suggestion from parse error * Tweak wording to be more accurate * Modify `current_type_ascription` to reduce span wrangling * remove now unnecessary match arm * Add run-rustfix to appropriate tests
2020-07-23Account for trailing closing angle bracketsEsteban Küber-22/+35
2020-07-23Detect turbofish missing surrounding angle bracketsEsteban Küber-1/+41
2020-07-09Rollup merge of #74188 - estebank:tweak-ascription-typo-heuristic, ↵Manish Goregaokar-8/+13
r=petrochenkov Tweak `::` -> `:` typo heuristic and reduce verbosity Do not trigger on correct type ascription expressions with trailing operators and _do_ trigger on likely path typos where a turbofish is used. On likely path typos, remove note explaining type ascription. Clean up indentation. r? @petrochenkov
2020-07-09Tweak `::` -> `:` typo heuristic and reduce verbosityEsteban Küber-8/+13
Do not trigger on correct type ascription expressions with trailing operators and _do_ trigger on likely path typos where a turbofish is used. On likely path typos, remove note explaining type ascription.
2020-07-06Rollup merge of #73953 - JohnTitor:audit-hidden-sugg, r=estebankManish Goregaokar-2/+5
Audit hidden/short code suggestions Should fix #73641. Audit uses of `span_suggestion_short` and `tool_only_span_suggestion` (`span_suggestion_hidden` is already tested with `run-rustfix`). Leave some FIXMEs for futher improvements/fixes. r? @estebank
2020-07-02Audit uses of `span_suggestion_short`Yuki Okushi-2/+5
2020-07-01Rollup merge of #73803 - Aaron1011:feature/angle-field-recovery, r=matthewjasperManish Goregaokar-5/+14
Recover extra trailing angle brackets in struct definition This commit applies the existing 'extra angle bracket recovery' logic when parsing fields in struct definitions. This allows us to continue parsing the struct's fields, avoiding spurious 'missing field' errors in code that tries to use the struct.
2020-06-27Fix wording for anonymous parameter name helpJames Box-1/+1
2020-06-27Recover extra trailing angle brackets in struct definitionAaron Hill-5/+14
This commit applies the existing 'extra angle bracket recovery' logic when parsing fields in struct definitions. This allows us to continue parsing the struct's fields, avoiding spurious 'missing field' errors in code that tries to use the struct.
2020-06-18Rollup merge of #73361 - estebank:non-primitive-cast, r=davidtwcoManish Goregaokar-1/+1
Tweak "non-primitive cast" error - Suggest borrowing expression if it would allow cast to work. - Suggest using `<Type>::from(<expr>)` when appropriate. - Minor tweak to `;` typo suggestion. Partily address #47136.
2020-06-15Tweak "non-primitive cast" errorEsteban Küber-1/+1
- Suggest borrowing expression if it would allow cast to work. - Suggest using `<Type>::from(<expr>)` when appropriate. - Minor tweak to `;` typo suggestion. Partily address #47136.
2020-06-09Fix more clippy warningsMatthias Krüger-1/+1
Fixes more of: clippy::unused_unit clippy::op_ref clippy::useless_format clippy::needless_return clippy::useless_conversion clippy::bind_instead_of_map clippy::into_iter_on_ref clippy::redundant_clone clippy::nonminimal_bool clippy::redundant_closure clippy::option_as_ref_deref clippy::len_zero clippy::iter_cloned_collect clippy::filter_next
2020-05-27Rollup merge of #72348 - chrissimpkins:fix-72253, r=estebankDylan DPC-0/+13
Fix confusing error message for comma typo in multiline statement Fixes #72253. Expands on the issue with a colon typo check. r? @estebank cc @ehuss
2020-05-26improve error message for unexpected comma token in multiline blockChris Simpkins-0/+13
confusing diagnostics, issue #72253 add test for confusing error message, issue-72253 remove is_multiline check, refactor to self.expect(&token:Semi) update issue-72253 tests return Ok
2020-05-24Collect tokens for `ast::Expr`Aaron Hill-0/+1
2020-05-15Remove redundant backtick in error message.Eric Huss-1/+1
The value passed in already has backticks surrounding the text.
2020-05-08Remove ast::{Ident, Name} reexports.Camille GILLOT-4/+2
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-8/+6
2020-04-18remove build warningsTshepang Lekhonkhobe-0/+2
Code blocks that are not annotated are assumed to be Rust
2020-04-17Improved try_macro_suggestion functionDuddino-4/+2
2020-04-17Improved try_macro_suggestionDuddino-3/+4
2020-04-17Moved is_try check into try_macro_suggestionDuddino-1/+2
2020-04-17Account for use of `try!()` in 2018 edition and guide users in the right ↵Duddino-0/+33
direction
2020-03-30Clean up redudant conditions and match exprsRussell Cohen-11/+10
2020-03-29Cleanup match expressionRussell Cohen-11/+7
2020-03-29Cleanup error messages, improve docstringsRussell Cohen-4/+7
2020-03-29Improve error messages for raw strings (#60762)Russell Cohen-1/+30
This diff improves error messages around raw strings in a few ways: - Catch extra trailing `#` in the parser. This can't be handled in the lexer because we could be in a macro that actually expects another # (see test) - Refactor & unify error handling in the lexer between ByteStrings and RawByteStrings - Detect potentially intended terminators (longest sequence of "#*" is suggested)
2020-03-25review commentsEsteban Küber-26/+25
2020-03-25Tweak chained operators diagnosticEsteban Küber-46/+98
Use more selective spans Improve suggestion output Be more selective when displaying suggestions Silence some knock-down type errors
2020-03-18detach submod_path from ParserMazdak Farrokhzad-31/+0
2020-03-16Rollup merge of #69520 - kornelski:e69492, r=cramertjDylan DPC-19/+7
Make error message clearer about creating new module This is a partial improvement for #69492
2020-03-09rustc_parse: Use `Token::ident` where possibleVadim Petrochenkov-5/+7
2020-03-07Make error message clearer about creating new moduleKornel-19/+7
2020-03-06fix various typosMatthias Krüger-1/+1
2020-03-05Const items have by default a static lifetime, there's no need to annotate ↵Matthias Krüger-1/+1
it. (clippy::redundant_static_lifetimes)
2020-03-01Rollup merge of #69579 - petrochenkov:noprevspan, r=CentrilYuki Okushi-26/+26
parser: Remove `Parser::prev_span` Follow-up to https://github.com/rust-lang/rust/pull/69384. r? @Centril
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-7/+7
2020-02-29parser: `prev_span` -> `prev_token.span`Vadim Petrochenkov-26/+26
2020-02-24parser: `token` -> `normalized_token`, `nonnormalized_token` -> `token`Vadim Petrochenkov-3/+3
2020-02-24Add some missing support for `NtIdent`Vadim Petrochenkov-4/+3
2020-02-11Invert control in struct_lint_level.jumbatm-1/+1
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-02-09Make issue references consistentMatthias Prechtl-2/+2
2020-02-05parser: merge `fn` grammars wrt. bodies & headersMazdak Farrokhzad-41/+0
also refactor `FnKind` and `visit_assoc_item` visitors
2020-02-05parse_ty_common: use `enum`s instead of `bool`s.Mazdak Farrokhzad-4/+5