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

create TypeName for & and &mut #438

Closed
nikomatsakis opened this issue May 5, 2020 · 3 comments · Fixed by #444 or #447
Closed

create TypeName for & and &mut #438

nikomatsakis opened this issue May 5, 2020 · 3 comments · Fixed by #444 or #447
Assignees
Labels
current-sprint Being worked on in the current sprint

Comments

@nikomatsakis
Copy link
Contributor

nikomatsakis commented May 5, 2020

As part of #368, we need to extend chalk's TypeName to model the built-in & and &mut types. We can add a variant Ref(Mutability), where Mutability is a new type to add to chalk-ir based on rustc's Mutability enum.

You can follow #394 which provides a rough model of what needs to be extended. You probably want to model this on how tuples are handled, a N-ary tuple like (_, _) has two generic type parameters, and & and &mut have two generic parameters too (a lifetime and a type).

You would need to

  • add Ref(Mutability) to TypeName
  • extend parser to accept &, &mut types
  • Update the current state table to include the new types, I don't think it requires any special handling apart from Sized, I think its impls live in the standard library

This issue has been assigned to @nathanwhit via this comment.

@nikomatsakis nikomatsakis added the current-sprint Being worked on in the current sprint label May 5, 2020
@AzureMarker

This comment has been minimized.

@nathanwhit
Copy link
Member

@rustbot claim

@jackh726
Copy link
Member

jackh726 commented May 9, 2020

I merged the PR a bit too early. &mut references aren't copy/clone. @nathanwhit

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
Projects
None yet
5 participants