Skip to content

create TypeName for & and &mut #438

Closed
@nikomatsakis

Description

@nikomatsakis

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.

Metadata

Metadata

Assignees

Labels

current-sprintBeing worked on in the current sprint

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions