aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/traits.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove built-in Unsize implsFlorian Diebold2020-07-121-6/+1
| | | | They exist in Chalk now.
* Upgrade ChalkFlorian Diebold2020-07-121-3/+5
|
* Implement Chalk variable kindsFlorian Diebold2020-07-011-12/+4
| | | | | | | | | This means we need to keep track of the kinds (general/int/float) of variables in `Canonical`, which requires some more ceremony. (It also exposes some places where we're not really dealing with canonicalization correctly -- another thing to be cleaned up when we switch to using Chalk's types directly.) Should fix the last remaining issue of #2534.
* Merge #4947bors[bot]2020-06-201-30/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4947: Replace `impls_in_trait` query with smarter use of `CrateImplDefs` r=matklad a=jonas-schievink `impls_in_trait` was allocating a whopping ~400 MB of RAM when running analysis-stats on r-a itself. Remove it, instead adding a query that computes a summary `CrateImplDefs` map for all transitive dependencies. This can probably still be made more efficient, but this already reduces the peak memory usage by 25% without much performance impact on analysis-stats. **Before**: ``` Total: 34.962107188s, 2083mb allocated 2141mb resident 422mb ImplsForTraitQuery (deps) 250mb CrateDefMapQueryQuery 147mb MacroArgQuery 140mb TraitSolveQuery (deps) 68mb InferQueryQuery (deps) 62mb ImplDatumQuery (deps) ``` **After**: ``` Total: 35.261100358s, 1520mb allocated 1569mb resident 250mb CrateDefMapQueryQuery 147mb MacroArgQuery 144mb TraitSolveQuery (deps) 68mb InferQueryQuery (deps) 61mb ImplDatumQuery (deps) 45mb BodyQuery 45mb ImplDatumQuery ``` Co-authored-by: Jonas Schievink <[email protected]>
| * Replace `impls_in_trait` with `CrateImplDefs`Jonas Schievink2020-06-191-30/+1
| |
* | Make get_fn_trait a method of FnTraitadamrk2020-06-201-2/+12
| |
* | Infer FnSig from Fn traitsadamrk2020-06-191-1/+1
|/
* 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