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

Implement "no implicit copies" scheme #2431

Closed
msullivan opened this issue May 23, 2012 · 3 comments
Closed

Implement "no implicit copies" scheme #2431

msullivan opened this issue May 23, 2012 · 3 comments
Labels
A-codegen Area: Code generation A-grammar Area: The grammar of Rust A-type-system Area: Type system C-enhancement Category: An issue proposing an enhancement or a PR with one. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot.

Comments

@msullivan
Copy link
Contributor

Something like the scheme proposed in http://smallcultfollowing.com/babysteps/rust/no-implicit-copies/ should be implemented.

@nikomatsakis
Copy link
Contributor

I am now of the belief that the only implicit copies which ought to be illegal are:

  • those copying mutable data
  • those requiring a malloc (i.e., those containing unique pointers, vectors)

Implicit copies occur in various places, but one of the most common (and easiest to prevent/detect) is when closing over data in closures. We could easily add a check there as a start, but we should eventually capture all such cases.

@msullivan
Copy link
Contributor Author

I'll be tackling this in phases, so I have opened some sub-bugs for tracking.

@msullivan
Copy link
Contributor Author

I don't think there is anything left. Closing.

celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-grammar Area: The grammar of Rust A-type-system Area: Type system C-enhancement Category: An issue proposing an enhancement or a PR with one. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot.
Projects
None yet
Development

No branches or pull requests

2 participants