| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This adds the type inference to Union types and add a small test case
for it, ensuring it keeps working in future.
Fixes: #5277
Signed-off-by: Otavio Salvador <[email protected]>
|
|
|
|
| |
Removes redundant clones
|
|
|
|
|
|
|
|
|
| |
This means we need to keep track of the kinds (general/int/float) of variables
in `Canonical`, which requires some more ceremony. (It also exposes some places
where we're not really dealing with canonicalization correctly -- another thing
to be cleaned up when we switch to using Chalk's types directly.)
Should fix the last remaining issue of #2534.
|
| |
|
| |
|
|
|
|
| |
exprs within unsafe block
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixes #4953.
|
|
|
|
|
|
| |
'Unknown' int/float types actually never exist as such, they get replaced by
type variables immediately. So the whole `Uncertain<IntTy>` thing was
unnecessary and just led to a bunch of match branches that were never hit.
|
|
|
|
|
| |
They should not be applied in expression or pattern contexts, unless there are
other explicitly given type args.
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| | |
4653: Fix match ergonomics in closure parameters r=matklad a=flodiebold
Fixes #4476.
Co-authored-by: Florian Diebold <[email protected]>
|
| |
| |
| |
| | |
Fixes #4476.
|
|\ \
| |/
|/|
| |
| |
| |
| |
| |
| |
| |
| | |
4651: Use first match branch in case of type mismatch, not last r=kjeremy a=flodiebold
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.
Co-authored-by: Florian Diebold <[email protected]>
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
I.e.
- `Self(x)` or `Self` in tuple/unit struct impls
- `Self::Variant(x)` or `Self::Variant` in enum impls
- the same in patterns
Fixes #4454.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
| |
Still no break-with-value or labels, but at least we know that `loop { break; }`
doesn't diverge.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
They're `&[u8; N]`, not `&[u8]` (see #4374).
|
|
|
|
|
| |
This reverts commit a5f2b16366f027ad60c58266a66eb7fbdcbda9f9, reversing
changes made to c96b2180c1c4206a0a98c280b4d30897eb116336.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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...)
|
|
|
|
| |
+ various fixes related to that.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
| |
To do this we need to carry around the original resolution a bit, because `Self`
gets resolved to the actual type immediately, but you're not allowed to write
the equivalent type in a projection. (I tried just comparing the projection base
type with the impl self type, but that seemed too dirty.) This is basically how
rustc does it as well.
Fixes #3249.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
3397: Minimal viable meta r=matklad a=matklad
bors r+
🤖
3398: Reformat? r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
|