aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/traits.rs
Commit message (Collapse)AuthorAgeFilesLines
* Update Chalk, and cache Chalk env elaboration through a queryFlorian Diebold2020-04-201-1/+1
| | | | This should fix some of the worst performance problems.
* Switch Chalk to recursive solverFlorian Diebold2020-04-161-6/+7
| | | | + various fixes related to that.
* Add support for bounds on associated types in trait definitionsFlorian Diebold2020-04-131-2/+5
| | | | | | | | | | | | 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.)
* Look up impls by self typeFlorian Diebold2020-04-111-3/+11
| | | | | This speeds up inference in analysis-stats by ~30% (even more with the recursive solver).
* Implement Chalk's debug methods using TLSFlorian Diebold2020-04-101-2/+11
| | | | | | | | | | 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.
* Use log info in trait_solve_queryEdwin Cheng2020-04-061-1/+1
|
* Upgrade Chalk againFlorian Diebold2020-04-051-3/+7
| | | | | | | 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-3/+3
|
* Use `dyn Trait` for working with databseAleksey Kladov2020-03-161-6/+6
| | | | | | | 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).
* Use `Index` for CrateGraphAleksey Kladov2020-03-091-1/+1
|
* Less abstract CrateData apiKirill Bulatov2020-03-091-1/+1
|
* Don't reuse the Chalk solverFlorian Diebold2020-03-061-84/+28
| | | | | This slows down analysis-stats a bit (~5% in my measurement), but improves incremental checking a lot because we can reuse trait solve results.
* Allow specifying additional info on call to profileAleksey Kladov2020-03-061-1/+4
|
* Rename ast::ImplBlock -> ast::ImplDefAleksey Kladov2020-02-291-3/+3
|
* Bump chalk and replace TypeFamily with InternerLaurențiu Nicola2020-02-241-7/+7
|
* Implement dyn Trait unsizing as wellFlorian Diebold2020-02-221-0/+10
|
* Implement unsize coercion using proper trait solvingFlorian Diebold2020-02-221-0/+2
|
* More manual clippy fixesKirill Bulatov2020-02-181-6/+3
|
* Extend analysis-stats a bitFlorian Diebold2020-02-151-0/+3
| | | | | | | | | | | | This adds some tools helpful when debugging nondeterminism in analysis-stats: - a `--randomize` option that analyses everything in random order - a `-vv` option that prints even more detail Also add a debug log if Chalk fuel is exhausted (which would be a source of nondeterminism, but didn't happen in my tests). I found one source of nondeterminism (rust-lang/chalk#331), but there are still other cases remaining.
* Tweak Chalk settingsFlorian Diebold2020-01-271-2/+1
|
* Upgrade ChalkFlorian Diebold2020-01-271-3/+15
|
* Don't panic if chalk panicsAleksey Kladov2020-01-131-9/+35
|
* Introduce our own Chalk TypeFamily, instead of using ChalkIrFlorian Diebold2019-12-221-2/+2
| | | | | | 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-7/+7
|
* Update Chalk, clean up Chalk integration a bitFlorian Diebold2019-12-221-3/+3
|
* Extract built-in trait implementations to separate moduleFlorian Diebold2019-12-031-0/+1
| | | | This untangles the builtin logic from the Chalk translation.
* Move TyAleksey Kladov2019-11-271-0/+328