aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/traits
Commit message (Collapse)AuthorAgeFilesLines
* Update ChalkFlorian Diebold2020-05-222-49/+78
| | | | | As always, this just makes compilation work, we don't use the newly available functionality yet.
* Chalk upgradeFlorian Diebold2020-05-161-19/+38
|
* Update Chalk, and cache Chalk env elaboration through a queryFlorian Diebold2020-04-202-25/+153
| | | | This should fix some of the worst performance problems.
* Fix another crash from wrong bindersFlorian Diebold2020-04-171-5/+5
| | | | | | | 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.
* Switch Chalk to recursive solverFlorian Diebold2020-04-161-4/+4
| | | | + various fixes related to that.
* Update ChalkFlorian Diebold2020-04-161-2/+3
|
*-. Merge #3966 #3968bors[bot]2020-04-151-5/+67
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3966: Add support for bounds on associated types in trait definitions r=matklad a=flodiebold E.g. ```rust trait Trait { type Item: SomeOtherTrait; } ``` Note that these don't simply desugar to where clauses; as I understand it, where clauses have to be proved by the *user* of the trait, but these bounds are proved by the *implementor*. (Also, where clauses on associated types are unstable.) (Another one from my recursive solver branch...) 3968: Remove format from syntax_bridge hot path r=matklad a=edwin0cheng Although only around 1% speed up by running: ``` Measure-Command {start-process .\target\release\rust-analyzer "analysis-stats -q ." -NoNewWindow -wait} ``` Co-authored-by: Florian Diebold <[email protected]> Co-authored-by: Edwin Cheng <[email protected]>
| * | Add support for bounds on associated types in trait definitionsFlorian Diebold2020-04-131-5/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | E.g. ``` trait Trait { type Item: SomeOtherTrait; } ``` Note that these don't simply desugar to where clauses; as I understand it, where clauses have to be proved by the *user* of the trait, but these bounds are proved by the *implementor*. (Also, where clauses on associated types are unstable.)
| | |
| \ \
*-. | | Merge #3964 #3965 #3967bors[bot]2020-04-151-10/+32
|\ \| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
| * | | Nicer display of projections in Chalk logsFlorian Diebold2020-04-131-8/+10
| | | |
| * | | Nicer display of closures in Chalk logsFlorian Diebold2020-04-131-2/+22
| |/ /
* / / Upgrade ChalkFlorian Diebold2020-04-131-13/+66
|/ /
* / Look up impls by self typeFlorian Diebold2020-04-111-4/+7
|/ | | | | This speeds up inference in analysis-stats by ~30% (even more with the recursive solver).
* Implement Chalk's debug methods using TLSFlorian Diebold2020-04-102-42/+270
| | | | | | | | | | Chalk now panics if we don't implement these methods and run with CHALK_DEBUG, so I thought I'd try to implement them 'properly'. Sadly, it seems impossible to do without transmuting lifetimes somewhere. The problem is that we need a `&dyn HirDatabase` to get names etc., which we can't just put into TLS. I thought I could just use `scoped-tls`, but that doesn't support references to unsized types. So I put the `&dyn` into another struct and put the reference to *that* into the TLS, but I have to transmute the lifetime to 'static for that to work.
* Fix Chalk panicFlorian Diebold2020-04-061-1/+6
| | | | | Fixes #3865. Basically I forgot to shift 'back' when we got `dyn Trait`s back from Chalk, so after going through Chalk a few times, the panic happened.
* Upgrade Chalk againFlorian Diebold2020-04-052-30/+53
| | | | | | | 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.
* Upgrade ChalkFlorian Diebold2020-04-051-24/+99
|
* Use `dyn Trait` for working with databseAleksey Kladov2020-03-162-77/+70
| | | | | | | 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).
* Drop larlpop-intern depLaurențiu Nicola2020-03-031-2/+2
|
* Update chalk for Ty internersLaurențiu Nicola2020-03-021-8/+11
|
* Update chalk for RawId removalLaurențiu Nicola2020-03-021-13/+7
|
* Rename ast::ImplBlock -> ast::ImplDefAleksey Kladov2020-02-292-5/+5
|
* Bump chalk and replace TypeFamily with InternerLaurențiu Nicola2020-02-241-49/+58
|
* Shorten some codeFlorian Diebold2020-02-221-4/+1
|
* Rework find_super_trait_path to protect against cyclesFlorian Diebold2020-02-221-4/+2
|
* Add &dyn Trait -> &dyn SuperTrait coercion, and fix &T -> &dyn TraitFlorian Diebold2020-02-221-30/+65
|
* Implement dyn Trait unsizing as wellFlorian Diebold2020-02-222-8/+108
|
* Implement unsize coercion using proper trait solvingFlorian Diebold2020-02-221-1/+60
|
* More manual clippy fixesKirill Bulatov2020-02-182-4/+3
|
* Run cargo +nightly fix --clippy -Z unstable-optionsKirill Bulatov2020-02-182-8/+8
|
* Rename Ty::Param => Ty::PlaceholderFlorian Diebold2020-02-141-2/+2
| | | | This aligns more with Chalk.
* FormattingFlorian Diebold2020-02-071-3/+8
|
* Use variables in predicates as wellFlorian Diebold2020-02-071-3/+3
|
* Change Ty::Param to contain param IDFlorian Diebold2020-02-071-12/+12
|
* Upgrade ChalkFlorian Diebold2020-01-271-55/+53
|
* Filter out error predicates in type bounds as wellFlorian Diebold2019-12-221-2/+12
|
* Introduce our own Chalk TypeFamily, instead of using ChalkIrFlorian Diebold2019-12-222-83/+122
| | | | | | It's not very different, except we can directly use Salsa IDs instead of casting them. This means we need to refactor the handling of errors to get rid of UNKNOWN_TRAIT though.
* Refactor Chalk integration some moreFlorian Diebold2019-12-221-72/+76
|
* Update Chalk, clean up Chalk integration a bitFlorian Diebold2019-12-221-93/+87
|
* Use generic ItemLoc for implsAleksey Kladov2019-12-201-1/+1
|
* Support for nested traitsAleksey Kladov2019-12-201-2/+4
|
* Rename ContainerId -> AssocContainerIdAleksey Kladov2019-12-201-3/+3
|
* Rename N! to name!Florian Diebold2019-12-131-3/+3
|
* Add macros for known names and pathsFlorian Diebold2019-12-131-3/+3
|
* Move traits to the new locAleksey Kladov2019-12-121-4/+2
|
* Switch to the new location for implsAleksey Kladov2019-12-121-1/+1
|
* Refactor parameter count trackingAleksey Kladov2019-12-071-1/+1
|
* Remove idx and parent generics from genericsAleksey Kladov2019-12-071-7/+7
| | | | | This makes `hir_def::GenericParams` flatter. The logic for re-numbering the params is moved to hir instead.
* Extract built-in trait implementations to separate moduleFlorian Diebold2019-12-032-127/+218
| | | | This untangles the builtin logic from the Chalk translation.
* Handle cycles in impl types betterFlorian Diebold2019-11-301-11/+4
| | | | | | - impl Trait<Self> for S is allowed - impl Trait for S<Self> is an invalid cycle, but we can add cycle recovery for it in Salsa now