Open
Description
So, during our discussion earlier today, @nikomatsakis brought up this interesting example of code that should really compile, we think:
existential type X: Sized;
trait Foo {
type Bar: Iterator<Item = Self::_0>;
type _0;
}
impl Foo for () {
type Bar = std::vec::IntoIter<u32>;
type _0 = X;
}
Error:
error: could not find defining uses
--> src/main.rs:3:1
|
3 | existential type X: Sized;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
It seems that type _0 = X;
isn't being considered as a "defining use", even though it clearly does constrain X
. The question is, what sort of changes do we need for this to work? (I'm pretty sure it should work.) Do we need Chalk perhaps?
Metadata
Metadata
Assignees
Labels
Area: Associated items (types, constants & functions)Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: Trait systemArea: Type system`#[feature(type_alias_impl_trait)]`Relevant to the language team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.
Type
Projects
Status
Can do after stabilization