Skip to content
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

refactor ParameterKind to match rustc, accomodate constants #452

Closed
nikomatsakis opened this issue May 12, 2020 · 1 comment · Fixed by #455
Closed

refactor ParameterKind to match rustc, accomodate constants #452

nikomatsakis opened this issue May 12, 2020 · 1 comment · Fixed by #455
Assignees

Comments

@nikomatsakis
Copy link
Contributor

nikomatsakis commented May 12, 2020

In order to resolve some of the problems we encountered in integrating const generics, we want to do the following refactorings:

  • replaces type Parameter = ParameterKind<...> with a GenericArg (copying Rust's name) -- for bonus points, it should be an interned struct as well with a data method that gets a GenericArgData
  • and refactors ParameterKind<()> into BoundVariableKind<I> or something like (which for now is just type/lifetime and I guess a phantomdata for the I parameter)
  • and refactors ParameterKind<EnaVariable> into a (BoundVariableKind, EnaVariable) pair

Then we can, in the const generics PR:

  • extend BoundVariableKind with Const(Ty<I>)
  • extend GenericArg with a Const(Const<I>) variable, and Const<I> can carry the Ty<I> (as rustc handles it)
@nikomatsakis
Copy link
Contributor Author

@rustbot assign @Areredify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants