aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/lower.rs
Commit message (Collapse)AuthorAgeFilesLines
* Fix type parameter defaultsFlorian Diebold2020-06-051-24/+46
| | | | | They should not be applied in expression or pattern contexts, unless there are other explicitly given type args.
* Review fixesFlorian Diebold2020-06-051-5/+4
|
* Implement return position impl trait / opaque type supportFlorian Diebold2020-06-051-21/+122
| | | | | | | | | | | | | This is working, but I'm not that happy with how the lowering works. We might need an additional representation between `TypeRef` and `Ty` where names are resolved and `impl Trait` bounds are separated out, but things like inference variables don't exist and `impl Trait` is always represented the same way. Also note that this doesn't implement correct handling of RPIT *inside* the function (which involves turning the `impl Trait`s into variables and creating obligations for them). That intermediate representation might help there as well.
* Switch to new magic marksAleksey Kladov2020-05-201-1/+1
|
* Rename to associated_type_shorthand_candidatesJonas Schievink2020-04-291-25/+26
|
* Complete assoc. items on type parametersJonas Schievink2020-04-291-56/+88
|
* For associated type shorthand (T::Item), use the substs from the where clauseFlorian Diebold2020-04-261-13/+29
| | | | | So e.g. if we have `fn foo<T: SomeTrait<u32>>() -> T::Item`, we want to lower that to `<T as SomeTrait<u32>>::Item` and not `<T as SomeTrait<_>>::Item`.
* Rename StructField -> FieldAleksey Kladov2020-04-251-3/+3
|
* Fix another crash from wrong bindersFlorian Diebold2020-04-171-20/+49
| | | | | | | Basically, if we had something like `dyn Trait<T>` (where `T` is a type parameter) in an impl we lowered that to `dyn Trait<^0.0>`, when it should be `dyn Trait<^1.0>` because the `dyn` introduces a new binder. With one type parameter, that's just wrong, with two, it'll lead to crashes.
*-. Merge #3964 #3965 #3967bors[bot]2020-04-151-8/+34
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3964: Nicer Chalk debug logs r=matklad a=flodiebold I'm looking at a lot of Chalk debug logs at the moment, so here's a few changes to make them slightly nicer... 3965: Implement inline associated type bounds r=matklad a=flodiebold Like `Iterator<Item: SomeTrait>`. This is an unstable feature, but it's used in the standard library e.g. in the definition of Flatten, so we can't get away with not implementing it :) (This is cherry-picked from my recursive solver branch, where it works better, but I did manage to write a test that works with the current Chalk solver as well...) 3967: Handle `Self::Type` in trait definitions when referring to own associated type r=matklad a=flodiebold It was implemented for other generic parameters for the trait, but not for `Self`. (Last one off my recursive solver branch :smile: ) Co-authored-by: Florian Diebold <[email protected]>
| | * Handle `Self::Type` in trait definitions when referring to own associated typeFlorian Diebold2020-04-131-2/+12
| |/ |/| | | | | It was implemented for other generic parameters for the trait, but not for `Self`.
| * Implement inline associated type boundsFlorian Diebold2020-04-131-6/+22
|/ | | | | | | Like `Iterator<Item: SomeTrait>`. This is an unstable feature, but it's used in the standard library e.g. in the definition of Flatten, so we can't get away with not implementing it :)
* Upgrade Chalk againFlorian Diebold2020-04-051-13/+15
| | | | | | | 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.
* Use `dyn Trait` for working with databseAleksey Kladov2020-03-161-112/+108
| | | | | | | 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).
* Resolve `Self::AssocTy` in implsFlorian Diebold2020-03-061-36/+50
| | | | | | | | | | 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.
* Rework find_super_trait_path to protect against cyclesFlorian Diebold2020-02-221-1/+2
|
* Fix wrong handling of bare `dyn Trait` exposed by canonicalizer fixFlorian Diebold2020-02-221-1/+3
| | | | | The self type in the `dyn Trait` trait ref should always be ^0, but we didn't put that in there in the bare case.
* Run cargo +nightly fix --clippy -Z unstable-optionsKirill Bulatov2020-02-181-12/+10
|
* use 'if let' instead of match on kind in lower.rsadamrk2020-02-171-6/+4
|
* replace uses of VariantData::is_unit with VariantData::kindadamrk2020-02-161-4/+7
|
* Make Self implement the trait inside trait default methodsFlorian Diebold2020-02-141-4/+28
|
* Rename Ty::Param => Ty::PlaceholderFlorian Diebold2020-02-141-4/+4
| | | | This aligns more with Chalk.
* Fix some TODOsFlorian Diebold2020-02-071-3/+7
|
* Deal better with implicit type parameters and argument listsFlorian Diebold2020-02-071-20/+21
|
* FormattingFlorian Diebold2020-02-071-2/+6
|
* Fix compilation of other cratesFlorian Diebold2020-02-071-2/+2
|
* Use variables in predicates as wellFlorian Diebold2020-02-071-32/+41
|
* Comment fixes / todosFlorian Diebold2020-02-071-6/+5
|
* Fix APIT some moreFlorian Diebold2020-02-071-3/+2
|
* Fix APITFlorian Diebold2020-02-071-0/+2
|
* Change Ty::Param to contain param IDFlorian Diebold2020-02-071-49/+59
|
* WIP use params for APITFlorian Diebold2020-02-071-0/+10
|
* Fix assoc type selectionFlorian Diebold2020-02-071-29/+40
|
* First stab at desugaring bounds for APITFlorian Diebold2020-02-071-3/+26
|
* Fix crashFlorian Diebold2020-02-071-4/+7
|
* Fix enum constructorsFlorian Diebold2020-02-071-6/+4
|
* Lower impl trait to variables, move away from using placeholders where they ↵Florian Diebold2020-02-071-122/+141
| | | | don't belong
* wip lower impl trait to type argsFlorian Diebold2020-02-071-0/+1
|
* wip implement lowering modeFlorian Diebold2020-02-071-6/+26
|
* Add impl trait lowering modeFlorian Diebold2020-02-071-18/+80
|
* Introduce TyLoweringContextFlorian Diebold2020-02-071-122/+110
|
* Fix #2705Florian Diebold2020-01-031-1/+1
| | | | | | | | The `-` turned into a `+` during a refactoring. The original issue was caused by `Read` resolving wrongly to a trait without type parameters instead of a struct with one parameter; this only fixes the crash, not the wrong resolution.
* Support for nested ADTAleksey Kladov2019-12-201-2/+2
|
* Forbid <T>::foo syntax in mod pathsAleksey Kladov2019-12-181-3/+3
|
* Use different types for path with and without genericsAleksey Kladov2019-12-141-36/+34
|
* Move enum&union to new locAleksey Kladov2019-12-121-4/+5
|
* Move structs to new locAleksey Kladov2019-12-121-1/+1
|
* Refactor parameter count trackingAleksey Kladov2019-12-071-7/+6
|
* Remove idx and parent generics from genericsAleksey Kladov2019-12-071-16/+19
| | | | | This makes `hir_def::GenericParams` flatter. The logic for re-numbering the params is moved to hir instead.
* Add cycle recovery for type aliasesFlorian Diebold2019-11-301-0/+5
|