Skip to content

introduce a fresh variant for "non-normalized" associated types #53683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nikomatsakis opened this issue Aug 24, 2018 · 1 comment
Closed

introduce a fresh variant for "non-normalized" associated types #53683

nikomatsakis opened this issue Aug 24, 2018 · 1 comment
Labels
A-trait-system Area: Trait system T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-traits Working group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804

Comments

@nikomatsakis
Copy link
Contributor

In the compiler today, we have one variant for associated type projections (e.g., T::Foo):

rust/src/librustc/ty/sty.rs

Lines 156 to 158 in 727eabd

/// The projection of an associated type. For example,
/// `<T as Trait<..>>::N`.
Projection(ProjectionTy<'tcx>),

We use context to know whether this is normalized or not -- basically, it should always be normalized, unless the type results from one of those queries that fetches the type that the user wrote for something like a field etc. In the lazy normalization approach that Chalk uses, however, we would want to be able to explicitly represent this difference.

The job here is to add a new variant. I think we should call it TyUnnormalizedProjection. This would be entirely unused for now -- but when we start to enable chalk, we will create this type when translating user types directly, and only create TyProjection in the case that we have attempted to normalize the projection and failed.

cc @tmandry @scalexm

@nikomatsakis nikomatsakis added A-trait-system Area: Trait system T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-traits Working group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804 labels Aug 24, 2018
@scalexm
Copy link
Member

scalexm commented Oct 4, 2018

Introduced in #54789.

@scalexm scalexm closed this as completed Oct 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-trait-system Area: Trait system T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-traits Working group: Traits, https://internals.rust-lang.org/t/announcing-traits-working-group/6804
Projects
None yet
Development

No branches or pull requests

2 participants