aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/tests/simple.rs
Commit message (Collapse)AuthorAgeFilesLines
* Use first match branch in case of type mismatch, not lastFlorian Diebold2020-05-291-1/+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.
* loop return value inference: add testsRoland Ruckerbauer2020-05-191-0/+63
|
* Handle `Self` in values and patternsFlorian Diebold2020-05-151-0/+44
| | | | | | | | | 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.
* infer: Make expected rhs type for plain assign the lhs typeEmil Lauridsen2020-05-101-0/+29
| | | | | | | | | | | | | This fixes an issue where the following code sample would fail to infer the type contained in the option: ```rust fn main() { let mut end = None; // TODO: Fix inference for this in RA loop { end = Some(true); } } ```
* Implement better handling of divergenceFlorian Diebold2020-05-081-5/+5
| | | | | | | | 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.
* Fix type of byte literalsFlorian Diebold2020-05-081-2/+2
| | | | They're `&[u8; N]`, not `&[u8]` (see #4374).
* Add smoke test for decorated blocksAleksey Kladov2020-05-021-0/+32
|
* Convert tests to text-sizeAleksey Kladov2020-04-251-680/+680
|
* Hide unit fn return typesLaurențiu Nicola2020-04-051-3/+3
|
* Fix inference of function pointer return typesLaurențiu Nicola2020-04-051-0/+26
|
* Add inference for literal and range patternsFlorian Diebold2020-04-011-0/+2
|
* Support aliases and Self in struct literalsFlorian Diebold2020-03-061-0/+41
| | | | Fixes #3306.
* Fix enum constructorsFlorian Diebold2020-02-071-4/+4
|
* Fix printing of function typesFlorian Diebold2020-02-071-16/+16
|
* Lower impl trait to variables, move away from using placeholders where they ↵Florian Diebold2020-02-071-1/+1
| | | | don't belong
* Standard formatting for array typesAleksey Kladov2020-01-281-35/+35
|
* Fix inference for shift operatorsFlorian Diebold2020-01-171-0/+21
| | | | Fixes #2602.
* Resolve traits in infer using lang item infrastructureEmil Lauridsen2019-12-291-0/+1
|
* Don't add non-impl/trait containers to scopeAleksey Kladov2019-12-291-0/+3
|
* Rudimentary name resolution for local itemsAleksey Kladov2019-12-221-6/+6
|
* Handle closure return typesFlorian Diebold2019-12-201-0/+55
| | | | Fixes #2547.
* Split up ty tests a bitFlorian Diebold2019-12-031-0/+1608