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
use std::iter::{Enumerate};
use std::vec;
pub struct IntoIter<V> {
iter: Enumerate<vec::IntoIter<Option<V>>>,
}
fn into_iter_covariant<'a, T>(iter: IntoIter<&'static T>) -> IntoIter<&'a T> { iter }
fn main() {
}
rustup run beta rustc test_code.rs give error:
error[E0308]: mismatched types
--> test_code.rs:9:80
|
9 | 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 9:77...
--> test_code.rs:9:78
|
9 | fn into_iter_covariant<'a, T>(iter: IntoIter<&'static T>) -> IntoIter<&'a T> { iter }
| ^^^^^^^^
= note: ...does not necessarily outlive the static lifetime
error: aborting due to previous error
$ rustup run beta rustc --version
rustc 1.12.0-beta.1 (822166b84 2016-08-16)
But stable and nightly version of compiler compile such code just fine:
$ rustup run nightly rustc --version
rustc 1.13.0-nightly (499484f56 2016-08-18)
$ rustup run stable rustc --version
rustc 1.11.0 (9b21dcd6a 2016-08-15)
This bug prevent to compile vec_map crate (from which I extract rust code above),
and racer depend on vec_map, so I can not compile racer project also.
The text was updated successfully, but these errors were encountered:
The fix was nominated for a beta backport, but so far no backport has been implemented; I'm not sure what the project policy is regarding whether to leave issues open/closed when they need backporting.
I tried such code:
rustup run beta rustc test_code.rs give error:
But stable and nightly version of compiler compile such code just fine:
This bug prevent to compile vec_map crate (from which I extract rust code above),
and racer depend on vec_map, so I can not compile racer project also.
The text was updated successfully, but these errors were encountered: