Skip to content

add a "well-known" Sized trait to chalk_solve #261

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 Oct 14, 2019 · 7 comments
Closed

add a "well-known" Sized trait to chalk_solve #261

nikomatsakis opened this issue Oct 14, 2019 · 7 comments
Assignees
Labels
current-sprint Being worked on in the current sprint design Needs design work rustc integration Related to or required for rustc integration

Comments

@nikomatsakis
Copy link
Contributor

nikomatsakis commented Oct 14, 2019

I think the chalk-solve crate ought to start encoding rules for "well-known" traits that require compiler support. A good place to start is the Sized trait. I'm opening this issue to remember the problem, it will be extended with mentoring instructions.

@lqd

This comment has been minimized.

@jackh726 jackh726 added design Needs design work rustc integration Related to or required for rustc integration labels Feb 7, 2020
@jackh726 jackh726 changed the title add a "well-known" Sized trait to rustc_solve add a "well-known" Sized trait to chalk_solve Feb 24, 2020
@nikomatsakis
Copy link
Contributor Author

Blocked on #356

@nikomatsakis nikomatsakis added the current-sprint Being worked on in the current sprint label Mar 27, 2020
@nikomatsakis
Copy link
Contributor Author

So I think what we want here has two parts:

  • First of all, we want to extend the 'well formedness' rules for struct definitions -- structs are not permitted to have "unsized fields" except in specific locations (notably, only the final field may be unsized). (Furthermore, enums are not permitted to have to unsized members...at all?)
  • Based on this, rustc's code for checking whether a struct type is sized is quite specialized (important since this is a very common check) and it looks only at the final field of a struct. This may even have been necessary to prevent some kinds of cycles, I have a dim memory of that.

Some links from rustc code:

@basil-cow
Copy link
Contributor

I'll take this one

@basil-cow
Copy link
Contributor

blocked on #368

@marmeladema
Copy link
Contributor

I hope #413 will help with this issue.

@jackh726
Copy link
Member

This is done :) existing types have this logic and new types get it added in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
current-sprint Being worked on in the current sprint design Needs design work rustc integration Related to or required for rustc integration
Projects
None yet
Development

No branches or pull requests

5 participants