about summary refs log tree commit diff
path: root/src/librustc/infer
AgeCommit message (Collapse)AuthorLines
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-18/+12
- 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-07Move required_region_bounds to rustc::infer::opaque_types.Camille GILLOT-2/+67
2020-01-07Move free_region_map to rustc::ty.Camille GILLOT-99/+2
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-125/+164
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-37/+35
Nix `rustc_hir` reexports in rustc::hir r? @Zoxc cc @Mark-Simulacrum
2020-01-05Rollup merge of #67881 - varkor:scattering-of-backticks, r=CentrilDylan DPC-10/+10
Add backticks to various diagnostics
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-37/+35
2020-01-05Add backticks to various diagnosticsvarkor-10/+10
2020-01-04DefId{Map,Set} -> rustc::hir::def_idMazdak Farrokhzad-2/+1
2020-01-04canonicalize FxHash{Map,Set} importsMazdak Farrokhzad-3/+4
2020-01-04Rollup merge of #67786 - Centril:canon-span, r=petrochenkovMazdak Farrokhzad-6/+6
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-3/+3
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-3/+3
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-17/+17
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-2042/+1854
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
2019-12-21Use Arena inside hir::TraitItem.Camille GILLOT-1/+1
2019-12-21Use Arena inside hir::Item.Camille GILLOT-1/+1
2019-12-20Check associated type implementations for generic mismatchesMatthew Jasper-0/+2
2019-12-14Indicate origin of where type parameter for uninferred typesOhad Ravid-16/+72
2019-12-13Auto merge of #65951 - estebank:type-inference-error, r=nikomatsakisbors-25/+153
Point at method call when type annotations are needed - Point at method call instead of whole expression when type annotations are needed. - Suggest use of turbofish on function and methods. Fix #49391, fix #46333, fix #48089. CC #58517, #63502, #63082. Fixes https://github.com/rust-lang/rust/issues/40015 r? @nikomatsakis
2019-12-11Add more context for type parametersEsteban Küber-15/+27
2019-12-11Reuse existing HirId → DefId tableEsteban Küber-5/+4
2019-12-11Change `PendingPredicateObligation::stalled_on`'s type.Nicholas Nethercote-9/+7
From a `Vec<Ty>` to a `Vec<InferTy>`, because that's a more restrictive type. This is a perf win because the ultra-hot function `shallow_resolve_changed` has less pattern-matching to do.
2019-12-11Optimize `shallow_resolve_changed`.Nicholas Nethercote-13/+15
It can be made even more specialized.
2019-12-10Use `generics_of` instead of incorrectly inspecting `FnSig` argumentsEsteban Küber-17/+36