about summary refs log tree commit diff
path: root/src/librustc/infer/error_reporting
AgeCommit message (Collapse)AuthorLines
2020-02-16Move librustc/{traits,infer} to librustc_infer.Camille GILLOT-4831/+0
2020-02-14Improve opaque type lifetime errorsMatthew Jasper-4/+2
* Use better span for member constraint errors * Avoid a bad suggestion * Don't report member constraint errors if we have other universal region errors.
2020-02-11Invert control in struct_lint_level.jumbatm-1/+1
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-02-10Reduce the number of `RefCell`s in `InferCtxt`.Nicholas Nethercote-5/+8
`InferCtxt` contains six structures within `RefCell`s. Every time we create and dispose of (commit or rollback) a snapshot we have to `borrow_mut` each one of them. This commit moves the six structures under a single `RefCell`, which gives significant speed-ups by reducing the number of `borrow_mut` calls. To avoid runtime errors I had to reduce the lifetimes of dynamic borrows in a couple of places.
2020-02-06index ReEmpty by universeNiko Matsakis-2/+52
We now make `'empty` indexed by a universe index, resulting in a region lattice like this: ``` static ----------+-----...------+ (greatest) | | | early-bound and | | free regions | | | | | scope regions | | | | | empty(root) placeholder(U1) | | / | | / placeholder(Un) empty(U1) -- / | / ... / | / empty(Un) -------- (smallest) ``` Therefore, `exists<A> { forall<B> { B: A } }` is now unprovable, because A must be at least Empty(U1) and B is placeholder(U2), and hence the two regions are unrelated.
2020-02-06do not limit NiceRegionError to SubSupConflict or ConcreteFailureNiko Matsakis-13/+9
2020-01-25Use better bound names in `-Zverbose` modeEsteban Küber-3/+7
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-8/+0
2020-01-17Use named fields for `hir::ItemKind::Impl`Dylan MacKenzie-1/+1
2020-01-16don't clone types that are copyMatthias Krüger-1/+1
found via clippy
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-18/+16
2020-01-10Rollup merge of #66463 - estebank:point-at-closure-and-opaque-types, r=CentrilMazdak Farrokhzad-5/+139
Point at opaque and closure type definitions in type errors Fixes #57266, fixes #67117.
2020-01-08normalize rustc::hir::intravisit importsMazdak Farrokhzad-2/+2
2020-01-08intravisit: abstract over HIR MapMazdak Farrokhzad-3/+10
2020-01-08remove unnecessary `Debug`Esteban Küber-1/+1
2020-01-08reduce code duplicationEsteban Küber-35/+35
2020-01-08review commentsEsteban Küber-26/+40
2020-01-08review commentsEsteban Küber-16/+34
2020-01-08review comment: wordingEsteban Küber-6/+8
2020-01-08Point at the def span of trait refs E0277Esteban Küber-1/+8
2020-01-08review commentsEsteban Küber-17/+23
2020-01-08Point at opaque and closure type definitions in type errorsEsteban Küber-5/+92
2020-01-08- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}Mazdak Farrokhzad-12/+10
- 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-07Make ↵Camille GILLOT-1/+2
rustc::traits::object_safety::{astconv_object_safety_violations,is_vtable_safe_method,object_safety_violations} free functions.
2020-01-07Make ↵Camille GILLOT-1/+2
rustc::traits::error_reporting::{recursive_type_with_infinite_size_error, report_object_safety_error} free functions.
2020-01-07Make rustc::infer::error_reporting::{note_and_explain_free_region, ↵Camille GILLOT-123/+159
note_and_explain_region} free functions.
2020-01-07Remove private methods from TyCtxt impl block: rustc::infer::error_reporting.Camille GILLOT-108/+109
2020-01-06Auto merge of #67886 - Centril:rustc_hir_canon_imports, r=nagisabors-22/+20
Nix `rustc_hir` reexports in rustc::hir r? @Zoxc cc @Mark-Simulacrum
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-22/+20
2020-01-05Add backticks to various diagnosticsvarkor-10/+10
2020-01-04Rollup merge of #67786 - Centril:canon-span, r=petrochenkovMazdak Farrokhzad-3/+3
Nix reexports from `rustc_span` in `syntax` Remove reexports `syntax::{source_map, symbol, edition}` and use `rustc_span` paths directly. r? @petrochenkov
2020-01-03Rollup merge of #67595 - ohadravid:impl-trait-does-not-live-long-enough, ↵Yuki Okushi-1/+1
r=estebank Suggest adding a lifetime constraint for opaque type Fixes #67577, where code like this: ``` struct List { data: Vec<String>, } impl List { fn started_with<'a>(&'a self, prefix: &'a str) -> impl Iterator<Item=&'a str> { self.data.iter().filter(|s| s.starts_with(prefix)).map(|s| s.as_ref()) } } ``` will show this error: ``` Compiling playground v0.0.1 (/playground) error[E0597]: `prefix` does not live long enough --> src/lib.rs:6:47 | 5 | fn started_with<'a>(&'a self, prefix: &'a str) -> impl Iterator<Item=&'a str> { | -- lifetime `'a` defined here --------------------------- opaque type requires that `prefix` is borrowed for `'a` ... ``` but without suggesting the lovely `help: you can add a constraint..`. r? @estebank
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+1
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-2/+2
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-4/+4
2019-12-31Change wording for lifetime suggestion for opaque types from `constraint` to ↵Ohad Ravid-1/+1
`bound`
2019-12-30discriminant -> scrutineeMazdak Farrokhzad-5/+5
2019-12-30Blame user type in pat type error.Mazdak Farrokhzad-2/+5
2019-12-30refactor and fix this-expression-has-type noteMazdak Farrokhzad-0/+1
2019-12-30MatchExpressionArmPattern -> PatternMazdak Farrokhzad-1/+1
Current name is too specific for incoming changes.
2019-12-30MatchExpressionArmPattern: Use more generic wording.Mazdak Farrokhzad-1/+1
The existing wording was inappropriate for e.g. `if let Ok(_) = expr { .. }`. The diagnostic would leak the fact that we desugar to a `match`.
2019-12-27Visit for hir::Ty.Camille GILLOT-1/+1
2019-12-27Syntax for hir::Ty.Camille GILLOT-9/+9
2019-12-26Visit for hir::Expr.Camille GILLOT-1/+1
2019-12-26Syntax for hir::Expr.Camille GILLOT-8/+8
2019-12-24x.py fmt after previous deignoreMark Rousskov-55/+61
2019-12-22Format the worldMark Rousskov-671/+770
2019-12-22Auto merge of #66931 - cjgillot:hirene-preamble, r=eddybbors-6/+6
Allocate HIR on an arena 1/4 This PR is the first in a series of 4, aiming at allocating the HIR on an arena, as a memory optimisation. 1. This first PR lays the groundwork and migrates some low-hanging fruits. 2. The second PR will migrate `hir::Expr`, `hir::Pat` and related. 3. The third PR will migrate `hir::Ty` and related. 4. The final PR will be dedicated to eventual cleanups. In order to make the transition as gradual as possible, some lowering routines receive `Box`-allocated data and move it into the arena. This is a bit wasteful, but hopefully temporary. Nonetheless, special care should be taken to avoid double arena allocations. Work mentored by @Zoxc.
2019-12-21Use Arena inside hir::Body.Camille GILLOT-3/+3
2019-12-21Use Arena inside hir::ImplItem.Camille GILLOT-1/+1