aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty.rs
Commit message (Collapse)AuthorAgeFilesLines
* Implement a very naive implements checkFlorian Diebold2019-03-251-4/+19
| | | | ... to make the infer_trait_method_simple test have the correct result.
* Assert in apply_substs that the number of parameters doesn't changeFlorian Diebold2019-03-211-1/+6
| | | | ... and fix a small bug revealed by that.
* Rename name field to ctor as wellFlorian Diebold2019-03-211-14/+14
|
* Some more doc commentsFlorian Diebold2019-03-211-2/+12
|
* TypeName => TypeCtorFlorian Diebold2019-03-211-24/+24
|
* Remove the old variants replaced by Ty::ApplyFlorian Diebold2019-03-211-197/+41
|
* Add Ty::ApplyFlorian Diebold2019-03-211-1/+177
|
* Represent FnPtr and Tuple using SubstsFlorian Diebold2019-03-211-15/+19
|
* Remove FnSig from FnDef typeFlorian Diebold2019-03-161-12/+6
| | | | | It doesn't need to be in there since it's just information from the def. Another step towards aligning Ty with Chalk's representation.
* Refactor FnSig a bitFlorian Diebold2019-03-161-34/+47
|
* Some more Ty displaying cleanupFlorian Diebold2019-03-161-2/+2
|
* Replace Display by a pretty printing trait for TyFlorian Diebold2019-03-161-34/+60
| | | | | This allows removing the names from Adt and FnDef (and more later), as a first step towards aligning more with chalk's Ty :)
* Represent unknown types as {unknown} instead of [unknown]Florian Diebold2019-03-031-1/+1
| | | | Since the latter could actually be a real type...
* A bit of cleanup in ty.rsFlorian Diebold2019-03-021-28/+1
|
* Split ty.rs into several modulesFlorian Diebold2019-02-231-1450/+18
| | | | | | | | | It was just getting too big. We now have: - ty: the `Ty` enum and helpers - ty::infer: actual type inference - ty::lower: lowering from HIR to `Ty` - ty::op: helpers for binary operations, currently
* Fix resolution of associated method calls across cratesFlorian Diebold2019-02-231-0/+9
| | | | | | I think it'll be better to make the path resolution the number of unresolved segments, not the first unresolved index; then this error could simply not have happened. But I'll do that separately.
* Merge #866bors[bot]2019-02-221-6/+46
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 866: Implement basic support for Associated Methods r=flodiebold a=vipentti This is my attempt at learning to understand how the type inference works by adding basic support for associated methods. Currently it does not resolve associated types or constants. The basic idea is that `Resolver::resolve_path` returns a new `PathResult` type, which has two variants, `FullyResolved` and `PartiallyResolved`, fully resolved matches the previous behavior, where as `PartiallyResolved` contains the `PerNs<Resolution` in addition to a `segment_index` which contains the index of the segment which we failed to resolve. This index can then be used to continue inference in `infer_path_expr` using the `Type` we managed to resolve. This changes some of the previous apis, so looking for feedback and suggestions. This should enable fixing #832 Co-authored-by: Ville Penttinen <[email protected]>
| * Change resolve_path to return the fully resolved path or PerNs::noneVille Penttinen2019-02-221-20/+19
| | | | | | | | | | | | This also adds new pub(crate) resolve_path_segments which returns the PathResult, which may or may not be fully resolved. PathResult is also now pub(crate) since it is an implementation detail.
| * Remove Const inference for now, refactor PathResultVille Penttinen2019-02-211-36/+19
| |
| * Implement basic support for Associated Methods and ConstantsVille Penttinen2019-02-211-25/+83
| | | | | | | | | | | | | | This is done in `infer_path_expr`. When `Resolver::resolve_path` returns `PartiallyResolved`, we use the returned `Resolution` together with the given `segment_index` to check if we can find something matching the segment at segment_index in the impls for that particular type.
* | Add an assert (and fix the other)Florian Diebold2019-02-211-1/+2
| |
* | Fix handling of generics in tuple variants and refactor a bitFlorian Diebold2019-02-201-38/+45
|/ | | | | | Also make them display a tiny bit nicer. Fixes #860.
* Merge #852bors[bot]2019-02-181-0/+1
|\ | | | | | | | | | | | | | | 852: Handle != r=flodiebold a=matklad r? @flodiebold Co-authored-by: Aleksey Kladov <[email protected]>
| * handle != operatorAleksey Kladov2019-02-181-0/+1
| |
* | Handle tuple structs / enum variants properly in type inferenceFlorian Diebold2019-02-171-21/+75
|/
* Unify with the autorefed/autoderefed receiver type during method resolutionFlorian Diebold2019-02-171-7/+11
|
* Handle generic args for method callsFlorian Diebold2019-02-161-4/+34
|
* Handle impl generics in method callsFlorian Diebold2019-02-161-5/+10
|
* Fix another crashFlorian Diebold2019-02-121-2/+2
|
* Spell cases explicitly in Ty::walk{_mut}Florian Diebold2019-02-101-2/+18
|
* Add an ra_cli command that analyses all crates in the current workspaceFlorian Diebold2019-02-101-0/+35
| | | | ... and prints various stats about how many expressions have a type etc.
* Add comment and markFlorian Diebold2019-02-091-2/+8
|
* Fix another crash, and try harder to prevent stack overflowsFlorian Diebold2019-02-091-7/+20
|
* Fix two crashes found by running inference on all of rustcFlorian Diebold2019-02-091-15/+24
|
* reformat the worldAleksey Kladov2019-02-081-187/+62
|
* Some clippy cleanupskjeremy2019-02-061-4/+4
|
* Make the Resolution variants tuple variantsFlorian Diebold2019-02-011-9/+9
|
* Use new Resolver API in type inferenceFlorian Diebold2019-02-011-157/+113
|
* split HirDatabase apicsmoe2019-02-011-1/+1
|
* Merge #701bors[bot]2019-01-301-3/+13
|\ | | | | | | | | | | | | | | | | | | 701: Minor type inference tweaks r=flodiebold a=marcusklaas Pass down expectation for reference expressions and type the guard in match expressions. I wasn't able to add a test for the former addition because the type variable previously introduced would always resolve to the right type in the things I tried! Co-authored-by: Marcus Klaas de Vries <[email protected]>
| * Infer type of match guardMarcus Klaas de Vries2019-01-281-3/+13
| |
* | Rename FnScopes -> ExprScopesFlorian Diebold2019-01-301-4/+4
| | | | | | | | | | The reason for this is that it describes scopes for any body expression, not just that of a function. It did not actually refer to functions at all anymore.
* | Use match-all instead of individual branchesWizardOfMenlo2019-01-281-5/+1
| |
* | Added support for primitive types type inference when using std::ops::NotWizardOfMenlo2019-01-281-3/+11
| |
* | Process second reviewMarcus Klaas de Vries2019-01-271-35/+28
| |
* | Use type information from the turbofishMarcus Klaas de Vries2019-01-271-6/+28
| |
* | Add a FnSig to Ty::FnDefMarcus Klaas de Vries2019-01-271-38/+64
| |
* | Address some issues flagged in reviewMarcus Klaas de Vries2019-01-271-25/+18
| |
* | Add type params to FnSignatureMarcus Klaas de Vries2019-01-271-81/+45
| |
* | Initial implementation of generics for method callsMarcus Klaas de Vries2019-01-271-13/+68
| |