chalk
chalk copied to clipboard
An implementation and definition of the Rust trait system using a PROLOG-like logic solver
This issue has been assigned to @Areredify via [this comment](https://github.com/rust-lang/chalk/issues/364#issuecomment-614024735).
We need to design rules for the well-formedness of trait objects that address the soundness issue https://github.com/rust-lang/rust/issues/44454 and that are future-proof under implied bounds. In what follows, we'll write `dyn...
Implicit type parameters (like `Self` and others from the env) are put into a lowered item after the explicit type parameters, which is surprising. For example, the following test fails:...
Related to #11, we don't really do anything clever with where clauses on traits/structs. We need to support "elaboration" -- ideally, a richer form than what the current compiler supports....
Context: https://github.com/rust-lang/rust-analyzer/issues/13169 It seems chalk is unable to deduce projection type of trait object types when it's not specified in `dyn` notation but the trait has supertrait with its projection...
This just returns `NoSolution` if it shouldn't continue, but that should already be useful to rust-analyzer. Note: Cloning of `should_continue` is a workaround to a rustc bug ([#95734](https://github.com/rust-lang/rust/issues/95734))
Found in [rust-analyzer#12897](https://github.com/rust-lang/rust-analyzer/issues/12897), the following test causes the recursive solver to loop: ```rust #[test] fn cyclic_traits() { test! { program { trait Clone { } trait A { type X:...
Follow the rename in nightly (see https://blog.rust-lang.org/inside-rust/2023/10/23/coroutines.html)
When creating dyn ty program clauses, we need to use the ty returned from the builder, not the original self type. ClosureKind change is iffy - likely not correct, but...
This PR implements [RFC3324], `dyn Trait` upcasting (cc rust-lang/rust#65991). As explained in the RFC, this PR adds builtin clauses for `Unsize` with applicability checks: ```rust // when Trait2 is a...