aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/infer
Commit message (Collapse)AuthorAgeFilesLines
* Merge #2592bors[bot]2019-12-201-4/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2592: Add std::ops::Index support for infering r=edwin0cheng a=edwin0cheng see also #2534 Seem like this can't fix #2534 for this case: ```rust fn foo3(bar: [usize; 2]) { let baz = bar[1]; // <--- baz is still unknown ? println!("{}", baz); } ``` Co-authored-by: Edwin Cheng <[email protected]>
| * Add std::ops::Index support for inferingEdwin Cheng2019-12-191-4/+8
| |
* | Introduce `ContainerId`Aleksey Kladov2019-12-201-1/+1
| |
* | Rename ContainerId -> AssocContainerIdAleksey Kladov2019-12-202-6/+6
| |
* | Add body as a possible container for itemsAleksey Kladov2019-12-191-1/+1
| |
* | Forbid <T>::foo syntax in mod pathsAleksey Kladov2019-12-181-2/+2
|/
* Handle impl Trait more correctlyFlorian Diebold2019-12-151-0/+1
| | | | | | | When calling a function, argument-position impl Trait is transparent; same for return-position impl Trait when inside the function. So in these cases, we need to represent that type not by `Ty::Opaque`, but by a type variable that can be unified with whatever flows into there.
* Use different types for path with and without genericsAleksey Kladov2019-12-141-12/+13
|
* Rename N! to name!Florian Diebold2019-12-131-2/+2
|
* Add macros for known names and pathsFlorian Diebold2019-12-131-2/+2
|
* Correctly infer - and ! using std::ops::{Neg,Not}Emil Lauridsen2019-12-131-21/+26
|
* Add helper for resolving associated type of trait in inferEmil Lauridsen2019-12-131-47/+7
|
* Fix coercion from &Foo to an inference variable in a referenceFlorian Diebold2019-12-081-1/+5
| | | | We didn't try to unify within the reference, but we should.
* Refactor parameter count trackingAleksey Kladov2019-12-071-10/+8
|
* Remove idx and parent generics from genericsAleksey Kladov2019-12-071-11/+13
| | | | | This makes `hir_def::GenericParams` flatter. The logic for re-numbering the params is moved to hir instead.
* Store GenericParams in arenaAleksey Kladov2019-12-071-1/+1
|
* Don't unify within a referenceFlorian Diebold2019-12-061-11/+10
| | | | | | | If we are expecting a `&Foo` and get a `&something`, when checking the `something`, we are *expecting* a `Foo`, but we shouldn't try to unify whatever we get with that expectation, because it could actually be a `&Foo`, and `&&Foo` coerces to `&Foo`. So this fixes quite a few false type mismatches.
* Fix #2467Florian Diebold2019-12-032-3/+14
| | | | | The stand-alone `unify` requires that the type doesn't contain any type variables. So we can't share the code here for now (without more refactoring)...
* Refactor a bitFlorian Diebold2019-12-021-35/+3
|
* Check receiver type properlyFlorian Diebold2019-12-022-9/+13
|
* Extract unification code to unify moduleFlorian Diebold2019-12-025-30/+290
|
* Handle cycles in impl types betterFlorian Diebold2019-11-302-6/+3
| | | | | | - impl Trait<Self> for S is allowed - impl Trait for S<Self> is an invalid cycle, but we can add cycle recovery for it in Salsa now
* Reduce variants of Exproxalica2019-11-291-39/+37
|
* Infer range typesoxalica2019-11-281-0/+41
|
* Memoize impl resolutionsAleksey Kladov2019-11-272-22/+10
|
* Move TyAleksey Kladov2019-11-275-0/+1658