Exa: Build failure with rustc 1.22.0-nightly (088216fb9 2017-09-04)

Created on 5 Sep 2017  路  8Comments  路  Source: ogham/exa

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

Most helpful comment

My fix is in the latest nightly.

All 8 comments

could this be due to non-lexical lifetimes? if so, I would suggest mentioning this bug over at https://github.com/rust-lang/rfcs/pull/2094

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

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.

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

My fix is in the latest nightly.

Nicely done, @Aaron1011 !

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikemadden42 picture mikemadden42  路  3Comments

skyzyx picture skyzyx  路  4Comments

anishmittal2020 picture anishmittal2020  路  5Comments

raxod502 picture raxod502  路  5Comments

lilianmoraru picture lilianmoraru  路  5Comments