Skip to content

Conversation

@HMPerson1
Copy link
Contributor

We could possibly assert that the necessary Deref impl actually exists before emitting the lint, but that seems unnecessary to me.

Fixes #3052

@oli-obk
Copy link
Contributor

oli-obk commented Oct 19, 2018

I agree with your analysis. There must be one, otherwise clone could not have been called.

Can you add more complex tests with multiple levels of derefs?

@HMPerson1
Copy link
Contributor Author

Oh, I hadn't thought about multiple levels of derefs. Currently this lint will definitely suggest the wrong thing in that case 😅. I'll fix that in a bit.

@phansch phansch merged commit 26602dd into rust-lang:master Dec 8, 2018
@phansch
Copy link
Contributor

phansch commented Dec 8, 2018

Thanks! (and sorry for letting this sit so long)

@HMPerson1 HMPerson1 deleted the clone_on_copy_deref branch December 10, 2018 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants