| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
- add proper canonicalization logic
- add conversions from/to Chalk IR
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- make it possible to get parent trait from method
- add 'obligation' machinery for checking that a type implements a
trait (and inferring facts about type variables from that)
- handle type parameters of traits (to a certain degree)
- improve the hacky implements check to cover enough cases to exercise the
handling of traits with type parameters
- basic canonicalization (will probably also be done by Chalk)
|
| |
|
|
|
|
|
| |
changed the display for fixed array types,
Added Array Enum to ra_hir/expr
|
| |
|
|
|
|
| |
... to make the infer_trait_method_simple test have the correct result.
|
|
|
|
| |
... and fix a small bug revealed by that.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
This allows removing the names from Adt and FnDef (and more later), as a first
step towards aligning more with chalk's Ty :)
|
|
|
|
| |
Since the latter could actually be a real type...
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|/
|
|
|
|
| |
Also make them display a tiny bit nicer.
Fixes #860.
|
|\
| |
| |
| |
| |
| |
| |
| | |
852: Handle != r=flodiebold a=matklad
r? @flodiebold
Co-authored-by: Aleksey Kladov <[email protected]>
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
... and prints various stats about how many expressions have a type etc.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | |
|
| |
| |
| |
| |
| | |
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.
|
| | |
|