You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
changelog: [mutable_key_type], [declare_interior_mutable_const]: now considers types that have references to interior mutable types as interior mutable
Forgot to mention that, the old version considered any &mut reference interior mutable but that was incorrect. The examples of &mut usize/Result<&mut usize, ()> have no interior mutability
For the mutable_key_type the problem is any mutability, not just interior mutability, so having a &mut T as a key should be linted nonetheless, as the &mut could be used to mutate the referenced value, which would violate the contract of HashMap and/or BTreeMap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the existing interior mutability detection, the two main changes being
struct S(&Cell)mutable_key_typeignores pointers as it did beforeignore_interior_mutabilityconfig now applies to types containing the ignored type, e.g.http::HeaderNameFixes #7752
Fixes #9776
Fixes #9801
changelog: [
mutable_key_type], [declare_interior_mutable_const]: now considers types that have references to interior mutable types as interior mutable