You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generate clauses for placeholder associated types
Currently, we don't generate clauses for placeholder associated types (`TyKind::AssociatedType`) except for some `FromEnv`s. This leads to `NoSolution` for goals like `(IntoIterator::IntoIter)<Opaque>: Iterator` where `Opaque = impl IntoIterator`.
For every associated type in a trait definition
```rust
trait Foo {
type Assoc<'a, T>: Bar<U = Ty> where WC;
}
```
chalk with this patch generates
```rust
forall<Self, 'a, T> {
Implemented((Foo::Assoc<'a, T>)<Self>: Bar) :- WC.
AliasEq(<<(Foo::Assoc<'a, T>)<Self>> as Bar>::U = Ty) :- WC.
}
```
To be honest, I'm not entirely sure if `AssociatedTyDatum::to_program_clauses()` is the best place to generate those clauses in, but analogous clauses for placeholder opaque types are generated in `OpaqueTyDatum::to_program_clauses()`, which I modeled after.
Spotted in rust-lang/rust-analyzer#14680.
rust-analyzer version: 0.4.1493-standalone (237ffa3 2023-04-27)
rustc version: rustc 1.70.0-nightly (84dd17b56 2023-04-14)
Unfortunately I can't isolate it right now, but probably that will be easy:
cargo
crateconfig = cargo::util::config::Config::default()
workspace = cargo::core::workspace::Workspace::new(&manifest_path, &*config)
workspace.members()
, e.g.:filter_packages_with_metadata(workspace.members())
Something like this. 🙄
Code from screenshot
The text was updated successfully, but these errors were encountered: