about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2022-03-02Address review commentsxFrednet-2/+6
2022-03-02Added `panics` for unreachable states for expectations (RFC 2383)xFrednet-12/+16
2022-03-02Expect each lint in attribute individually (RFC-2383)xFrednet-5/+11
2022-03-02Make `LintExpectationId` stable between compilation sessions (RFC-2383)xFrednet-2/+48
2022-03-02Set `LintExpectationId` in level and collect fulfilled ones (RFC-2383)xFrednet-1/+18
* Collect lint expectations and set expectation ID in level (RFC-2383) * Collect IDs of fulfilled lint expectations from diagnostics (RFC 2383)
2022-03-02Added `Expect` lint level and attribute (RFC-2383)xFrednet-2/+12
* Also added the `LintExpectationId` which will be used in future commits
2022-03-02rename ErrorReported -> ErrorGuaranteedmark-10/+10
2022-02-25Switch bootstrap cfgsMark Rousskov-1/+1
2022-02-23rustc_errors: let `DiagnosticBuilder::emit` return a "guarantee of emission".Eduard-Mihai Burtescu-21/+35
2022-02-23rustc_errors: take `self` by value in `DiagnosticBuilder::cancel`.Eduard-Mihai Burtescu-7/+1
2022-02-23rustc_errors: remove `struct_dummy`.Eduard-Mihai Burtescu-8/+0
2022-02-23rustc_errors: handle `force_warn` only through `DiagnosticId::Lint`.Eduard-Mihai Burtescu-28/+6
2022-02-23Replace `&mut DiagnosticBuilder`, in signatures, with `&mut Diagnostic`.Eduard-Mihai Burtescu-2/+3
2022-02-23rustc_errors: add `downgrade_to_delayed_bug` to `Diagnostic` itself.Eduard-Mihai Burtescu-21/+54
2022-02-01add a rustc::query_stability lintlcnr-0/+1
2022-01-24rustc_errors: add a new assert for the size of `PResult<()>`.Eduard-Mihai Burtescu-0/+2
2022-01-24rustc_errors: only box the `diagnostic` field in `DiagnosticBuilder`.Eduard-Mihai Burtescu-2/+2
2022-01-23Rollup merge of #93229 - mark-i-m:noquiet, r=eddybMatthias Krüger-16/+1
Remove DiagnosticBuilder.quiet r? `@eddyb` cc https://github.com/rust-lang/rust/issues/69426 `@GuillaumeGomez` `@Manishearth`
2022-01-23Remove DiagnosticBuilder.quietmark-16/+1
2022-01-22Make `Decodable` and `Decoder` infallible.Nicholas Nethercote-2/+2
`Decoder` has two impls: - opaque: this impl is already partly infallible, i.e. in some places it currently panics on failure (e.g. if the input is too short, or on a bad `Result` discriminant), and in some places it returns an error (e.g. on a bad `Option` discriminant). The number of places where either happens is surprisingly small, just because the binary representation has very little redundancy and a lot of input reading can occur even on malformed data. - json: this impl is fully fallible, but it's only used (a) for the `.rlink` file production, and there's a `FIXME` comment suggesting it should change to a binary format, and (b) in a few tests in non-fundamental ways. Indeed #85993 is open to remove it entirely. And the top-level places in the compiler that call into decoding just abort on error anyway. So the fallibility is providing little value, and getting rid of it leads to some non-trivial performance improvements. Much of this commit is pretty boring and mechanical. Some notes about a few interesting parts: - The commit removes `Decoder::{Error,error}`. - `InternIteratorElement::intern_with`: the impl for `T` now has the same optimization for small counts that the impl for `Result<T, E>` has, because it's now much hotter. - Decodable impls for SmallVec, LinkedList, VecDeque now all use `collect`, which is nice; the one for `Vec` uses unsafe code, because that gave better perf on some benchmarks.
2021-12-14Stabilize iter::zip.PFPoitras-1/+0
2021-12-02Rollup merge of #91394 - Mark-Simulacrum:bump-stage0, r=pietroalbiniMatthias Krüger-1/+0
Bump stage0 compiler r? `@pietroalbini` (or anyone else)
2021-12-01Include lint errors in error count for `-Ztreat-err-as-bug`Joshua Nelson-2/+7
This was a regression from https://github.com/rust-lang/rust/pull/87337; the `panic_if_treat_err_as_bug` function only checked the number of hard errors, not the number of lint errors.
2021-11-30Apply cfg-bootstrap switchMark Rousskov-1/+0
2021-11-15Stabilize format_args_captureJosh Triplett-1/+1
Works as expected, and there are widespread reports of success with it, as well as interest in it.
2021-11-08Don't abort compilation after giving a lint errorJoshua Nelson-9/+39
The only reason to use `abort_if_errors` is when the program is so broken that either: 1. later passes get confused and ICE 2. any diagnostics from later passes would be noise This is never the case for lints, because the compiler has to be able to deal with `allow`-ed lints. So it can continue to lint and compile even if there are lint errors.
2021-10-28Revert "Add rustc lint, warning when iterating over hashmaps"Mark Rousskov-1/+0
2021-10-24Rollup merge of #89558 - lcnr:query-stable-lint, r=estebankMatthias Krüger-0/+1
Add rustc lint, warning when iterating over hashmaps r? rust-lang/wg-incr-comp
2021-10-19Auto merge of #89933 - est31:let_else, r=michaelwoeristerbors-0/+1
Adopt let_else across the compiler This performs a substitution of code following the pattern: ``` let <id> = if let <pat> = ... { identity } else { ... : ! }; ``` To simplify it to: ``` let <pat> = ... { identity } else { ... : ! }; ``` By adopting the `let_else` feature (cc #87335). The PR also updates the syn crate because the currently used version of the crate doesn't support `let_else` syntax yet. Note: Generally I'm the person who *removes* usages of unstable features from the compiler, not adds more usages of them, but in this instance I think it hopefully helps the feature get stabilized sooner and in a better state. I have written a [comment](https://github.com/rust-lang/rust/issues/87335#issuecomment-944846205) on the tracking issue about my experience and what I feel could be improved before stabilization of `let_else`.
2021-10-16Adopt let_else across the compilerest31-0/+1
This performs a substitution of code following the pattern: let <id> = if let <pat> = ... { identity } else { ... : ! }; To simplify it to: let <pat> = ... { identity } else { ... : ! }; By adopting the let_else feature.
2021-10-15emitter: current substitution can be multi-lineDavid Wood-1/+1
In `splice_lines`, there is some arithmetic to compute the required alignment such that future substitutions in a suggestion are aligned correctly. However, this assumed that the current substitution's span was only on a single line. In circumstances where this was not true, it could result in a arithmetic overflow when the substitution's end column was less than the substitution's start column. Signed-off-by: David Wood <david.wood@huawei.com>
2021-10-15allow `potential_query_instability` everywherelcnr-0/+1
2021-09-22Rollup merge of #89046 - oli-obk:fix_oflo, r=estebankthe8472-1/+3
"Fix" an overflow in byte position math r? `@estebank` help! I fixed the ICE only to brick the diagnostic. I mean, it was wrong previously (using an already expanded macro span), but it is really bad now XD
2021-09-20Add some more tracingOli Scherer-1/+3
2021-09-20Workaround ICE with if-let and RFC 2229Mark Rousskov-4/+2
2021-09-08Bump stage0 compiler to 1.56Mark Rousskov-1/+0
2021-08-25Use if-let guards in the codebaseLéo Lanteri Thauvin-7/+9
2021-08-23review commentsEsteban Kuber-5/+26
2021-08-23remove unnecessary `info!()` loggingEsteban Kuber-2/+1
2021-08-23Fixes to span locationsEsteban Kuber-2/+1
2021-08-23wipEsteban Kuber-1/+2
2021-08-23Account for tabs when highlighting multiline code suggestionsEsteban Kuber-6/+16
2021-08-11Modify structured suggestion outputEsteban Küber-7/+76
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-08-05Remove warnings/errors from compiler when using typeck_body in rustdoc span ↵Guillaume Gomez-1/+16
map builder
2021-07-11Simplify future incompatible reporting.Eric Huss-2/+1
2021-07-06Auto merge of #86572 - rylev:force-warnings-always, r=nikomatsakisbors-2/+31
Force warnings even when can_emit_warnings == false Fixes an issue mentioned in #85512 with --cap-lints overriding --force-warnings. Fixes https://github.com/rust-lang/rust/issues/86751 r? `@ehuss`
2021-07-06Add missing docs and remove dead codeRyan Levick-2/+10
2021-07-01New force_warn diagnostic builder and ensure cap-lints doesn't reduce ↵Ryan Levick-0/+18
force_warn level
2021-06-30Force warnings even when can_emit_warnings == falseRyan Levick-2/+5
2021-06-28Update to new bootstrap compilerMark Rousskov-1/+0