-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools
Description
Location
https://doc.rust-lang.org/std/collections/struct.HashSet.html#method.insert
Summary
HashSet::insert is underspecified.
It says:
If the set already contained this value, false is returned.
But when the set already contains a value, is existing value replaced with new, or new value just discarded?
It does not make difference for primitive types, but can have significant effect when inserting Arc for example.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools