about summary refs log tree commit diff
path: root/src/librustc_errors/lib.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-1021/+0
2020-08-15replaced log with tracingGurpreet Singh-1/+1
2020-08-14Rework `rustc_serialize`Matthew Jasper-7/+10
- Move the type parameter from `encode` and `decode` methods to the trait. - Remove `UseSpecialized(En|De)codable` traits. - Remove blanket impls for references. - Add `RefDecodable` trait to allow deserializing to arena-allocated references safely. - Remove ability to (de)serialize HIR. - Create proc-macros `(Ty)?(En|De)codable` to help implement these new traits.
2020-07-16apply bootstrap cfgsMark Rousskov-1/+0
2020-06-30Stabilize `#[track_caller]`.Adam Perry-1/+1
Does not yet make its constness stable, though. Use of `Location::caller` in const contexts is still gated by `#![feature(const_caller_location)]`.
2020-06-15track caller for delay_span_bugmark-0/+4
2020-06-09Handle assembler warnings properlyAmanieu d'Antras-0/+5
2020-04-27Fix off by one error for delay_span_bugSantiago Pastorino-1/+4
delay_span_bug bumps error_count after checking treat_err_as_bug
2020-04-12fix issue 69130David Renshaw-1/+4
2020-04-11rustc: Add a warning count upon completionRoccoDev-3/+24
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-1/+1
2020-03-26introduce `negative_impls` feature gate and documentNiko Matsakis-2/+2
They used to be covered by `optin_builtin_traits` but negative impls are now applicable to all traits, not just auto traits. This also adds docs in the unstable book for the current state of auto traits.
2020-03-20Revised span-to-lines conversion to produce an empty vec on DUMMY_SP.Felix S. Klock II-3/+3
This required revising some of the client code to stop relying on the returned set of lines being non-empty.
2020-03-10rustc_errors: Use ensure_source_file_source_present where necessary.Ana-Maria Mihalache-0/+5
2020-03-04Don't use "if let" bindings to only check a value and not actually bind ↵Matthias Krüger-1/+1
anything. For example: `if let Some(_) = foo() {}` can be reduced to `if foo().is_some() {}` (clippy::redundant_pattern_matching)
2020-03-02Rollup merge of #69623 - Centril:fix-69396-tmp, r=petrochenkovDylan DPC-14/+4
stash API: remove panic to fix ICE. Implements the temporary solution suggested in https://github.com/rust-lang/rust/pull/69537#issuecomment-593143975. Fixes https://github.com/rust-lang/rust/issues/69396. r? @petrochenkov
2020-03-02stash API: remove panic to fix ICE.Mazdak Farrokhzad-14/+4
2020-02-29added `try_find_description` to distinguish no desc from invalid codeJake Vossen-2/+6
2020-02-22Rename CodeMap to SourceMap follow upMaxim Zholobak-16/+16
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-06rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace.Eduard-Mihai Burtescu-4/+4
2020-02-04Remove unused feature gates from librustc_errorsbjorn3-2/+0
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-16review commentsEsteban Küber-12/+9
2020-01-16Do not ICE on malformed suggestion spansEsteban Küber-0/+13
2020-01-10Fix invalid bounding boxEsteban Küber-1/+1
2020-01-08Remove `-Z continue-parse-after-error`Vadim Petrochenkov-20/+0
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-4/+4
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-22Format the worldMark Rousskov-113/+109
2019-11-26Move ErrorReported to rustc_errorsMark Rousskov-0/+7
2019-11-18Auto merge of #58281 - mark-i-m:synthesis, r=estebankbors-0/+5
Add outlives suggestions for some lifetime errors This PR implements suggestion diagnostics for some lifetime mismatch errors. When the borrow checker finds that some lifetime 'a doesn't outlive some other lifetime 'b that it should outlive, then in addition to the current lifetime error, we also emit a suggestion for how to fix the problem by adding a bound: - If a and b are normal named regions, suggest to add the bound `'a: 'b` - If b is static, suggest to replace a with static - If b also needs to outlive a, they must be the same, so suggest unifying them We start with a simpler implementation that avoids diagnostic regression or implementation complexity: - We only makes suggestions for lifetimes the user can already name (eg not closure regions or elided regions) - For now, we only emit a help note, not an actually suggestion because it is significantly easier. Finally, there is one hack: it seems that implicit regions in async fn are given the name '_ incorrectly. To avoid suggesting '_: 'x, we simply filter out such lifetimes by name. For more info, see this internals thread: https://internals.rust-lang.org/t/mechanical-suggestions-for-some-borrow-checker-errors/9049/3 TL;DR Make suggestions to add a `where 'a: 'b` constraint for some lifetime errors. Details are in the paper linked from the internals thread above. r? @estebank TODO - [x] Clean up code - [x] Only make idiomatic suggestions - [x] don't suggest naming `&'a self` - [x] rather than `'a: 'static`, suggest replacing `'a` with `'static` - [x] rather than `'a: 'b, 'b: 'a`, suggest replacing `'a` with `'b` or vice versa - [x] Performance (maybe need a perf run when this is closer to the finish line?) - perf run was clean... - EDIT: perf run seems to only check non-error performance... How do we check that error performance didn't regress? - [x] Needs ui tests - [x] Integrate the `help` message into the main lifetime `error`
2019-11-16review comments and fix rebaseEsteban Küber-0/+1
2019-11-15Move JSON emitter to rustc_errorsMark Rousskov-0/+1
2019-11-15Remove SourceMapper traitMark Rousskov-28/+5
SourceMap is now in the root of all rustc-specific crates, syntax_pos, so there's no need for the trait object to decouple the dependencies between librustc_errors and libsyntax as was needed previously.
2019-11-15Move FatalError to syntax_posMark Rousskov-30/+1
This is a bit unfortunate, but code needs to be able to fatally error early on (in particular, syntax_pos after we move SourceMap there). It's also a tiny bit of code, which means it's ultimately not that bad.
2019-11-11Tiny cleanup to size assertionsVadim Petrochenkov-3/+1
2019-11-07move PResult to librustc_errorsMazdak Farrokhzad-1/+9
2019-11-05use American spelling for `pluralize!`Andy Russell-1/+1
2019-10-27add and use struct_helpMark Mansi-0/+5
2019-10-16Check if there are any delayed_span_bugs and abort incremental compilation ↵Quentin Boyer-0/+6
in this case
2019-10-14Use heuristics for capitalization warning in suggestionsEsteban Küber-4/+2
2019-10-13Bring attention to suggestions when the only difference is capitalizationEsteban Küber-11/+21
2019-10-03review commentsEsteban Küber-0/+2
2019-10-02Fully clear `HandlerInner` in `Handler::reset_err_count`AnthonyMikh-5/+8
2019-09-23cleanup librustc_errors Handler code.Mazdak Farrokhzad-135/+166