about summary refs log tree commit diff
path: root/src/librustc_errors
AgeCommit message (Collapse)AuthorLines
2020-02-29Rollup merge of #69567 - matthiaskrgr:useless_fmt, r=nagisaDylan DPC-3/+3
use .to_string() instead of format!() macro to create strings handles what is left after https://github.com/rust-lang/rust/pull/69541
2020-02-29use .to_string() instead of format!() macro to create stringsMatthias Krüger-3/+3
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-2/+2
2020-02-22Rename CodeMap to SourceMap follow upMaxim Zholobak-20/+20
2020-02-17Ensure diagnostics are printed in the correct orderMarkus Westerlind-2/+4
Even when buffered. Ideally we would flush only when the emitter is done, but that requires larger changes. This gives most of the benefit of buffering in any case.
2020-02-17perf: Buffer stderr when writing json errors/warningsMarkus Westerlind-1/+1
Since `stderr` is unbuffered, writing out json messages actually take up about ~10%/0.1s of the runtime of the `inflate` benchmark. cc #64413
2020-02-11Auto merge of #69062 - Dylan-DPC:rollup-7wpjpqu, r=Dylan-DPCbors-2/+0
Rollup of 8 pull requests Successful merges: - #66498 (Remove unused feature gates) - #68816 (Tweak borrow error on `FnMut` when `Fn` is expected) - #68824 (Enable Control Flow Guard in rustbuild) - #69022 (traits: preallocate 2 Vecs of known initial size) - #69031 (Use `dyn Trait` more in tests) - #69044 (Don't run coherence twice for future-compat lints) - #69047 (Don't rustfmt check the vendor directory.) - #69055 (Clean up E0307 explanation) Failed merges: r? @ghost
2020-02-11Rollup merge of #66498 - bjorn3:less_feature_flags, r=Dylan-DPCDylan DPC-2/+0
Remove unused feature gates I think many of the remaining unstable things can be easily be replaced with stable things. I have kept the `#![feature(nll)]` even though it is only necessary in `libstd`, to make regressions of it harder.
2020-02-11Run RustFmtjumbatm-1/+5
2020-02-11Invert control in struct_lint_level.jumbatm-1/+3
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-02-09Auto merge of #68376 - Centril:move-ref-patterns, r=matthewjasperbors-1/+15
Initial implementation of `#![feature(move_ref_pattern)]` Following up on #45600, under the gate `#![feature(move_ref_pattern)]`, `(ref x, mut y)` is allowed subject to restrictions necessary for soundness. The match checking implementation and tests for `#![feature(bindings_after_at)]` is also adjusted as necessary. Closes #45600. Tracking issue: #68354. r? @matthewjasper
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-18/+35
2020-02-06rustc_errors: hide "in this macro invocation" when redundant, more explicitly.Eduard-Mihai Burtescu-28/+37
2020-02-06rustc_errors: deduplicate the -Zmacro-backtrace suggestion message.Eduard-Mihai Burtescu-12/+5
2020-02-06rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace.Eduard-Mihai Burtescu-40/+26
2020-02-06rustc_errors: split macro backtrace rendering from <*macros> hacks.Eduard-Mihai Burtescu-59/+97
2020-02-04Remove unused feature gates from librustc_errorsbjorn3-2/+0
2020-02-02introduce `#![feature(move_ref_pattern)]`Mazdak Farrokhzad-1/+15
2020-01-30Rollup merge of #68626 - Zoxc:termize, r=estebankDylan DPC-2/+2
Use termize instead of term_size `termize` is a fork of `term_size` which uses `winapi` 0.3 instead of 0.2. This is a step towards removing the `winapi` 0.2 dependency. r? @Mark-Simulacrum
2020-01-29Use termize instead of term_sizeJohn Kåre Alsaker-2/+2
2020-01-28Correct ICE caused by macros generating invalid spans.Michael Burge-1/+8
2020-01-27don't clone types that are copy, round two.Matthias Krüger-6/+6
2020-01-26rustc_span: return an impl Iterator instead of a Vec from macro_backtrace.Eduard-Mihai Burtescu-6/+6
2020-01-26rustc_span: replace MacroBacktrace with ExpnData.Eduard-Mihai Burtescu-10/+11
2020-01-26Auto merge of #68522 - estebank:impl-trait-sugg-2, r=oli-obkbors-3/+8
Further improve `impl Trait`/`dyn Trait` suggestions After reading [_Returning Trait Objects_ by Bryce Fisher-Fleig](https://bryce.fisher-fleig.org/blog/returning-trait-objects/), [I noticed that](https://www.reddit.com/r/rust/comments/esueur/returning_trait_objects/ffczl4k/) #68195 had a few bugs due to not ignoring `ty::Error`. - Account for `ty::Error`. - Account for `if`/`else` and `match` blocks when pointing at return types and referencing their types. - Increase the multiline suggestion output from 6 lines to 20.
2020-01-25Revert suggestion window size changeEsteban Küber-1/+1
2020-01-24Do not ICE on multipart suggestions touching multiple filesEsteban Küber-5/+6
When encountering a multipart suggestion with spans belonging to different contexts, skip that suggestion.
2020-01-24review commentsEsteban Küber-1/+1
2020-01-24Increase suggestion code window from 6 lines to 20Esteban Küber-3/+8
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-4/+1
2020-01-17Rollup merge of #68256 - estebank:bad-sugg-span, r=petrochenkovTyler Mandry-4/+22
Do not ICE on malformed suggestion spans Under the assumption that suggestions are by their very nature always "best effort", it is ok if we don't display them instead of having an ICE. The underlying issue of the malformed span being _created_ is left unaddressed. Fix #67567. r? @petrochenkov
2020-01-16review commentsEsteban Küber-16/+14
2020-01-16Do not ICE on malformed suggestion spansEsteban Küber-1/+21
2020-01-16don't clone types that are copyMatthias Krüger-1/+1
found via clippy
2020-01-11use winapi for non-stdlib Windows bindingsAndy Russell-22/+8
2020-01-10Fix invalid bounding boxEsteban Küber-1/+1
2020-01-08Remove `-Z continue-parse-after-error`Vadim Petrochenkov-20/+0
2020-01-08- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}Mazdak Farrokhzad-0/+19
- remove syntax::{help!, span_help!, span_note!} - remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!} - lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints - inline syntax::{struct_span_warn!, diagnostic_used!} - stringify_error_code! -> error_code! & use it more. - find_plugin_registrar: de-fatalize an error - de-fatalize metadata errors - move type_error_struct! to rustc_typeck - struct_span_err! -> rustc_errors
2020-01-05Handle multiple error fix suggestions carefulyLaurent Bonnans-5/+13
The existing code seems to assume that substitutions spans are disjoint, which is not always the case. In the example: pub trait AAAA {} pub trait B {} pub trait C {} pub type T<P: AAAA + B + C> = P; , we get three substituions starting from ':' and ending respectively at the end of each trait token. With the former offset calculation, this would cause `underline_start` to eventually become negative before being converted to `usize`... The new version may report erroneous results for non perfectly overlapping substitutions but I don't know if such examples exist. Alternatively, we could detect these cases and trim out overlapping substitutions.
2020-01-03Address review comments + Fix rebaseVadim Petrochenkov-1/+2
2020-01-03Introduce an option for disabling deduplication of diagnosticsVadim Petrochenkov-5/+7
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-18/+18
2019-12-30Make things build againVadim Petrochenkov-1/+1
2019-12-29Auto merge of #67614 - Mark-Simulacrum:global-callbacks, r=Zoxcbors-6/+4
Set callbacks globally This sets the callbacks from syntax and rustc_errors just once, utilizing static (rather than thread-local) storage.
2019-12-25Store callbacks in global staticsMark Rousskov-6/+4
The callbacks have precisely two states: the default, and the one present throughout almost all of the rustc run (the filled in value which has access to TyCtxt). We used to store this as a thread local, and reset it on each thread to the non-default value. But this is somewhat wasteful, since there is no reason to set it globally -- while the callbacks themselves access TLS, they do not do so in a manner that fails in when we do not have TLS to work with.
2019-12-24Deprecate Error::description for realDavid Tolnay-5/+1
`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it. This commit: - adds #[rustc_deprecated(since = "1.41.0")] to Error::description; - moves description (and cause, which is also deprecated) below the source and backtrace methods in the Error trait; - reduces documentation of description and cause to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call description; - removes the description function of all *currently unstable* Error impls in the standard library; - marks #[allow(deprecated)] the description function of all *stable* Error impls in the standard library; - replaces miscellaneous uses of description in example code and the compiler.
2019-12-24x.py fmt after previous deignoreMark Rousskov-291/+310
2019-12-22Format the worldMark Rousskov-489/+413
2019-12-08async/await: more improvements to non-send errorsDavid Wood-0/+10
Signed-off-by: David Wood <david@davidtw.co>
2019-11-27Draw vertical lines in compiler error messages with multiline annotations ↵Christoph Schmidler-3/+3
correctly when non-1space unicode characters are to the left For this we use the correct calculation of the 'left' identation