aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer
Commit message (Collapse)AuthorAgeFilesLines
* Deal with goals arising from unificationFlorian Diebold2021-05-212-14/+17
|
* Get rid of resolve_ty_as_possibleFlorian Diebold2021-05-215-62/+30
| | | | Instead use shallow resolving where necessary.
* Make resolve_ty_shallow return TyFlorian Diebold2021-05-212-11/+6
|
* Rework obligation handlingFlorian Diebold2021-05-214-31/+157
| | | | | | | | We can't do the easy hack that we did before anymore, where we kept track of whether any inference variables changed since the last time we rechecked obligations. Instead, we store the obligations in canonicalized form; that way we can easily check the inference variables to see whether they have changed since the goal was canonicalized.
* Fix another panicFlorian Diebold2021-05-211-17/+15
|
* Fix panicFlorian Diebold2021-05-211-1/+4
|
* Fix HIR expecting errors to unify with anythingFlorian Diebold2021-05-211-2/+6
|
* Fix if/else coercionFlorian Diebold2021-05-211-1/+4
|
* Make diverging type variables work againFlorian Diebold2021-05-211-0/+20
| | | | | Chalk doesn't know about the `diverging` flag, so we need to instead propagate it before fully resolving the variables.
* Fix handling of diverging branches in match coercionFlorian Diebold2021-05-211-4/+13
| | | | Fixes #7626.
* Fix coercion of two closures to a function pointerFlorian Diebold2021-05-211-19/+31
| | | | Fixes #8604.
* Update tests with expected changesFlorian Diebold2021-05-211-3/+0
|
* Make type resolver a proper folder, make it resolve consts as wellFlorian Diebold2021-05-211-48/+117
|
* Fix fallback to bound vars in `unify`Florian Diebold2021-05-211-45/+78
|
* Temporary fix for unknown expectationsFlorian Diebold2021-05-211-0/+4
|
* Fix warnings & formatFlorian Diebold2021-05-212-17/+8
|
* Rewrite coercion using the new unificationFlorian Diebold2021-05-212-96/+342
|
* Remove our unification code, use Chalk's insteadFlorian Diebold2021-05-214-414/+109
|
* internal: Record mismatches of pattern types.Dawer2021-05-192-6/+10
|
* Merge #8813bors[bot]2021-05-161-20/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8813: Get some more array lengths! r=lf- a=lf- This is built on #8799 and thus contains its changes. I'll rebase it onto master when that one gets merged. It adds support for r-a understanding the length of: * `let a: [u8; 2] = ...` * `let a = b"aaa"` * `let a = [0u8; 4]` I have added support for getting the values of byte strings, which was not previously there. I am least confident in the correctness of this part and it probably needs some more tests, as we currently have only one test that exercised that part (!). Fixes #2922. Co-authored-by: Jade <[email protected]>
| * Address final feedbackJade2021-05-161-3/+2
| | | | | | | | | | * rename ConstExtension->ConstExt * refactor a manual construction of a Const
| * Add more tests, refactor array lengths/consteval workJade2021-05-141-33/+8
| | | | | | | | | | | | | | | | | | | | | | Fix #2922: add unknown length as a condition for a type having unknown. Incorporate reviews: * Extract some of the const evaluation workings into functions * Add fixmes on the hacks * Add tests for impls on specific array lengths (these work!!! 😁) * Add tests for const generics (indeed we don't support it yet)
| * Add support for lengths in array repeats, if they are literalsJade2021-05-131-6/+16
| | | | | | | | Now we will get the type of `[0u8; 4]`.
| * Support length for ByteStringsJade2021-05-131-6/+14
| | | | | | | | I am not confident that my added byte string parsing is right.
| * Add lowering of array lengths in typesJade2021-05-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | Now e.g. ```rust fn a(b: [u8; 2]) { } ``` will know about the length of b.
* | Fix false positive "Missing match arm".Dawer2021-05-141-4/+5
|/
* Merge #8799bors[bot]2021-05-121-6/+20
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 8799: Add basic support for array lengths in types r=flodiebold a=lf- This recognizes `let a = [1u8, 2, 3]` as having type `[u8; 3]` instead of the previous `[u8; _]`. Byte strings and `[0u8; 2]` kinds of range array declarations are unsupported as before. I don't know why a bunch of our rustc tests had single quotes inside strings un-escaped by `UPDATE_EXPECT=1 cargo t`, but I don't think it's bad? Maybe something in a nightly? Co-authored-by: Jade <[email protected]>
| * address review by @eddybJade2021-05-111-1/+1
| |
| * Add basic support for array lengths in typesJade2021-05-111-6/+20
| | | | | | | | | | | | | | | | | | | | This recognizes `let a = [1u8, 2, 3]` as having type `[u8; 3]` instead of the previous `[u8; _]`. Byte strings and `[0u8; 2]` kinds of range array declarations are unsupported as before. I don't know why a bunch of our rustc tests had single quotes inside strings un-escaped by `UPDATE_EXPECT=1 cargo t`, but I don't think it's bad? Maybe something in a nightly?
* | Fix inference with conditionally compiled tailsDaniel McNab2021-05-031-1/+1
|/ | | | Fixes #8378
* fix: closure unify without check ClosureIdComonad2021-04-291-0/+4
| | | | closes #8604
* Move ToChalk -> mappingFlorian Diebold2021-04-091-1/+1
|
* Reorganize hir_ty modulesFlorian Diebold2021-04-091-1/+2
| | | | | Chalk isn't really a 'traits' thing anymore, so it doesn't make sense to have all the Chalk-related stuff in submodules of `traits`.
* CleanupFlorian Diebold2021-04-081-1/+5
|
* Intern SubstitutionsFlorian Diebold2021-04-083-4/+4
| | | | (Costs a bit of performance, reduces memory usage on RA by ~10%.)
* Remove unusedFlorian Diebold2021-04-083-4/+3
|
* Fix `Canonicalized::apply_solution`Florian Diebold2021-04-081-13/+16
| | | | | | Now that we're using Chalk's `substitute` which actually knows about lifetimes, the hack doesn't work anymore, but we can put in a proper lifetime.
* Fix missing match armsFlorian Diebold2021-04-081-0/+1
|
* Fix remaining `interned_mut` callFlorian Diebold2021-04-081-4/+6
|
* Replace remaining `fold` callsFlorian Diebold2021-04-081-49/+62
|
* Replace some `fold` callsFlorian Diebold2021-04-081-15/+4
|
* Fix shifted_{in,out} callsFlorian Diebold2021-04-081-1/+1
|
* Add HasInterner boundsFlorian Diebold2021-04-081-4/+12
|
* Merge #8409bors[bot]2021-04-073-3/+4
|\ | | | | | | | | | | | | | | 8409: Various remaining fixes for Chalk IR move r=flodiebold a=flodiebold CC #8313 Co-authored-by: Florian Diebold <[email protected]>
| * Fix return type of Substitution::internedFlorian Diebold2021-04-071-1/+1
| |
| * InEnvironment::new takes a referenceFlorian Diebold2021-04-071-1/+1
| |
| * Move hir_trait_id to extension traitFlorian Diebold2021-04-071-1/+2
| |
* | Move `equals_ctor` to `TyExt`Florian Diebold2021-04-071-1/+2
|/ | | | | | I'd prefer getting rid of it, but it's used in the impl search and not super easy to replace there (I think ideally the impl search would do proper unification, but that's a bit more complicated).
* Remove Ty::substs{_mut}Florian Diebold2021-04-072-3/+8
| | | | | | Almost all uses actually only care about ADT substs, so it's better to be explicit. The methods were a bad abstraction anyway since they already didn't include the inner types of e.g. `TyKind::Ref` anymore.
* Remove `SolutionVariables`, add ConstrainedSubst analogous to ChalkFlorian Diebold2021-04-061-2/+9
| | | | ... just missing the constraints.