aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/traits/chalk.rs
Commit message (Collapse)AuthorAgeFilesLines
* Fix chalk_ir assertionFlorian Diebold2021-03-241-5/+3
| | | | Fixes #8150.
* Introduce QuantifiedWhereClause and DynTy analogous to ChalkFlorian Diebold2021-03-211-2/+8
| | | | | This introduces a bunch of new binders in lots of places, which we have to be careful about, but we had to add them at some point.
* Ignore type bindings in generic_predicates_for_paramFlorian Diebold2021-03-211-1/+1
| | | | | | | | | | | | | This allows us to handle more cases without a query cycle, which includes certain cases that rustc accepted. That in turn means we avoid triggering salsa-rs/salsa#257 on valid code (it will still happen if the user writes an actual cycle). We actually accept more definitions than rustc now; that's because rustc only ignores bindings when looking up super traits, whereas we now also ignore them when looking for predicates to disambiguate associated type shorthand. We could introduce a separate query for super traits if necessary, but for now I think this should be fine.
* Remove WhereClause::ErrorFlorian Diebold2021-03-201-7/+1
| | | | | Chalk doesn't have it, and judging from the removed code, it wasn't useful anyway.
* Rename GenericPredicate -> WhereClauseFlorian Diebold2021-03-201-4/+4
|
* Replace Projection variant in GenericPredicate with AliasEqLukas Wirth2021-03-191-8/+8
|
* Chalkify TraitRefFlorian Diebold2021-03-181-5/+5
|
* Rename Substs -> SubstitutionFlorian Diebold2021-03-161-9/+9
|
* Use hir formatter moreoxalica2021-03-151-1/+1
|
* Rename some fields to their Chalk namesFlorian Diebold2021-03-141-2/+2
|
* Move type lowering methods to TyLoweringContextFlorian Diebold2021-03-131-1/+1
|
* Use chalk_ir::OpaqueTyIdFlorian Diebold2021-03-131-4/+3
|
* Use chalk_ir::ClosureIdFlorian Diebold2021-03-131-3/+3
|
* Use chalk_ir::FnDefIdFlorian Diebold2021-03-131-2/+2
|
* Use chalk_ir::AssocTypeIdFlorian Diebold2021-03-131-9/+8
|
* Separate `Ty` and `TyKind` like in ChalkFlorian Diebold2021-03-131-13/+19
| | | | | Currently `Ty` just wraps `TyKind`, but this allows us to change most places to already use `intern` / `interned`.
* Simplify a bitFlorian Diebold2021-03-121-10/+5
|
* Use Chalk Environment more directlyFlorian Diebold2021-03-121-2/+2
|
* Delete `ContainerId`Jonas Schievink2021-03-091-2/+2
|
* Use chalk_ir::AdtIdLukas Wirth2021-03-041-8/+6
|
* Introduce Ty::AliasLukas Wirth2021-03-011-5/+5
|
* Lift FnPointer into a structLukas Wirth2021-02-281-3/+2
|
* Inline TypeCtor into TyLukas Wirth2021-02-281-4/+5
|
* Bump chalkLaurențiu Nicola2021-02-021-2/+2
|
* Make `ModuleId`'s `krate` field privateJonas Schievink2021-01-221-2/+2
|
* Bump chalkLaurențiu Nicola2020-12-231-2/+9
|
* Upgrade ChalkFlorian Diebold2020-12-071-3/+46
| | | | | | | Also make overflow depth and max type size configurable through env variables. This can be helpful at least for debugging. Fixes #6628.
* Remove more unreachable pubsAleksey Kladov2020-11-021-1/+1
|
* Upgrade Chalk to 0.36Florian Diebold2020-10-301-11/+10
| | | | Quite a few changes, because Chalk got rid of the `ApplicationTy` nesting.
* `todo!()` -> `unimplemented!() // FIXME` for CICasey Primozic2020-10-061-2/+4
|
* Bump chalk to use latest git to get fixCasey Primozic2020-10-061-0/+12
| | | | * Chalk very recently (like an hour ago) merged a fix that prevents rust analyzer from panicking. This allows it to be usable again for code that hits those situations. See #6134, #6145, Probably #6120
* Update chalk to 0.28.0Bram van den Heuvel2020-09-251-2/+8
|
* Update chalk to 0.27 and adapt to chalk changes.Charles Lew2020-09-151-8/+14
|
* Merge #5971bors[bot]2020-09-131-21/+84
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5971: Implement async blocks r=flodiebold a=oxalica Fix #4018 @flodiebold already gave a generic guide in the issue. Here's some concern about implementation detail: - Chalk doesn't support generator type yet. - Adding generator type as a brand new type (ctor) can be complex and need to *re-introduced* builtin impls. (Like how we implement closures before native closure support of chalk, which is already removed in #5401 ) - The output type of async block should be known after type inference of the whole body. - We cannot directly get the type from source like return-positon-impl-trait. But we still need to provide trait bounds when chalk asking for `opaque_ty_data`. - During the inference, the output type of async block can be temporary unknown and participate the later inference. `let a = async { None }; let _: i32 = a.await.unwrap();` So in this PR, the type of async blocks is inferred as an opaque type parameterized by the `Future::Output` type it should be, like what we do with closure type. And it really works now. Well, I still have some questions: - The bounds `AsyncBlockImplType<T>: Future<Output = T>` is currently generated in `opaque_ty_data`. I'm not sure if we should put this code here. - Type of async block is now rendered as `impl Future<Output = OutputType>`. Do we need to special display to hint that it's a async block? Note that closure type has its special format, instead of `impl Fn(..) -> ..` or function type. Co-authored-by: oxalica <[email protected]>
| * Fix and prettify commentsoxalica2020-09-111-4/+6
| |
| * Implement async blocksoxalica2020-09-101-21/+82
| |
* | Lookup ADT and assoc. type names for chalk debugNathan Whitaker2020-09-091-5/+9
|/
* Lookup adt namesWilco Kusee2020-08-141-1/+2
|
* Print chalk programs in debug outputWilco Kusee2020-08-141-10/+12
|
* Rename ra_hir_ty -> hir_tyAleksey Kladov2020-08-131-0/+586