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

Build failure with rustc 1.22.0-nightly (088216fb9 2017-09-04) #281

Closed
martinlindhe opened this issue Sep 5, 2017 · 8 comments
Closed

Comments

@martinlindhe
Copy link
Contributor

martinlindhe commented Sep 5, 2017

First of all, everything compiles fine with stable rust 1.20.0 (rustup default stable)

This build error only occurs on nightly.

$ rustup default nightly
$ rustc -V
rustc 1.22.0-nightly (088216fb9 2017-09-04)

$ make build
...
   Compiling exa v0.7.0 (file:///home/m/dev/rs/exa)
warning: unused extern crate
 --> src/fs/feature/xattr.rs:3:1
  |
3 | extern crate libc;
  | ^^^^^^^^^^^^^^^^^^
  |
  = note: #[warn(unused_extern_crates)] on by default
error[E0597]: borrowed value does not live long enough
  --> src/options/flags.rs:51:35
   |
51 |   pub static ALL_ARGS: Args = Args(&[
   |  ___________________________________^
52 | |     &VERSION, &HELP,
53 | |
54 | |     &ONE_LINE, &LONG, &GRID, &ACROSS, &RECURSE, &TREE, &CLASSIFY,
...  |
62 | |     &GIT, &EXTENDED,
63 | | ]);
   | | ^- temporary value only lives until here
   | |_|
   |   does not live long enough
   |
   = note: borrowed value must be valid for the static lifetime...
error: aborting due to previous error
error: Could not compile `exa`.
To learn more, run the command again with --verbose.
make: *** [Makefile:21: target/release/exa] Error 101

If desired, one could add nightly to the rust list in .travis.yml at https://github.com/ogham/exa/blob/master/.travis.yml#L8

@hoodie
Copy link
Contributor

hoodie commented Sep 5, 2017

could this be due to non-lexical lifetimes? if so, I would suggest mentioning this bug over at rust-lang/rfcs#2094

@martinlindhe
Copy link
Contributor Author

Not sure, and not really able to dig deeper at the moment, sorry for the drive-by bug report

@Aaron1011
Copy link

I've minimized the issue to this example, which compiles on stable but not nightly:

struct Foo<'a>(&'a [&'a bool]);

static TEST: bool = true;
static FOO: Foo = Foo(&[&TEST]);

fn main() {}

Playground link.

@martinlindhe
Copy link
Contributor Author

@Aaron1011 do you mind opening a bug in https://github.com/rust-lang/rust with your example?

@Aaron1011
Copy link

@martinlindhe: Done: rust-lang/rust#44373

@Aaron1011
Copy link

My fix is in the latest nightly.

@martinlindhe
Copy link
Contributor Author

Nicely done, @Aaron1011 !

@martinlindhe
Copy link
Contributor Author

Confirming fixed using rustc 1.22.0-nightly (dd08c3070 2017-09-12)

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