summary refs log tree commit diff
path: root/compiler/rustc_errors
AgeCommit message (Collapse)AuthorLines
2021-11-23`replace_tabs` -> `normalize_whitespace`Esteban Kuber-6/+6
2021-11-23Replace ZWJ with nothing in terminal outputEsteban Kuber-0/+1
2021-11-20Align multiline messages to their label (add left margin)Esteban Kuber-1/+16
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-11/+41
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-31Lint against RTL unicode codepoints in literals and commentsEsteban Küber-1/+19
Address CVE-2021-42574.
2021-10-28Revert "Add rustc lint, warning when iterating over hashmaps"Mark Rousskov-1/+0
2021-10-24Auto merge of #89427 - estebank:collect-overlapping-impls, r=jackh726bors-3/+7
Point at overlapping impls when type annotations are needed Address https://github.com/rust-lang/rust/issues/89254.
2021-10-24Always sort suggestions before emitting themEsteban Kuber-3/+7
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-23Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726Matthias Krüger-4/+17
Report fatal lexer errors in `--cfg` command line arguments Fixes #89358. The erroneous behavior was apparently introduced by `@Mark-Simulacrum` in https://github.com/rust-lang/rust/commit/a678e3191197f145451c97c6cc884e15cae38186; the idea is to silence individual parser errors and instead emit one catch-all error message after parsing. However, for the example in #89358, a fatal lexer error is created here: https://github.com/rust-lang/rust/blob/edebf77e0090195bf80c0d8cda821e1bf9d03053/compiler/rustc_parse/src/lexer/mod.rs#L340-L349 This fatal error aborts the compilation, and so the call to `new_parser_from_source_str()` never returns and the catch-all error message is never emitted. I have therefore changed the `SilentEmitter` to silence only non-fatal errors; with my changes, for the rustc invocation described in #89358: ```sh rustc --cfg "abc\"" ``` I get the following output: ``` error[E0765]: unterminated double quote string | = note: this error occurred on the command line: `--cfg=abc"` ```
2021-10-19Auto merge of #89933 - est31:let_else, r=michaelwoeristerbors-5/+2
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-5/+2
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-10-07use structured fields in some existing warningsEliza Weisman-1/+1
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2021-10-02Report fatal lexer errors in `--cfg` command line argumentsFabian Wolff-4/+17
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-20Migrate to 2021Mark Rousskov-1/+1
2021-09-20Add some more tracingOli Scherer-1/+3
2021-09-20Workaround ICE with if-let and RFC 2229Mark Rousskov-4/+2
2021-09-17Make diagnostics clearer for `?` operatorsYuki Okushi-0/+12
2021-09-13Auto merge of #87915 - estebank:fancy-spans, r=oli-obkbors-0/+29
Use smaller spans for some structured suggestions Use more accurate suggestion spans for * argument parse error * fully qualified path * missing code block type * numeric casts
2021-09-08Bump stage0 compiler to 1.56Mark Rousskov-1/+0
2021-09-06Auto merge of #88493 - chenyukang:fix-duplicated-diagnostic, r=estebankbors-1/+49
Fix #88256 remove duplicated diagnostics Fix #88256
2021-09-04Fix #88256, remove duplicated diagnosticyukang-1/+49
2021-08-27Path remapping: Make behavior of diagnostics output dependent on presence of ↵Michael Woerister-6/+6
--remap-path-prefix.
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-11/+9
2021-08-23wipEsteban Kuber-20/+13
2021-08-23Account for tabs when highlighting multiline code suggestionsEsteban Kuber-25/+45
2021-08-12Use smaller spans for some structured suggestionsEsteban Kuber-0/+29
Use more accurate suggestion spans for * argument parse error * fully qualified path * missing code block type * numeric casts * E0212
2021-08-11Modify structured suggestion outputEsteban Küber-25/+180
* 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-08-04Remove trailing whitespace from error messagesFabian Wolff-2/+5
2021-08-02Auto merge of #87535 - lf-:authors, r=Mark-Simulacrumbors-1/+0
rfc3052 followup: Remove authors field from Cargo manifests Since RFC 3052 soft deprecated the authors field, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information for contributors, we may as well remove it from crates in this repo.
2021-07-30Use multispan suggestions more oftenEsteban Küber-0/+38
* Use more accurate span for `async move` suggestion * Use more accurate span for deref suggestion * Use `multipart_suggestion` more often
2021-07-29rfc3052: Remove authors field from Cargo manifestsJade-1/+0
Since RFC 3052 soft deprecated the authors field anyway, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information, we should remove it from crates in this repo.
2021-07-19Various diagnostics clean ups/tweaksEsteban Küber-8/+19
* Always point at macros, including derive macros * Point at non-local items that introduce a trait requirement * On private associated item, point at definition
2021-07-11Simplify future incompatible reporting.Eric Huss-12/+6
2021-07-10rustc_span: Revert addition of `proc_macro` field to `ExpnKind::Macro`Vadim Petrochenkov-18/+3
The flag has a vague meaning and is used for a single diagnostic change that is low benefit and appears only under `-Z macro_backtrace`.
2021-07-08Rework SESSION_GLOBALS API to prevent overwriting itGuillaume Gomez-6/+1
2021-07-06Auto merge of #86572 - rylev:force-warnings-always, r=nikomatsakisbors-6/+43
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-6/+17
2021-06-28Update to new bootstrap compilerMark Rousskov-1/+0
2021-06-07Auto merge of #85903 - bjorn3:rustc_serialize_cleanup, r=varkorbors-2/+2
Remove unused functions and arguments from rustc_serialize