about summary refs log tree commit diff
path: root/src/librustc_parse
AgeCommit message (Collapse)AuthorLines
2020-05-03Implement `confusable_idents` lint.Charles Lew-1/+2
2020-04-30Rollup merge of #71433 - antoyo:error/missing-right-operand, r=Dylan-DPCDylan DPC-0/+5
Add help message for missing right operand in condition closes #30035
2020-04-24Avoid unused Option::map resultsJosh Stone-2/+2
These are changes that would be needed if we add `#[must_use]` to `Option::map`, per #71484.
2020-04-23Rollup merge of #70633 - kper:master, r=estebankDylan DPC-6/+35
Confusing suggestion on incorrect closing `}` Compiler returns ``` error: unexpected closing delimiter: `}` --> main.rs:20:1 | 9 | ErrorHandled::Reported => {} | -- this block is empty, you might have not meant to close it temp ... 20 | } | ^ unexpected closing delimiter error: aborting due to previous error ```
2020-04-22Rollup merge of #71256 - cuviper:must_use_replace, r=estebankDylan DPC-9/+8
Lint must_use on mem::replace This adds a hint on `mem::replace`, "if you don't need the old value, you can just assign the new value directly". This is in similar spirit to the `must_use` on `ManuallyDrop::take`.
2020-04-22Add help message for missing right operand in conditionAntoni Boucher-0/+5
2020-04-22Add error code to inner doc comment attribute errorGuillaume Gomez-3/+9
2020-04-20Remove unused dependenciesShotaro Yamada-1/+0
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-9/+7
2020-04-18remove build warningsTshepang Lekhonkhobe-3/+5
Code blocks that are not annotated are assumed to be Rust
2020-04-17Fix unused results from mem::replaceJosh Stone-9/+8
2020-04-17Improved try_macro_suggestion functionDuddino-4/+2
2020-04-17Improved try_macro_suggestionDuddino-4/+5
2020-04-17Moved is_try check into try_macro_suggestionDuddino-4/+3
2020-04-17Account for use of `try!()` in 2018 edition and guide users in the right ↵Duddino-0/+35
direction
2020-04-14allow try as scrutinee, e.g. `match try ...`Bastian Kauschke-5/+3
2020-04-04Run fmtKevin Per-31/+16
2020-04-04Drop `this` in error message to not reach 100 charactersKevin Per-1/+1
2020-04-04Show open and closed braces of last proper blockKevin Per-9/+39
2020-04-03Fixing testsKevin Per-1/+0
2020-04-03.unwrap() less on .span_to_snippet()Mazdak Farrokhzad-3/+3
2020-04-02Rollup merge of #70421 - Centril:recover-const-async-fn-ptr, r=estebankMazdak Farrokhzad-18/+30
parse: recover on `const fn()` / `async fn()` Recover on `const fn()` and `async fn()` function pointers, suggesting to remove the qualifier. For example: ``` error: an `fn` pointer type cannot be `async` --> $DIR/recover-const-async-fn-ptr.rs:6:11 | LL | type T3 = async fn(); | -----^^^^^ | | | `async` because of this | help: remove the `async` qualifier ``` r? @estebank
2020-04-02Check if the suggestion's `this block is empty...` span is in the last ↵Kevin Per-4/+19
properly closed block.
2020-04-01Rollup merge of #70522 - rcoh:60762-raw-string-errors, r=petrochenkovMazdak Farrokhzad-37/+90
Improve error messages for raw strings (#60762) 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) Fixes #60762 cc @estebank who reviewed the original (abandoned) PR for the same ticket. r? @Centril
2020-04-01Revert "Dropping "block is empty..." error message on incorrect closing ↵Kevin Per-3/+7
delimiter #70583" This reverts commit 811d817eaf5d78522773ab9d21543629027e4ecb.
2020-04-01Rollup merge of #70556 - Centril:fix-70552, r=estebankDylan DPC-0/+1
parse_and_disallow_postfix_after_cast: account for `ExprKind::Err`. Fixes https://github.com/rust-lang/rust/issues/70552. r? @estebank cc @daboross
2020-03-31Dropping "block is empty..." error message on incorrect closing delimiter #70583Kevin Per-7/+3
2020-03-30Clean up redudant conditions and match exprsRussell Cohen-11/+10
2020-03-30remove obsolete commentTshepang Lekhonkhobe-3/+0
Made obsolete by b5e35b128efeed4bfdb4b1ee9d0697389ec9f164
2020-03-30parse_and_disallow_postfix_after_cast: account for `ExprKind::Err`.Mazdak Farrokhzad-0/+1
2020-03-29Cleanup match expressionRussell Cohen-11/+7
2020-03-29Cleanup error messages, improve docstringsRussell Cohen-9/+12
2020-03-29reduce rustc_attr usage in placesMazdak Farrokhzad-1/+0
2020-03-29Improve error messages for raw strings (#60762)Russell Cohen-35/+90
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-27address some review commentsMazdak Farrokhzad-6/+8
2020-03-27parse: improve recovery for assoc eq constraints.Mazdak Farrokhzad-1/+43
2020-03-27extract parse_generic_argMazdak Farrokhzad-8/+14
2020-03-27parse_angle_arg: parse constraints firstMazdak Farrokhzad-4/+4
2020-03-27split parse_angle_args into loop / single stepMazdak Farrokhzad-63/+67
2020-03-27parse: move constraint/arg restriction to ast_validation.Mazdak Farrokhzad-53/+23
2020-03-26Rollup merge of #70428 - Centril:move-to-mod, r=petrochenkovDylan DPC-2/+4
`error_bad_item_kind`: add help text For example, this adds: ``` = help: consider moving the `use` import out to a nearby module scope ``` r? @petrochenkov @estebank Fixes https://github.com/rust-lang/rust/issues/37205.
2020-03-26error_bad_item_kind: add help textMazdak Farrokhzad-2/+4
2020-03-26parse: recover on `const fn()` / `async fn()`.Mazdak Farrokhzad-18/+30
2020-03-26Throw error when encountering `...` instead of `..` while destructing a patternRakshith Ravi-0/+21
Added tests and stderr output
2020-03-26Rollup merge of #69878 - estebank:chained-ops, r=CentrilMazdak Farrokhzad-52/+103
Tweak chained operators diagnostic Use more selective spans Improve suggestion output Be more selective when displaying suggestions Silence some knock-down type errors r? @Centril
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-25Rename `def_span` to `guess_head_span`Esteban Küber-1/+1
2020-03-23Rollup merge of #70248 - Centril:unroot, r=petrochenkovMazdak Farrokhzad-23/+5
parser: simplify & remove unused field r? @petrochenkov
2020-03-22Rollup merge of #70254 - matthiaskrgr:cl4ppy, r=CentrilDylan DPC-15/+5
couple more clippy fixes (let_and_return, if_same_then_else) * summarize if-else-code with identical blocks (clippy::if_same_then_else) * don't create variable bindings just to return the bound value immediately (clippy::let_and_return)