summary refs log tree commit diff
path: root/compiler/rustc_errors/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2025-02-14Trim suggestion parts to the subset that is purely additiveMichael Goulet-0/+18
2025-02-14Consider add-prefix replacements tooMichael Goulet-3/+4
2025-02-14Use underline suggestions for purely 'additive' replacementsMichael Goulet-0/+11
2025-02-06Avoid manually producing FatalError in a couple of placesbjorn3-2/+2
2025-02-02Rollup merge of #136445 - bjorn3:diag_ctxt_cleanup, r=oli-obkMatthias Krüger-33/+20
Couple of cleanups to DiagCtxt and EarlyDiagCtxt
2025-02-02Replace ParseSess::set_dcx with DiagCtxt::set_emitterbjorn3-0/+4
Replacing the error emitter doesn't accidentally clear the error count.
2025-02-02Use fallback fluent bundle from inner emitter in SilentEmitterbjorn3-7/+1
2025-02-02Slightly simplify DiagCtxt::make_silentbjorn3-27/+16
2025-01-31Make comma separated lists of anything easier to make for errorsEsteban Küber-13/+1
Provide a new function `listify`, meant to be used in cases similar to `pluralize!`. When you have a slice of arbitrary elements that need to be presented to the user, `listify` allows you to turn that into a list of comma separated strings. This reduces a lot of redundant logic that happens often in diagnostics.
2025-01-19Manual cleanup of some `is_{or_none|some_and}` usagesYotam Ofek-1/+2
2025-01-19Run `clippy --fix` for `unnecessary_map_or` lintYotam Ofek-1/+1
2025-01-11Remove a bunch of diagnostic stashing that doesn't do anythingMichael Goulet-2/+0
2024-12-16update uses of extract_if in the compilerThe 8472-4/+4
2024-12-12Rollup merge of #134187 - nnethercote:rm-PErr, r=jieyouxuMatthias Krüger-2/+1
Remove `PErr`. It's just a synonym for `Diag` that adds no value and is only used in a few places. r? ``@spastorino``
2024-12-12Rollup merge of #134154 - dev-ardi:field-expr-generics, r=compiler-errorsMatthias Krüger-0/+4
suppress field expr with generics error message if it's a method Don't emit "field expressions may not have generic arguments" if it's a method call without `()` r? estebank Fixes #67680 Is this the best way to go? It's by far the simplest I could come up with.
2024-12-12Remove `PErr`.Nicholas Nethercote-2/+1
It's just a synonym for `Diag` that adds no value and is only used in a few places.
2024-12-11Don't emit "field expressions may not have generic arguments" if it's a ↵Orion Gonzalez-0/+4
method call without ()
2024-12-11document check_expr_fieldOrion Gonzalez-1/+1
2024-12-06Handle unwinding out of the closure argument of run_compiler with pending ↵bjorn3-3/+7
delayed bugs
2024-12-06Store a single copy of the error registry in DiagCtxtbjorn3-7/+17
And pass this to the individual emitters when necessary.
2024-11-12clarify `must_produce_diag` ICE for debuggingRémy Rakic-3/+16
2024-10-07Rollup merge of #131344 - nnethercote:ref-Lrc, r=compiler-errorsMatthias Krüger-3/+3
Avoid `&Lrc<T>` in various places Seeing `&Lrc<T>` is a bit suspicious, and `&T` or `Lrc<T>` is often better. r? `@oli-obk`
2024-10-07Convert `Option<&Lrc<T>>` return types to `Option<&T>`.Nicholas Nethercote-3/+3
It's simpler and more concise.
2024-10-07Remove `InferCtxt::err_count_on_creation`.Nicholas Nethercote-12/+0
It's no longer used meaningfully. This also means `DiagCtxtHandle::err_count_excluding_lint_errs` can be removed.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-8/+8
2024-09-18Add suggestions for expressions in patternsLieselotte-0/+2
2024-09-12Implement a Method to Seal `DiagInner`'s SuggestionsVeera-0/+35
2024-09-07Do not ICE on expect(warnings).Camille GILLOT-12/+5
2024-09-06Check AttrId for expectations.Camille GILLOT-86/+15
2024-09-02Rollup merge of #129875 - Sajjon:sajjon_fix_typos_batch_1, ↵Matthias Krüger-1/+1
r=compiler-errors,jieyouxu chore: Fix typos in 'compiler' (batch 1) Batch 1/3: Fixes typos in `compiler` (See [issue](https://github.com/rust-lang/rust/issues/129874) tracking all PRs with typos fixes)
2024-09-02chore: Fix typos in 'compiler' (batch 1)Alexander Cyon-1/+1
2024-08-31Remove attr_id from stable lint ids.Camille GILLOT-1/+1
2024-08-31Use AttrId key for unstable<->stable expectation map.Camille GILLOT-5/+5
2024-08-27Add `warn(unreachable_pub)` to `rustc_errors`.Nicholas Nethercote-2/+3
2024-08-14Add `|` to make the html doc of `Level` rendered correctlyJaic1-16/+16
2024-08-12Rollup merge of #128978 - compiler-errors:assert-matches, r=jieyouxuGuillaume Gomez-1/+3
Use `assert_matches` around the compiler more It's a useful assertion, especially since it actually prints out the LHS.
2024-08-11Use assert_matches around the compilerMichael Goulet-1/+3
2024-08-07Use more slice patterns inside the compilerLeón Orell Valerian Liehr-5/+5
2024-08-01Do not underline suggestions for code that is already thereEsteban Küber-6/+16
When a suggestion part is for already present code, do not highlight it. If after that there are no highlights left, do not show the suggestion at all. Fix clippy lint suggestion incorrectly treated as `span_help`.
2024-07-29Reformat `use` declarations.Nicholas Nethercote-24/+21
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-23Rollup merge of #126994 - Alexendoo:explain-markdown, r=tgross35Matthias Krüger-0/+1
Support lists and stylings in more places for `rustc --explain` Adds support for `*foo*`, stylings not immediately following whitespace e.g. ``(`Foo`)`` and lists starting with whitespace: ```md * previously supported ``` ```md * now also supported ``` These are fairly common in the existing error docs, some before/after examples: ### E0460 ![image](https://github.com/rust-lang/rust/assets/1830331/4d0dc5dd-b71f-48b1-97ae-9f7199e952ed) ![image](https://github.com/rust-lang/rust/assets/1830331/4bbcb1e4-99ba-4d0d-b338-fe19d96a5eb1) ### E0059 ![image](https://github.com/rust-lang/rust/assets/1830331/8457f69a-3126-4777-aa4a-953f7b29f59b) ![image](https://github.com/rust-lang/rust/assets/1830331/ac2189f8-512e-4b3b-886d-6c4a619d17f2)
2024-07-10Support lists and stylings in more places for `rustc --explain`Alex Macleod-0/+1
2024-06-27Document new field and functionOli Scherer-0/+5
2024-06-26Automatically taint InferCtxt when errors are emittedOli Scherer-20/+41
2024-06-21Fix another assertion failure for some Expect diagnostics.Nicholas Nethercote-4/+4
Very similar to #126719. So much so that I added a new case to the test from that PR rather than creating a new one.
2024-06-20Fix assertion failure for some `Expect` diagnostics.Nicholas Nethercote-9/+19
In #120699 I moved some code dealing with `has_future_breakage` earlier in `emit_diagnostic`. Issue #126521 identified a case where that reordering was invalid (leading to an assertion failure) for some `Expect` diagnostics. This commit partially undoes the change, by moving the handling of unstable `Expect` diagnostics earlier again. This makes `emit_diagnostic` a bit uglier, but is necessary to fix the problem. Fixes #126521.
2024-06-18Use a dedicated type instead of a reference for the diagnostic contextOli Scherer-59/+71
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
2024-05-23Remove `DelayDm`León Orell Valerian Liehr-3/+3
With the removal of `LintDiagnostic::msg` / the `msg` param from lint diag APIs, primary messages for lint diags are always constructed lazily inside decorator fns rendering this wrapper type unused / useless.
2024-04-30Remove `extern crate tracing` from numerous crates.Nicholas Nethercote-3/+1
2024-04-29Remove `extern crate rustc_macros` from numerous crates.Nicholas Nethercote-3/+1