about summary refs log tree commit diff
path: root/compiler/rustc_infer
AgeCommit message (Collapse)AuthorLines
2021-02-21Change `find_anon_type` method to function0yoyoyo-63/+61
2021-02-19Rollup merge of #81496 - guswynn:expected_async_block, r=oli-obkDylan DPC-8/+10
name async generators something more human friendly in type error diagnostic fixes #81457 Some details: 1. I opted to load the generator kind from the hir in TyCategory. I also use 1 impl in the hir for the descr 2. I named both the source of the future, in addition to the general type (`future`), not sure what is preferred 3. I am not sure what is required to make sure "generator" is not referred to anywhere. A brief `rg "\"generator\"" showed me that most diagnostics correctly distinguish from generators and async generator, but the `descr` of `DefKind` is pretty general (not sure how thats used) 4. should the descr impl of AsyncGeneratorKind use its display impl instead of copying the string?
2021-02-18Rollup merge of #82066 - matthewjasper:trait-ref-fix, r=jackh726Dylan DPC-1/+24
Ensure valid TraitRefs are created for GATs This fixes `ProjectionTy::trait_ref` to use the correct substs. Places that need all of the substs have been updated to not use `trait_ref`. r? ````@jackh726````
2021-02-18Rollup merge of #82240 - matthiaskrgr:qmark, r=Dylan-DPCYuki Okushi-6/+1
remove useless ?s (clippy::needless_question_marks) Example code: ```rust fn opts() -> Option<String> { let s: Option<String> = Some(String::new()); Some(s?) // this can just be "s" } ```
2021-02-17Rollup merge of #81972 - matthewjasper:hrtb-error-cleanup, r=nikomatsakisDylan DPC-108/+128
Placeholder lifetime error cleanup - Remove note of trait definition - Avoid repeating the same self type - Use original region names when possible - Use this error kind more often - Print closure signatures when they are suppose to implement `Fn*` traits Works towards #57374 r? ```@nikomatsakis```
2021-02-17remove useless ?s (clippy::needless_question_marks)Matthias Krüger-6/+1
Example code: ``` fn opts() -> Option<String> { let s: Option<String> = Some(String::new()); Some(s?) // this can just be "s" } ```
2021-02-16Auto merge of #81611 - cjgillot:meowner, r=estebankbors-13/+9
Only store a LocalDefId in some HIR nodes Some HIR nodes are guaranteed to be HIR owners: Item, TraitItem, ImplItem, ForeignItem and MacroDef. As a consequence, we do not need to store the `HirId`'s `local_id`, and we can directly store a `LocalDefId`. This allows to avoid a bit of the dance with `tcx.hir().local_def_id` and `tcx.hir().local_def_id_to_hir_id` mappings.
2021-02-16Rollup merge of #82163 - matthiaskrgr:slice, r=jyn514Guillaume Gomez-1/+1
avoid full-slicing slices If we already have a slice, there is no need to get another full-range slice from that, just use the original. clippy::redundant_slicing
2021-02-16Rollup merge of #82160 - pierwill:patch-2, r=lcnrGuillaume Gomez-1/+1
Fix typo in rustc_infer::infer::UndoLog Also use double quotes.
2021-02-16avoid full-slicing slicesMatthias Krüger-1/+1
If we already have a slice, there is no need to get another full-range slice from that, just use the original. clippy::redundant_slicing
2021-02-15Trait impls are Items, therefore HIR owners.Camille GILLOT-2/+1
2021-02-15Only store a LocalDefId in hir::ImplItem.Camille GILLOT-6/+4
2021-02-15Only store a LocalDefId in hir::TraitItem.Camille GILLOT-5/+4
2021-02-15Use ItemId as a strongly typed index.Camille GILLOT-1/+1
2021-02-15Fix typo in rustc_infer::infer::UndoLogpierwill-1/+1
Also use double quotes.
2021-02-15name async generators something more human friendly in type error diagnosticsGus Wynn-8/+10
2021-02-15Rollup merge of #82067 - BoxyUwU:hahaicantthinkofabadpun, r=oli-obkJonas Schievink-4/+9
const_generics: Fix incorrect ty::ParamEnv::empty() usage Fixes #80561 Not sure if I should keep the `debug!(..)`s or not but its the second time I've needed them so they sure seem useful lol cc ``@lcnr`` r? ``@oli-obk``
2021-02-14bumped smallvec depsklensy-1/+1
2021-02-14param_env debugs are instrumental to rustc's successEllen-1/+1
2021-02-13Don't go through TraitRef to relate projectionsMatthew Jasper-1/+24
2021-02-13yeet ya fixme into the voidEllen-4/+8
2021-02-13debug!("paramenv={}paramenv={}paramenv={}paramenv={}")Ellen-0/+1
2021-02-12Fix suggestion to introduce explicit lifetime0yoyoyo-1/+6
2021-02-10Keep existing names of regions in placeholder_errorMatthew Jasper-4/+4
2021-02-09Print closure signatures when reporting placeholder errorsMatthew Jasper-6/+32
2021-02-09Report "nice" placeholder errors more oftenMatthew Jasper-73/+69
If we have a cause containing `ValuePairs::PolyTraitRefs` but neither TraitRef has any escaping bound regions then we report the same error as for `ValuePairs::TraitRefs`.
2021-02-09Avoid repeating self type in placeholder errorMatthew Jasper-2/+18
2021-02-09Remove unnecessary note on errorsMatthew Jasper-4/+0
Seeing the trait definition doesn't help with implementation not general enough errors, so don't make the error message larger to show it.
2021-02-09Using tracing macros in placeholder_error.rsMatthew Jasper-21/+7
2021-02-09Use longer lifetime in `try_report_from_nll` return typeMatthew Jasper-4/+4
2021-02-09Rollup merge of #80732 - spastorino:trait-inheritance-self2, r=nikomatsakisDylan DPC-1/+40
Allow Trait inheritance with cycles on associated types take 2 This reverts the revert of #79209 and fixes the ICEs that's occasioned by that PR exposing some problems that are addressed in #80648 and #79811. For easier review I'd say, check only the last commit, the first one is just a revert of the revert of #79209 which was already approved. This also could be considered part or the actual fix of #79560 but I guess for that to be closed and fixed completely we would need to land #80648 and #79811 too. r? `@nikomatsakis` cc `@Aaron1011`
2021-02-08Anonymize late bound regions on transitive bounds that define assoc typeSantiago Pastorino-15/+22
2021-02-05Adapt to latest master changes by using PredicateKindSantiago Pastorino-1/+1
2021-02-05Revert "Auto merge of #79637 - spastorino:revert-trait-inheritance-self, ↵Santiago Pastorino-1/+33
r=Mark-Simulacrum" This reverts commit b4def89d76896eec73b4af33642ba7e5eb53c567, reversing changes made to 7dc1e852d43cb8c9e77dc1e53014f0eb85d2ebfb.
2021-02-04tidy: Run tidy style against markdown files.Eric Huss-1/+0
2021-02-02Rollup merge of #81655 - matsujika:suggest-accessing-field-rewording, r=estebankJack Huey-1/+1
Improve wording of suggestion about accessing field Follow-up to #81504 The compiler at this moment suggests "you might have meant to use field `b` of type `B`", sounding like it's type `B` which has the field `b`. r? ```@estebank```
2021-02-02Rollup merge of #80593 - jackh726:chalk-upgrade, r=nikomatsakisJack Huey-8/+4
Upgrade Chalk ~~Blocked on rust-lang/chalk#670~~ ~~Now blocked on rust-lang/chalk#680 and release~~ In addition to the straight upgrade, I also tried to fix some tests by properly returning variables and max universes in the solution. Unfortunately, this actually triggers the same perf problem that rustc traits code runs into in `canonicalizer`. Not sure what the root cause of this problem is, or why it's supposed to be solved in chalk. r? ```@nikomatsakis```
2021-02-02Bump rustfmt versionMark Rousskov-1/+6
Also switches on formatting of the mir build module
2021-02-02Improve wording of suggestion about accessing fieldHirochika Matsumoto-1/+1
2021-02-01Upgrade ChalkJack Huey-8/+4
2021-02-01Rollup merge of #81504 - matsujika:suggestion-field-access, r=estebankJonas Schievink-0/+48
Suggest accessing field when appropriate Fix #81222 r? ``@estebank``
2021-02-01Rollup merge of #81463 - matsujika:nll-ensure-c-case, r=varkorJonas Schievink-11/+11
Rename NLL* to Nll* accordingly to C-CASE Given [C-CASE](https://rust-lang.github.io/api-guidelines/naming.html#casing-conforms-to-rfc-430-c-case), `NLLRegionVariableOrigin` and `NLL` are encouraged to be `NllRegionVariableOrigin` and `Nll` respectively.
2021-01-31RustfmtHirochika Matsumoto-1/+4
2021-01-31Fix prefix of debug logHirochika Matsumoto-1/+1
2021-01-30Rename function to `suggest_accessing_field_where_appropriate`Hirochika Matsumoto-2/+2
2021-01-30Account for unionHirochika Matsumoto-1/+8
2021-01-30Remove logging iteratorHirochika Matsumoto-3/+0
2021-01-29Suggest accessing field when code compiles with itHirochika Matsumoto-0/+41
2021-01-28Rename NLL* to Nll* accordingly to C-CASEHirochika Matsumoto-11/+11
2021-01-28Rollup merge of #79951 - LeSeulArtichaut:ty-ir, r=nikomatsakisYuki Okushi-2/+1
Refractor a few more types to `rustc_type_ir` In the continuation of #79169, ~~blocked on that PR~~. This PR: - moves `IntVarValue`, `FloatVarValue`, `InferTy` (and friends) and `Variance` - creates the `IntTy`, `UintTy` and `FloatTy` enums in `rustc_type_ir`, based on their `ast` and `chalk_ir` equilavents, and uses them for types in the rest of the compiler. ~~I will split up that commit to make this easier to review and to have a better commit history.~~ EDIT: done, I split the PR in commits of 200-ish lines each r? `````@nikomatsakis````` cc `````@jackh726`````