-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
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.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Description
#35447 replaced a *const T
by a *mut T
in IntoIter<T>
, which changed IntoIter
from being covariant to being invariant. This breaks crates like vec_map
which relied on IntoIter
being invariant, e.g. https://travis-ci.org/asajeffrey/presort/jobs/152720189#L208 has error:
error[E0308]: mismatched types
--> /home/ajeffrey/.cargo/registry/src/github.spider-man.dpdns.org-1ecc6299db9ec823/vec_map-0.6.0/src/lib.rs:952:84
|
952 | fn into_iter_covariant<'a, T>(iter: IntoIter<&'static T>) -> IntoIter<&'a T> { iter }
| ^^^^ lifetime mismatch
|
= note: expected type `IntoIter<&'a T>`
= note: found type `IntoIter<&'static T>`
note: the lifetime 'a as defined on the block at 952:81...
--> /home/ajeffrey/.cargo/registry/src/github.spider-man.dpdns.org-1ecc6299db9ec823/vec_map-0.6.0/src/lib.rs:952:82
|
952 | fn into_iter_covariant<'a, T>(iter: IntoIter<&'static T>) -> IntoIter<&'a T> { iter }
| ^^^^^^^^
= note: ...does not necessarily outlive the static lifetime
Compiling rustc-serialize v0.3.19
error: aborting due to previous error
Metadata
Metadata
Assignees
Labels
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.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.