| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2022-04-30 | Add `do yeet` expressions to allow experimentation in nightly | Scott McMurray | -0/+21 | |
| Using an obviously-placeholder syntax. An RFC would still be needed before this could have any chance at stabilization, and it might be removed at any point. But I'd really like to have it in nightly at least to ensure it works well with try_trait_v2, especially as we refactor the traits. | ||||
| 2022-04-29 | errors: `span_suggestion` takes `impl ToString` | David Wood | -3/+3 | |
| Change `span_suggestion` (and variants) to take `impl ToString` rather than `String` for the suggested code, as this simplifies the requirements on the diagnostic derive. Signed-off-by: David Wood <david.wood@huawei.com> | ||||
| 2022-04-28 | rustc_ast: Harmonize delimiter naming with `proc_macro::Delimiter` | Vadim Petrochenkov | -44/+46 | |
| 2022-04-27 | Avoid producing `NoDelim` values in `TokenCursorFrame`. | Nicholas Nethercote | -1/+2 | |
| 2022-04-07 | Shrink `Nonterminal`. | Nicholas Nethercote | -1/+1 | |
| By heap allocating the argument within `NtPath`, `NtVis`, and `NtStmt`. This slightly reduces cumulative and peak allocation amounts, most notably on `deep-vector`. | ||||
| 2022-04-05 | errors: implement fallback diagnostic translation | David Wood | -2/+2 | |
| This commit updates the signatures of all diagnostic functions to accept types that can be converted into a `DiagnosticMessage`. This enables existing diagnostic calls to continue to work as before and Fluent identifiers to be provided. The `SessionDiagnostic` derive just generates normal diagnostic calls, so these APIs had to be modified to accept Fluent identifiers. In addition, loading of the "fallback" Fluent bundle, which contains the built-in English messages, has been implemented. Each diagnostic now has "arguments" which correspond to variables in the Fluent messages (necessary to render a Fluent message) but no API for adding arguments has been added yet. Therefore, diagnostics (that do not require interpolation) can be converted to use Fluent identifiers and will be output as before. | ||||
| 2022-04-03 | Auto merge of #88672 - camelid:inc-parser-sugg, r=davidtwco | bors | -0/+24 | |
| Suggest `i += 1` when we see `i++` or `++i` Closes #83502 (for `i++` and `++i`; `--i` should be covered by #82987, and `i--` is tricky to handle). This is a continuation of #83536. r? `@estebank` | ||||
| 2022-04-01 | Rollup merge of #95293 - compiler-errors:braces, r=davidtwco | Matthias Krüger | -11/+7 | |
| suggest wrapping single-expr blocks in square brackets Suggests a fix in cases like: ```diff - const A: [i32; 1] = { 1 }; + const A: [i32; 1] = [ 1 ]; ^ ^ ``` Also edit the message for the same suggestion in the parser (e.g. `{ 1, 2 }`). Fixes #95289 | ||||
| 2022-03-30 | Addressed comments by @compiler-errors and @bjorn3 | Yuri Astrakhan | -1/+1 | |
| 2022-03-30 | Spellchecking compiler comments | Yuri Astrakhan | -1/+1 | |
| This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues. | ||||
| 2022-03-24 | suggest wrapping single-expr blocks in square brackets | Michael Goulet | -11/+7 | |
| 2022-03-23 | Add heuristic to avoid treating `x + +2` as increment | Noah Lev | -0/+1 | |
| 2022-03-23 | Improve function names | Noah Lev | -2/+2 | |
| 2022-03-23 | Emit both subexp and standalone sugg for postfix | Noah Lev | -3/+1 | |
| This solves the TODO. | ||||
| 2022-03-23 | Refactor, handle fields better, add field tests | Noah Lev | -8/+8 | |
| 2022-03-23 | Move increment checks to improve errors | Noah Lev | -0/+25 | |
| 2022-03-18 | suggest removing type ascription in bad position | Michael Goulet | -6/+35 | |
| 2022-03-18 | use `self.create_snapshot_for_diagnostic` instead of `self.clone()` | Takayuki Maeda | -5/+6 | |
| 2022-03-17 | Rollup merge of #94731 - TaKO8Ki:const-generic-expr-recovery, ↵ | Dylan DPC | -11/+11 | |
| r=davidtwco,oli-obk Suggest adding `{ .. }` around a const function call with arguments closes #91020 | ||||
| 2022-03-15 | use `format_args_capture` in some parts of rustc_parse | Takayuki Maeda | -18/+18 | |
| 2022-03-10 | replace `self.clone()` with `self.create_snapshot_for_diagnostic()` | Takayuki Maeda | -11/+11 | |
| 2022-03-07 | diagnostics: only talk about `Cargo.toml` if running under Cargo | Michael Howell | -3/+1 | |
| Fixes #94646 | ||||
| 2022-03-02 | rename ErrorReported -> ErrorGuaranteed | mark | -3/+3 | |
| 2022-02-28 | Tweak diagnostics | Esteban Kuber | -10/+46 | |
| * Recover from invalid `'label: ` before block. * Make suggestion to enclose statements in a block multipart. * Point at `match`, `while`, `loop` and `unsafe` keywords when failing to parse their expression. * Do not suggest `{ ; }`. * Do not suggest `|` when very unlikely to be what was wanted (in `let` statements). | ||||
| 2022-02-25 | Rollup merge of #94344 - notriddle:notriddle/suggest-parens-more, r=oli-obk | Matthias Krüger | -2/+16 | |
| diagnostic: suggest parens when users want logical ops, but get closures Fixes #93536 | ||||
| 2022-02-24 | diagnostic: suggest parens when users want logical ops, but get closures | Michael Howell | -2/+16 | |
| 2022-02-23 | rustc_errors: let `DiagnosticBuilder::emit` return a "guarantee of emission". | Eduard-Mihai Burtescu | -4/+7 | |
| 2022-02-23 | rustc_errors: take `self` by value in `DiagnosticBuilder::cancel`. | Eduard-Mihai Burtescu | -9/+10 | |
| 2022-02-23 | rustc_errors: remove `struct_dummy`. | Eduard-Mihai Burtescu | -3/+5 | |
| 2022-02-23 | Replace `&mut DiagnosticBuilder`, in signatures, with `&mut Diagnostic`. | Eduard-Mihai Burtescu | -2/+2 | |
| 2022-02-19 | Adopt let else in more places | est31 | -3/+2 | |
| 2022-02-12 | Rollup merge of #93595 - compiler-errors:ice-on-lifetime-arg, r=jackh726 | Matthias Krüger | -3/+3 | |
| fix ICE when parsing lifetime as function argument I don't really like this, but we basically need to emit an error instead of just delaying an bug, because there are too many places in the AST that aren't covered by my previous PRs... cc: https://github.com/rust-lang/rust/issues/93282#issuecomment-1028052945 | ||||
| 2022-02-03 | clippy::perf fixes | Matthias Krüger | -3/+3 | |
| single_char_pattern and to_string_in_format_args | ||||
| 2022-02-02 | fix ICE when parsing lifetime as function argument | Michael Goulet | -3/+3 | |
| 2022-01-31 | Write UI tests, tweak message | 5225225 | -3/+2 | |
| 2022-01-27 | Suggest making base prefix lowercase if parsing fails | 5225225 | -0/+26 | |
| 2022-01-25 | delay the bug once again, generalize turbofish suggestion | Michael Goulet | -4/+3 | |
| 2022-01-25 | Remove delayed bug when encountering label in bad turbofish | Michael Goulet | -2/+3 | |
| 2022-01-22 | Fix let_chains and if_let_guard feature flags | Caio | -3/+17 | |
| 2022-01-17 | Rollup merge of #92876 - compiler-errors:fix-turbofish-lifetime-suggestion, ↵ | Matthias Krüger | -1/+7 | |
| r=nagisa Fix suggesting turbofish with lifetime arguments Now we suggest turbofish correctly given exprs like `foo<'_>`. Also fix suggestion when we have `let x = foo<bar, baz>;` which was broken. | ||||
| 2022-01-13 | Fix suggesting turbofish with lifetime arguments | Michael Goulet | -1/+7 | |
| 2022-01-14 | Parse `Ty?` as `Option<Ty>` and provide structured suggestion | Esteban Kuber | -2/+2 | |
| Swift has specific syntax that desugars to `Option<T>` similar to our `?` operator, which means that people might try to use it in Rust. Parse it and gracefully recover. | ||||
| 2021-12-19 | Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk | bors | -4/+6 | |
| Remove `SymbolStr` This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences. Best reviewed one commit at a time. r? `@oli-obk` | ||||
| 2021-12-15 | Remove unnecessary sigils around `Symbol::as_str()` calls. | Nicholas Nethercote | -2/+2 | |
| 2021-12-14 | Stabilize `destructuring_assignment` | Jacob Pratt | -2/+0 | |
| 2021-12-15 | Remove `SymbolStr`. | Nicholas Nethercote | -2/+4 | |
| By changing `as_str()` to take `&self` instead of `self`, we can just return `&str`. We're still lying about lifetimes, but it's a smaller lie than before, where `SymbolStr` contained a (fake) `&'static str`! | ||||
| 2021-12-14 | Rollup merge of #91597 - r00ster91:lessthangreaterthan, r=oli-obk | Matthias Krüger | -1/+33 | |
| Recover on invalid operators `<>` and `<=>` Thanks to #89871 for showing me how to do this. Next, I think it'd be nice to recover on `<=>` too, like #89871 intended, if this even works. | ||||
| 2021-12-14 | Recover on invalid operators <> and <=> | r00ster91 | -1/+33 | |
| 2021-12-08 | Do not attempt to suggest help for overly malformed struct/function call | threadexception | -20/+27 | |
| 2021-12-01 | Improve diagnostic for missing half of binary operator in `if` condition | Fabian Wolff | -10/+41 | |
