-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Should clone take &mut self? #8768
Comments
I don't think it should, because it would become much less useful in generic functions. Most of the types needing to do record keeping are going to be doing it through a type with inherent mutability like |
If clone takes |
Heh, I wasn't even thinking about that. We should probably just have an alternate way of cloning things when it requires mutation. Since |
What are some examples of types that need record keeping? @thestinger mentioned reference counting (i.e., ARC, RC). Are there others? I tend to think of our type system as sometimes ruling out potential designs (i.e., |
I think it's clear that we're not going to be able to make |
Fix `#[allow]` for `module_name_repetitions` & `single_component_path_imports` Fixes rust-lang#7511 Fixes rust-lang#8768 Fixes rust-lang#9401 `single_component_path_imports` needed some changes to the lint itself, it now buffers the found single component paths to emit in the equivalent `check_item` changelog: Fix `#[allow(clippy::module_name_repetitions)]` and `#[allow(clippy::single_component_path_imports)]`
There are plenty of types that need to do record keeping during clone. Don't see an issue for this.
The text was updated successfully, but these errors were encountered: