aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/method_resolution.rs
Commit message (Collapse)AuthorAgeFilesLines
* Look up impls by self typeFlorian Diebold2020-04-111-5/+40
| | | | | This speeds up inference in analysis-stats by ~30% (even more with the recursive solver).
* Upgrade Chalk againFlorian Diebold2020-04-051-7/+9
| | | | | | | The big change here is counting binders, not variables (https://github.com/rust-lang/chalk/pull/360). We have to adapt to the same scheme for our `Ty::Bound`. It's mostly fine though, even makes some things more clear.
* ra_hir_ty: fix formattingveetaha2020-03-221-8/+8
|
* Use `dyn Trait` for working with databseAleksey Kladov2020-03-161-23/+20
| | | | | | | It improves compile time in `--release` mode quite a bit, it doesn't really slow things down and, conceptually, it seems closer to what we want the physical architecture to look like (we don't want to monomorphise EVERYTHING in a single leaf crate).
* Fix completion with a partially unknown typeFlorian Diebold2020-03-101-3/+25
| | | | | | | | | | | | | | To test whether the receiver type matches for the impl, we unify the given self type (in this case `HashSet<{unknown}>`) with the self type of the impl (`HashSet<?0>`), but if the given self type contains Unknowns, they won't be unified with the variables in those places. So we got a receiver type that was different from the expected one, and concluded the impl doesn't match. The fix is slightly hacky; if after the unification, our variables are still there, we make them fall back to Unknown. This does make some sense though, since we don't want to 'leak' the variables. Fixes #3547.
* Fix #3373Florian Diebold2020-03-011-3/+10
| | | | | | | Basically, we need to allow variables in the caller self type to unify with the impl's declared self type. That requires some more contortions in the variable handling. I'm looking forward to (hopefully) handling this in a cleaner way when we switch to Chalk's types and unification code.
* Do autoderef for indexingFlorian Diebold2020-02-291-0/+19
|
* Do array unsizing for method receiversFlorian Diebold2020-02-291-2/+19
| | | | | | | It turns out rustc actually only unsizes array method receivers, so we don't need to do any trait solving for this (at least for now). Fixes #2670.
* Rename ast::ImplBlock -> ast::ImplDefAleksey Kladov2020-02-291-12/+11
|
* Exclude methods from non-parameter types introduced by generic constraintsLaurențiu Nicola2020-02-191-6/+11
|
* Run cargo +nightly fix --clippy -Z unstable-optionsKirill Bulatov2020-02-181-6/+6
|
* Check that impl self type matches up with expected self type in path modeFlorian Diebold2020-02-141-0/+9
| | | | Fixes #3144.
* Change Ty::Param to contain param IDFlorian Diebold2020-02-071-1/+1
|
* Lower impl trait to variables, move away from using placeholders where they ↵Florian Diebold2020-02-071-2/+2
| | | | don't belong
* Push resolver further upAleksey Kladov2020-01-141-17/+24
|
* Push resolver upAleksey Kladov2020-01-141-21/+51
|
* Move impls_future to Type, where it belongsAleksey Kladov2020-01-141-2/+1
|
* Move impls to ItemScopeAleksey Kladov2019-12-201-1/+1
|
* Use generic ItemLoc for implsAleksey Kladov2019-12-201-1/+1
|
* Introduce `ContainerId`Aleksey Kladov2019-12-201-1/+1
|
* Rename ContainerId -> AssocContainerIdAleksey Kladov2019-12-201-5/+5
|
* Add body as a possible container for itemsAleksey Kladov2019-12-191-5/+5
|
* Switch to the new location for implsAleksey Kladov2019-12-121-3/+3
|
* Fix #2467Florian Diebold2019-12-031-4/+4
| | | | | 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-42/+56
|
* Check receiver type properlyFlorian Diebold2019-12-021-8/+63
|
* Change order of calls to get method candidate order correctFlorian Diebold2019-12-021-37/+115
|
* Handle cycles in impl types betterFlorian Diebold2019-11-301-4/+5
| | | | | | - 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
* Memoize impl resolutionsAleksey Kladov2019-11-271-20/+10
|
* Move TyAleksey Kladov2019-11-271-0/+363