| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
| |
Divergence here means that for some reason, the end of a block will not be
reached. We tried to model this just using the never type, but that doesn't work
fully (e.g. in `let x = { loop {}; "foo" };` x should still have type `&str`);
so this introduces a `diverges` flag that the type checker keeps track of, like
rustc does.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
E.g. for `&{ some_string() }` in a context where a `&str` is expected, we
reported a mismatch inside the block. The problem is that we're passing an
expectation of `str` down, but the expectation is more of a hint in this case.
There's a long comment in rustc about this, which I just copied.
Also, fix reported location for type mismatches in macros.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The autoderef coercion logic did not handle matching placeholders. This led to
some type mismatches.
|
| |
|
| |
|
|
|
|
| |
E.g. `let x: fn(A) -> B = |x| { y };`
|
| |
|
|
|
|
| |
Fixes #2547.
|
|
|
|
| |
We didn't try to unify within the reference, but we should.
|
|
|
|
|
|
|
| |
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.
|
|
|