Skip to content

Experiment with ergonomic ref-counting #107

Open
@nikomatsakis

Description

@nikomatsakis
Metadata
Point of contact @spastorino
Team(s) lang
Goal document 2025h1/ergonomic-rc

Summary

  • Deliver a nightly implementation of the experimental use syntax for ergonomic ref-counting.
  • RFC decision on the above

Tasks and status

  • Implementation (@spastorino)
  • Reviews (@nikomatsakis)
  • Lang-team champion (lang Team)
  • Author RFC (@joshtriplett)
  • Introduce x.use and use || syntax and UseCloned trait (Ergonomic ref counting rust#134797).
  • Modify codegen so that we guarantee that x.use will do a copy if X: Copy is true after monomorphization. Right now the desugaring to clone occurs before monomorphization and hence it will call the clone method even for those instances where X is a Copy type.
  • Convert x.use to a move rather than a clone if this is a last-use.
  • Make x equivalent to x.use but with an (allow-by-default) lint to signal that something special is happened.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Project goal

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions