Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vec_map not build with beta, but compiled with stable and nightly #35828

Closed
Dushistov opened this issue Aug 19, 2016 · 3 comments
Closed

vec_map not build with beta, but compiled with stable and nightly #35828

Dushistov opened this issue Aug 19, 2016 · 3 comments

Comments

@Dushistov
Copy link
Contributor

I tried such code:

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.

@Mark-Simulacrum
Copy link
Member

Duplicate of #35721. Thanks for reporting, though!

@Dushistov
Copy link
Contributor Author

Dushistov commented Aug 19, 2016

@Mark-Simulacrum I am not familiar with internal rules, but why #35721 marked as closed (this why I not found it), but fix not merged to beta?

@Mark-Simulacrum
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants