-
Couldn't load subscription status.
- Fork 13.9k
Open
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
The following std::collections types are unnecessarily invariant in their type parameters:
binary_heap::Drainbtree_map::{Keys, Values}btree_set::{IntoIter, Iter, Range}btree_set::{Difference, Intersection, SymmetricDifference, Union}hash_map::{IntoIter, Iter, Keys, Values}hash_map::Drainhash_set::{Difference, Intersection, IntoIter, Iter, SymmetricDifference, Union}hash_set::Drainlinked_list::{IntoIter, Iter, LinkedList}vec::Drainvec_deque::Drain
Some, like btree_map::Keys, are invariant due to the use of iter::Map with fn(T) -> U being invariant over T, while others, like LinkedList, are due to the ultimate use of *mut T, and the rest are wrappers around other invariant iterators.
Of these, the most important to fix is probably LinkedList, as the rest are iterators. Given the issue with iter::Map, it is likely that some other iterators in std have the same problem.
Metadata
Metadata
Assignees
Labels
A-collectionsArea: `std::collections`Area: `std::collections`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.