Closed
Description
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:
- 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.
- 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.