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

Use last-use to provide "fixit" hints #3755

Closed
catamorphism opened this issue Oct 13, 2012 · 1 comment
Closed

Use last-use to provide "fixit" hints #3755

catamorphism opened this issue Oct 13, 2012 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one.
Milestone

Comments

@catamorphism
Copy link
Contributor

Now that last-use is gone, it would be good to use it to provide feedback in error messages. I can imagine two ways to do this:

  1. I changed the kind checker to suggest adding a move in some cases where a noncopyable value gets copied. However, it may suggest it in a situation where a move would be illegal, which is kind of rude. The kind checker could use last-use results to provide a more accurate error message.
  2. There may be situations now where there are copies that could instead be moves (because they're actually last-uses, but copying is legal). A lint pass based on last-use results could warn about these. I don't know if it's possible for such a situation to arise, though (maybe these are all "noncopyable" errors or "non-implicitly-copyable" warnings now, I'm not sure).

Of course, if we end up doing @nikomatsakis 's "move or copy based on type" idea, both of these points will be moot.

This was part of #2633, but I wanted to close #2633.

@catamorphism
Copy link
Contributor Author

Obsolete now that #3676 is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

1 participant