about summary refs log tree commit diff
path: root/compiler/rustc_errors
AgeCommit message (Collapse)AuthorLines
2022-08-17Reenable early feature-gates as future-compat warningsChristopher Durham-0/+1
2022-08-17Don't treat stashed warnings as errorsChristopher Durham-12/+62
2022-08-17Rollup merge of #100379 - davidtwco:triagebot-diag, r=Mark-SimulacrumMatthias Krüger-126/+144
triagebot: add translation-related mention groups - Move some code around so that triagebot can ping relevant parties when translation logic is modified. - Add mention groups to triagebot for translation-related files/folders. - Auto-label pull requests with changes to translation-related files/folders with `A-translation`. r? `@Mark-Simulacrum`
2022-08-16Rollup merge of #100590 - TaKO8Ki:suggest-adding-array-length, r=compiler-errorsMatthias Krüger-0/+1
Suggest adding an array length if possible fixes #100448
2022-08-16suggest adding an array length if possibleTakayuki Maeda-0/+1
2022-08-15errors: move translation logic into moduleDavid Wood-126/+144
Just moving code around so that triagebot can ping relevant parties when translation logic is modified. Signed-off-by: David Wood <david.wood@huawei.com>
2022-08-12Adjust cfgsMark Rousskov-1/+0
2022-08-10errors: don't fail on broken primary translationsDavid Wood-32/+51
If a primary bundle doesn't contain a message then the fallback bundle is used. However, if the primary bundle's message is broken (e.g. it refers to a interpolated variable that the compiler isn't providing) then this would just result in a compiler panic. While there aren't any primary bundles right now, this is the type of issue that could come up once translation is further along. Signed-off-by: David Wood <david.wood@huawei.com>
2022-08-10Rollup merge of #99573 - tbodt:stabilize-backtrace, r=yaahcMatthias Krüger-1/+0
Stabilize backtrace This PR stabilizes the std::backtrace module. As of #99431, the std::Error::backtrace item has been removed, and so the rest of the backtrace feature is set to be stabilized. Previous discussion can be found in #72981, #3156. Stabilized API summary: ```rust pub mod std { pub mod backtrace { pub struct Backtrace { } pub enum BacktraceStatus { Unsupported, Disabled, Captured, } impl fmt::Debug for Backtrace {} impl Backtrace { pub fn capture() -> Backtrace; pub fn force_capture() -> Backtrace; pub const fn disabled() -> Backtrace; pub fn status(&self) -> BacktraceStatus; } impl fmt::Display for Backtrace {} } } ``` `@yaahc`
2022-08-07Rollup merge of #100071 - klensy:annotate-snippets-bump, r=Mark-SimulacrumMatthias Krüger-2/+6
deps: dedupe `annotate-snippets` crate versions Dedupes `annotate-snippets` crate versions (https://github.com/rust-lang/annotate-snippets-rs/blob/0.9.1/CHANGELOG.md). Should work, but there is not a lot of tests. Looks like switching to that crate a bit stalled.
2022-08-05move DiagnosticArgFromDisplay into rustc_errorsMichael Goulet-2/+22
2022-08-02Stabilize backtraceTheodore Dubois-1/+0
2022-08-02never consider unsafe blocks unused if they would be required with ↵Ralf Jung-1/+1
unsafe_op_in_unsafe_fn
2022-08-02dedupe 'annotate-snippets' crate versionsklensy-2/+6
2022-07-20Auto merge of #99058 - michaelwoerister:remove-stable-set-and-map, r=nagisabors-1/+1
Remove the unused StableSet and StableMap types from rustc_data_structures. The current implementation is not "stable" in the same sense that `HashStable` and `StableHasher` are stable, i.e. across compilation sessions. So, in my opinion, it's better to remove those types (which are basically unused anyway) than to give the wrong impression that these are safe for incr. comp. I plan to provide new "stable" collection types soon that can be used to replace `FxHashMap` and `FxHashSet` in query results (see [draft](https://github.com/michaelwoerister/rust/commit/69d03ac7a7d651a397ab793e9d78f8fce3edf7a6)). It's unsound that `HashMap` and `HashSet` implement `HashStable` (see https://github.com/rust-lang/rust/issues/98890 for a recent P-critical bug caused by this) -- so we should make some progress there.
2022-07-20Remove unused StableMap and StableSet types from rustc_data_structuresMichael Woerister-1/+1
2022-07-20avoid `&str` to String conversionsTakayuki Maeda-8/+7
2022-07-19Mention first and last macro in backtraceMichael Goulet-6/+19
2022-07-16Rollup merge of #99342 - TaKO8Ki:avoid-symbol-to-string-conversions, ↵Matthias Krüger-1/+1
r=compiler-errors Avoid some `Symbol` to `String` conversions This patch removes some Symbol to String conversions.
2022-07-17avoid some `Symbol` to `String` conversionsTakayuki Maeda-1/+1
2022-07-15passes: migrate half of `check_attr`David Wood-0/+1
Migrate half of the `rustc_passes::check_attr` diagnostics to using diagnostic derives and being translatable.
2022-07-15errors: lint on `LintDiagnosticBuilder::build`David Wood-0/+1
Apply the `#[rustc_lint_diagnostics]` attribute to `LintDiagnosticBuilder::build` so that diagnostic migration lints will trigger for it. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-15errors: impl `IntoDiagnosticArg` for `char`David Wood-77/+33
Implements `IntoDiagnosticArg` for `char` using its `Debug` implementation and introduces a macro for those types which just delegate the implementation to `ToString`. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-11Rollup merge of #99075 - danobi:dup_type_hint_sugg, r=petrochenkovMatthias Krüger-0/+9
Fix duplicated type annotation suggestion Before, there was more or less duplicated suggestions to add type hints. Fix by clearing more generic suggestions when a more specific suggestion is possible. This fixes #93506 .
2022-07-11rename a methodTakayuki Maeda-1/+1
2022-07-11implement `is_accessible_span`Takayuki Maeda-1/+1
2022-07-08Fix duplicated type annotation suggestionDaniel Xu-0/+9
Before, there was more or less duplicated suggestions to add type hints. Fix by clearing more generic suggestions when a more specific suggestion is possible. This fixes #93506 .
2022-07-08Rollup merge of #98657 - ↵Dylan DPC-0/+12
compiler-errors:rustc-const-eval-session-diagnostic-1, r=davidtwco Migrate some diagnostics from `rustc_const_eval` to `SessionDiagnostic` I'm still trying to get the hang of this, so it doesn't migrate _all_ of `rustc_const_eval`. Working on that later. r? `@davidtwco`
2022-07-08Rollup merge of #95635 - davidtwco:terminal-width-stabilization, r=oli-obkMatthias Krüger-16/+16
sess: stabilize `--terminal-width` as `--diagnostic-width` Formerly `-Zterminal-width`, `--terminal-width` allows the user or build tool to inform rustc of the width of the terminal so that diagnostics can be truncated. Pending agreement to stabilize, see tracking issue at #84673. r? ```@oli-obk```
2022-07-08Implement IntoDiagnosticArg for hir::ConstContextMichael Goulet-0/+12
2022-07-06session: `output-width` -> `diagnostic-width`David Wood-16/+16
Rename the `--output-width` flag to `--diagnostic-width` as this appears to be the preferred name within the compiler team. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-06session: `terminal-width` -> `output-width`David Wood-16/+16
Rename the `--terminal-width` flag to `--output-width` as the behaviour doesn't just apply to terminals (and so is slightly less accurate). Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-05errors: introduce `DecorateLint`David Wood-3/+11
Add a new trait to be generated by diagnostic derives which uses a `LintDiagnosticBuilder`. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-05lint: `LintDiagnosticBuilder` into `rustc_errors`David Wood-1/+24
Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-05Rollup merge of #98624 - davidtwco:translation-on-lints, r=compiler-errorsDylan DPC-2/+84
lints: mostly translatable diagnostics As lints are created slightly differently than other diagnostics, intended to try make them translatable first and then look into the applicability of diagnostic structs but ended up just making most of the diagnostics in the crate translatable (which will still be useful if I do make a lot of them structs later anyway). r? ``@compiler-errors``
2022-07-03Auto merge of #98673 - pietroalbini:pa-bootstrap-update, r=Mark-Simulacrumbors-29/+29
Bump bootstrap compiler r? `@Mark-Simulacrum`
2022-07-01update cfg(bootstrap)sPietro Albini-29/+29
2022-06-30Rollup merge of #98695 - tshepang:or-pattern, r=compiler-errorsMatthias Krüger-1/+1
use "or pattern"
2022-06-30lint: port incomplete features diagnosticsDavid Wood-0/+6
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port keyword idents diagnosticsDavid Wood-1/+7
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port variant size difference diagnosticsDavid Wood-0/+48
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port overflowing literals diagnosticsDavid Wood-0/+12
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30lint: port non-fmt-panic diagnosticsDavid Wood-0/+10
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30middle: translation in `LintDiagnosticBuilder`David Wood-1/+1
Accept `DiagnosticMessage` in `LintDiagnosticBuilder::build` so that lints can be built with translatable diagnostic messages. Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-30use "or pattern"Tshepang Mbambo-1/+1
2022-06-28Migrate some rustc_borrowck diagnostics to SessionDiagnosticMichael Goulet-2/+12
2022-06-20remove MAX_SUGGESTION_HIGHLIGHT_LINESMaybe Waffle-5/+0
2022-06-17Auto merge of #97892 - klensy:fix-spaces, r=oli-obkbors-4/+8
diagnostics: remove trailing spaces Remove few occurrences of trailing spaces and drive by fix of needless alloc of const string.
2022-06-17Rollup merge of #97798 - ↵Dylan DPC-77/+170
WaffleLapkin:allow_for_suggestions_that_are_quite_far_away_from_each_other, r=estebank Hide irrelevant lines in suggestions to allow for suggestions that are far from each other to be shown This is an attempt to fix suggestions one part of which is 6 lines or more far from the first. I've noticed "the problem" (of not showing some parts of the suggestion) here: https://github.com/rust-lang/rust/pull/97759#discussion_r889689230. I'm not sure about the implementation (this big closure is just bad and makes already complicated code even more so), but I want to at least discuss the result. Here is an example of how this changes the output: Before: ```text help: consider enclosing expression in a block | 3 ~ 'l: { match () { () => break 'l, 4 | 5 | 6 | 7 | 8 | ... ``` After: ```text help: consider enclosing expression in a block | 3 ~ 'l: { match () { () => break 'l, 4 | ... 31| 32~ } }; | ``` r? `@estebank` `@rustbot` label +A-diagnostics +A-suggestion-diagnostics
2022-06-16Add back MAX_SUGGESTION_HIGHLIGHT_LINES so clippy is happy & buildableMaybe Waffle-0/+5