aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/infer/coerce.rs
Commit message (Collapse)AuthorAgeFilesLines
* Use first match branch in case of type mismatch, not lastFlorian Diebold2020-05-291-3/+1
| | | | | | | The comment says this was intentional, but I do agree with #4304 that it makes more sense the other way around (for if/else as well). Fixes #4304.
* Switch to new magic marksAleksey Kladov2020-05-201-3/+3
|
* Handle coercing function types to function pointers in matchFlorian Diebold2020-05-081-11/+23
| | | | | | | | | | | | E.g. in ```rust match x { 1 => function1, 2 => function2, } ``` we need to try coercing both to pointers. Turns out this is a special case in rustc as well (see the link in the comment).
* Fix type equality for dyn TraitFlorian Diebold2020-04-171-2/+2
| | | | | | | Fixes a lot of false type mismatches. (And as always when touching the unification code, I have to say I'm looking forward to replacing it by Chalk's...)
* Use `dyn Trait` for working with databseAleksey Kladov2020-03-161-5/+3
| | | | | | | 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).
* Implement unsize coercion using proper trait solvingFlorian Diebold2020-02-221-179/+26
|
* More manual clippy fixesKirill Bulatov2020-02-181-4/+3
|
* Run cargo +nightly fix --clippy -Z unstable-optionsKirill Bulatov2020-02-181-4/+2
|
* FormattingFlorian Diebold2020-02-071-6/+2
|
* Change Ty::Param to contain param IDFlorian Diebold2020-02-071-8/+8
|
* Coerce closures to fn pointersFlorian Diebold2019-12-201-0/+4
| | | | E.g. `let x: fn(A) -> B = |x| { y };`
* 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.
* Check receiver type properlyFlorian Diebold2019-12-021-1/+1
|
* Extract unification code to unify moduleFlorian Diebold2019-12-021-5/+5
|
* Handle cycles in impl types betterFlorian Diebold2019-11-301-5/+2
| | | | | | - 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-16/+6
|
* Move TyAleksey Kladov2019-11-271-0/+354