about summary refs log tree commit diff
path: root/src/librustc_errors/diagnostic_builder.rs
AgeCommit message (Collapse)AuthorLines
2019-09-23Introduce a diagnostic stashing API.Mazdak Farrokhzad-13/+28
2019-09-17Privatize DiagnosticBuilder constructorsMark Rousskov-2/+3
2019-09-17Take Diagnostic in Handler::emit_diagnosticMark Rousskov-9/+1
2019-09-12Box `DiagnosticBuilder`.Nicholas Nethercote-35/+46
It's a large type -- 176 bytes on 64-bit. And it's passed around and returned from a lot of functions, including within PResult. This commit boxes it, which reduces memory traffic. In particular, `PResult` shrinks to 16 bytes in the best case; this reduces instruction counts by up to 2% on various workloads.
2019-07-11Emit dropped unemitted errors to aid in ICE debuggingEsteban Küber-3/+6
2019-06-10Address review commentsPhilipp Hansch-1/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-06-10librustc_errors: Add some more documentationPhilipp Hansch-1/+1
2019-05-10Remove hir::ExprKind::If and replace it with lowering to hir::ExprKind::Match.Mazdak Farrokhzad-0/+12
2019-05-02introduce unescape moduleAleksey Kladov-1/+1
Currently, we deal with escape sequences twice: once when we lex a string, and a second time when we unescape literals. This PR aims to remove this duplication, by introducing a new `unescape` mode as a single source of truth for character escaping rules
2019-03-07fix bad logicEsteban Küber-1/+3
2019-03-06Make `-Z treat-err-as-bug` take a number of errors to be emittedEsteban Küber-1/+1
`-Z treat-err-as-bug=0` will cause `rustc` to panic after the first error is reported. `-Z treat-err-as-bug=2` will cause `rustc` to panic after 3 errors have been reported.
2019-02-24Use ? in some macrosTaiki Endo-3/+3
2019-02-14Rollup merge of #58296 - estebank:hidden-suggestion, r=oli-obkMazdak Farrokhzad-0/+57
Hidden suggestion support Add way to hide suggestion snippet window from cli output to avoid cluttered spans that don't enhance understanding. r? @pietroalbini CC @zackmdavis
2019-02-11Use hidden suggestions for unused imports lintEsteban Küber-0/+18
2019-02-11Add way to completely hide suggestion from cli outputEsteban Küber-0/+19
2019-02-11Expose hidden snippet suggestionsEsteban Küber-0/+20
2019-02-10rustc: doc commentsAlexander Regueiro-2/+2
2019-02-07librustc_errors => 2018Taiki Endo-9/+10
2019-01-26remove `_with_applicability` from suggestion fnsAndy Russell-68/+31
2019-01-17properly deprecate suggestion methodsAndy Russell-34/+56
2018-12-25Remove licensesMark Rousskov-10/+0
2018-10-31Pass suggestions as impl Iterator instead of Vecljedrz-1/+1
2018-10-19Prefer unwrap_or_else to unwrap_or in case of function calls/allocationsljedrz-1/+1
2018-09-20Auto merge of #54241 - vi:suggest_with_applicability, r=estebankbors-21/+53
Remove usages of span_suggestion without Applicability Use `Applicability::Unspecified` for all of them instead. Shall deprecations for the non-`_with_applicability` functions be added? Shall clippy be addressed somehow? r? @estebank
2018-09-18Log when buffering a diagnostic.David Wood-0/+3
This is useful in debugging when and where errors are emitted in logs.
2018-09-17Better trick for allowing trailing comma at forward!Vitaly _Vi Shukela-10/+13
2018-09-17Add -Z dont-buffer-diagnostics, a way to force NLL to immediately emit its ↵Felix S. Klock II-2/+12
diagnostics. This is mainly intended for `rustc` developers who want to see a diagnostic in its original context in the control flow. Two uses cases for that are: * `-Z treat-err-as-bug` which then allows extraction of a stack-trace to the origin of the error (a case that is so important that we make that flag imply this one, effectively). * `RUST_LOG=... rustc`, in which case it is often useful to see the logging statements that occurred immediately prior to the point where the diagnostic was signalled. Drive-by: Added some documentation pointing future devs at HandlerFlags, and documented the fields of `HandlerFlags` itself.
2018-09-17Change diagnostic_builder's forward! macro to enforce trailing argument commaVitaly _Vi Shukela-27/+27
2018-09-17Fix style according to review comments.Vitaly _Vi Shukela-3/+4
2018-09-16Deprecate *_suggestion* that are without explicit applicabilityVitaly _Vi Shukela-0/+11
2018-09-16Add multipart_suggestion_with_applicabilityVitaly _Vi Shukela-0/+17
2018-07-30rustc: Disallow machine applicability in foreign macrosAlex Crichton-19/+64
Recent changes to lints disallowed lints from being emitted against code located in foreign macros, except for future-incompatible lints. For a future incompatible lint, however, the automatic suggestions may not be applicable! This commit updates this code path to force all applicability suggestions made to foreign macros to never be `MachineApplicable`. This should avoid rustfix actually attempting fixing these suggestions, causing non-compiling code to be produced. Closes rust-lang/cargo#5799
2018-07-26Add `-Z borrowck=migrate` flag, use it to link NLL up to AST-borrowck.Felix S. Klock II-19/+0
2018-07-23Buffer errors in MIR borrow checkSantiago Pastorino-0/+12
(pnkfelix updated to address tidy, and to change the buffer from `Vec<DiagnosticBuilder<'errs>>` to a `Vec<Diagnostic>` in order to avoid painful lifetime maintenance.)
2018-07-20Make sure the compiler actually panics on `delay_span_bug`Oliver Schneider-1/+1
Even if that is just happening because of `abort_if_errors`
2018-07-14Deny bare trait objects in src/librustc_errorsljedrz-4/+4
Enforce `#![deny(bare_trait_objects)]` in `src/librustc_errors`.
2018-05-28Auto merge of #50724 - zackmdavis:applicability_rush, r=Manishearthbors-0/+6
add suggestion applicabilities to librustc and libsyntax A down payment on #50723. Interested in feedback on whether my `MaybeIncorrect` vs. `MachineApplicable` judgement calls are well-calibrated (and that we have a consensus on what this means). r? @Manishearth cc @killercup @estebank
2018-05-21Improve the diagnostic around impl Trait <-> generic param mismatchOliver Schneider-0/+5
2018-05-20introducing `span_suggestion_short_with_applicability`Zack M. Davis-0/+6
Some would argue that this 40-character method name is ludicrously unwieldy (even ironic), but it's the unique continuation of the precedent set by the other suggestion methods. (And there is some hope that someday we'll just fold `Applicability` into the signature of the "basic" method `span_suggestion`.) This is in support of #50723.
2018-04-25Approximate -> ApplicabilityManish Goregaokar-5/+5
2018-04-24Use enum for approximate suggestionsManish Goregaokar-2/+5
2018-03-14test for putting back check on jsonGuillaume Gomez-1/+2
2018-01-29Add approximate suggestions for rustfixManish Goregaokar-0/+10
This adds `span_approximate_suggestion()` that lets you emit a suggestion marked as "approximate" in the JSON output. UI users see no difference. This is for when rustc and clippy wish to emit suggestions which will make sense to the reader (e.g. they may have placeholders like `<type>`) but are not source-applicable, so that rustfix/etc can ignore these. fixes #39254
2018-01-03Only bump error count when we are sure that the diagnostic is not a repetition.Rafael Fernández López-12/+6
This ensures that if we emit the same diagnostic twice, the error count will match the real number of errors shown to the user. Fixes #42106
2017-11-19use -Z flag instead of env varAlex Burka-1/+1
2017-11-02Make the difference between lint codes and error codes explicitOliver Schneider-2/+3
2017-08-28Initial diagnostic API for proc-macros.Sergio Benitez-0/+13
This commit introduces the ability to create and emit `Diagnostic` structures from proc-macros, allowing for proc-macro authors to emit warning, error, note, and help messages just like the compiler does.
2017-08-25rustc_errors: Add the ability to delay as bugsAlex Crichton-2/+20
This adds a function to `DiagnosticBuilder` to delay the entire diagnostic as a bug to be emitted at a later time. This'll end up getting used in the compiler in the subsequent commits...
2017-08-24rustc: Capture diagnostics from all queriesAlex Crichton-5/+8
This commit alters the `rustc::ty::maps` implementation to ensure that all output diagnostics from the compiler are tracked for the duration of each query. These are then intended to be replayed back the first time a cached value is loaded, and otherwise the cache should operate the same as it does today. Closes #42513
2017-08-19rustc: Remove some dead codeVadim Petrochenkov-7/+0