aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
Commit message (Collapse)AuthorAgeFilesLines
* Add type_mismatches to InferenceResult and use this in ok-wrapping code fixPhil Ellison2019-08-251-1/+18
|
* rename struct -> record, pos -> tupleAleksey Kladov2019-08-231-6/+6
|
* Improve/fix type bound loweringFlorian Diebold2019-08-221-0/+33
|
* Handle impl/dyn Trait in method resolutionFlorian Diebold2019-08-222-32/+66
| | | | | | | | | | | | | When we have one of these, the `Trait` doesn't need to be in scope to call its methods. So we need to consider this when looking for method candidates. (Actually I think the same is true when we have a bound `T: some::Trait`, but we don't handle that yet). At the same time, since Chalk doesn't handle these types yet, add a small hack to skip Chalk in method resolution and just consider `impl Trait: Trait` always true. This is enough to e.g. get completions for `impl Trait`, but since we don't do any unification we won't infer the return type of e.g. `impl Into<i64>::into()`.
* Add `impl Trait` and `dyn Trait` typesFlorian Diebold2019-08-223-12/+177
| | | | | | | - refactor bounds handling in the AST a bit - add HIR for bounds - add `Ty::Dyn` and `Ty::Opaque` variants and lower `dyn Trait` / `impl Trait` syntax to them
* Don't add `?` bounds as real boundsAleksey Kladov2019-08-221-0/+29
| | | | closes #1709
* implement initial type inference for index expressionsAleksey Kladov2019-08-172-0/+20
|
* normalize ordering opsAleksey Kladov2019-08-171-16/+16
|
* Introduce separate hir::BinaryOpAleksey Kladov2019-08-172-67/+21
| | | | | Unlike ast::BinOp, it has significantly more structure to it, so it's easier to, say, handle all assignment-like operations in the same way.
* Merge #1691bors[bot]2019-08-161-0/+9
|\ | | | | | | | | | | | | | | 1691: Show inherent and trait impls of structs and enums r=viorina a=viorina Co-authored-by: Ekaterina Babshukova <[email protected]>
| * show inherent and trait impls of structs and enumsEkaterina Babshukova2019-08-161-0/+9
| |
* | implement durabilityAleksey Kladov2019-08-151-1/+1
| |
* | switch from volatile to untracked readAleksey Kladov2019-08-151-17/+37
|/
* Handle placeholder assoc types when Chalk produces themFlorian Diebold2019-08-122-3/+67
|
* Normalize assoc types in more placesFlorian Diebold2019-08-122-12/+27
|
* Improve debug logging a bitFlorian Diebold2019-08-121-4/+4
|
* Normalize associated types during inferenceFlorian Diebold2019-08-123-9/+25
|
* Lower fully qualified associated type pathsFlorian Diebold2019-08-122-22/+80
| | | | I.e. `<T as Trait>::Foo`.
* Add representations of associated typesFlorian Diebold2019-08-121-0/+23
| | | | | | | | | | | | This adds three different representations, copied from the Chalk model: - `Ty::Projection` is an associated type projection written somewhere in the code, like `<Foo as Trait>::Bar`. - `Ty::UnselectedProjection` is similar, but we don't know the trait yet (`Foo::Bar`). - The above representations are normalized to their actual types during type inference. When that isn't possible, for example for `T::Item` inside an `fn foo<T: Iterator>`, the type is normalized to an application type with `TypeCtor::AssociatedType`.
* Add another test for assoc type resolutionFlorian Diebold2019-08-121-6/+46
|
* implement while let desugaringAleksey Kladov2019-08-071-0/+20
|
* do fixup: remove unused importEvgenii P2019-08-021-1/+1
|
* Relax trait solving more for completionEvgenii P2019-08-021-7/+1
|
* rustfmtEvgenii P2019-08-021-3/+9
|
* Implement completion for the .await syntaxEvgenii P2019-08-021-1/+15
|
* Move assist test, add literal type inference testPhil Ellison2019-07-291-11/+15
|
* Merge #1570bors[bot]2019-07-211-4/+2
|\ | | | | | | | | | | | | | | 1570: switch to upstream rowan's API r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * streamline APIAleksey Kladov2019-07-211-4/+2
| |
* | provide completion in struct patternsEkaterina Babshukova2019-07-211-7/+15
|/
* Merge #1562bors[bot]2019-07-202-0/+76
|\ | | | | | | | | | | | | | | | | 1562: Continue support for .await r=matklad a=unrealhoang - add await expr to ast and HIR Expr - infer type for `.await` Co-authored-by: Unreal Hoang <[email protected]>
| * infer type for awaitUnreal Hoang2019-07-202-2/+75
| | | | | | | | by projecting inner_ty to Future::Output alias
| * add await expr to astUnreal Hoang2019-07-201-0/+3
| |
* | rename range -> text_rangeAleksey Kladov2019-07-201-1/+1
|/
* migrate ra_hir to the new rowanAleksey Kladov2019-07-191-5/+5
|
* Switch to Chalk master, without fuelFlorian Diebold2019-07-151-1/+1
|
* Remove blacklist, instead mark `Sized` as non-enumerableFlorian Diebold2019-07-151-17/+3
| | | | | This seems to be enough to prevent hanging in rust-analyzer, Chalk and the rustc repo.
* Cargo update, including updating ChalkFlorian Diebold2019-07-141-0/+2
|
* Have InferenceContext contain an InferenceResult instead of duplicating all ↵Florian Diebold2019-07-141-36/+19
| | | | fields
* Some renamings for clarityFlorian Diebold2019-07-146-19/+22
|
* complete fields in enum variantsEkaterina Babshukova2019-07-121-0/+15
|
* fix profile nameAleksey Kladov2019-07-091-1/+1
|
* Merge #1515bors[bot]2019-07-098-106/+281
|\ | | | | | | | | | | | | | | | | | | | | | | 1515: Trait environment r=matklad a=flodiebold This adds the environment, i.e. the set of `where` clauses in scope, when solving trait goals. That means that e.g. in ```rust fn foo<T: SomeTrait>(t: T) {} ``` , we are able to complete methods of `SomeTrait` on the `t`. This affects the trait APIs quite a bit (since every method that needs to be able to solve for some trait needs to get this environment somehow), so I thought I'd do it rather sooner than later ;) Co-authored-by: Florian Diebold <[email protected]>
| * Unify `normalize` and `implements` to simplify codeFlorian Diebold2019-07-086-94/+62
| |
| * Use environment for associated type normalization as wellFlorian Diebold2019-07-086-19/+51
| |
| * Start handling environment in trait resolutionFlorian Diebold2019-07-086-14/+103
| | | | | | | | | | I.e. if we are inside a function with some where clauses, we assume these where clauses hold.
| * Refactor a bit & introduce Environment structFlorian Diebold2019-07-085-19/+105
| |
* | Merge #1512bors[bot]2019-07-092-17/+103
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 1512: Infer ? operator r=unrealhoang a=unrealhoang Logical continuation of https://github.com/rust-analyzer/rust-analyzer/pull/1501 cc https://github.com/rust-analyzer/rust-analyzer/issues/1426 Co-authored-by: Unreal Hoang <[email protected]>
| * | beautify testsUnreal Hoang2019-07-091-20/+36
| | |
| * | use namespaced consts for KnownNameUnreal Hoang2019-07-081-12/+10
| | |
| * | projection over std::ops::Try::Ok to infer try/?Unreal Hoang2019-07-082-2/+74
| |/