Rocket: Compile fails with latest nightly (as of 2018-06-11)

Created on 11 Jun 2018  路  12Comments  路  Source: SergioBenitez/Rocket

Hi,

I was playing around with Rocket and Rust using the helloworld example from https://rocket.rs/guide/getting-started. I first tried on my private laptop a few days ago and was very satisfied with the results. Today (2018-06-11) i tried to get everything running on my laptop at work and compilation fails with the following message:

Compiling rocket_codegen v0.3.12
error[E0432]: unresolved import `syntax::parse::common`
 --> /home/sja/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket_codegen-0.3.12/src/utils/parser_ext.rs:5:20
  |
5 | use syntax::parse::common::SeqSep;
  |                    ^^^^^^ Could not find `common` in `parse`

error[E0624]: method `parse_seq_to_end` is private
  --> /home/sja/.cargo/registry/src/github.com-1ecc6299db9ec823/rocket_codegen-0.3.12/src/utils/parser_ext.rs:13:14
   |
13 |         self.parse_seq_to_end(&Eof,
   |              ^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

Some errors occurred: E0432, E0624.

I am using the latest nightly as of today. I am running everthing on my Linux(Linux 4.14.48-2-MANJARO #1 SMP PREEMPT Fri Jun 8 20:41:40 UTC 2018 x86_64 GNU/Linux) Laptop and used rustup to install nightly versions.

I have switched over to the nighly nightly-2018-06-09-x86_64-unknown-linux-gnu (default) and everything compiles fine. So i assume it has something to do with Rust itself affecting Rocket.

Investigating further and reading the suggested error messages did not help for me as i am still not that familiar with Rust.

Regards

Sebastian

nightly breakage

Most helpful comment

Fixed in v0.3.13.

All 12 comments

I am testing a fix and will file a PR against rust-lang/rust when I've confirmed it.

In addition to rust-lang/rust#51502, this change was needed to keep up with the reorganization:

diff --git a/codegen/src/utils/parser_ext.rs b/codegen/src/utils/parser_ext.rs
index 44f18fa..9909e8e 100644
--- a/codegen/src/utils/parser_ext.rs
+++ b/codegen/src/utils/parser_ext.rs
@@ -1,8 +1,7 @@
 use syntax::parse::parser::{PathStyle, Parser};
-use syntax::parse::PResult;
+use syntax::parse::{SeqSep, PResult};
 use syntax::ast::Path;
 use syntax::parse::token::Token::{Eof, Comma};
-use syntax::parse::common::SeqSep;

 pub trait ParserExt<'a> {
     fn parse_paths(&mut self) -> PResult<'a, Vec<Path>>;

I will likely be on vacation by the time this is resolved, and I didn't want to submit a PR for it without knowing which nightly will have the fix.

I'm still a newbie with Rust, and this is my first time trying both nightly and Rocket. Until this is completely resolved, what is the recommended way of getting my project to compile again?

@mboogerd you can update to the latest rust nightly and edit cached file (where error happens) as @jebrosen said

I had realized the nightly update, but I had not interpreted @jebrosen's comment as something that I should be doing in my cache (noobiness showing through). It did work though, thanks for the tip @avrong :)

@mboogerd last working nightly for me was nightly-2018-06-09.

nightly-2018-06-09 is a working nightly build for both master and 0.3.12.

With rust-lang/rust#51502 merged, a new Rocket 0.3 release can be made that works with the latest nightly builds.

Unfortunately, due to an oversight on my part, another PR will probably need to be made for rust-lang/rust before master can be fixed.

rustup default nightly-2018-06-09 for the noobs looking for something to paste (like I was)

Or if you have multiple projects like myself and want to override the nightly version for a single project:

rustup override set nightly-2018-06-09

Please see https://github.com/rust-lang-nursery/rustup.rs#toolchain-override-shorthand for more details regarding rustup override

The master branch uses these methods in addition to those used in 0.3 that would need to be made public: parse_optional_str and mk_mac_expr. There was also one deleted method: parse_seq. It looks like some of these could be implemented in Rocket in parser_ext.rs, but I didn't spend too much time trying.

Fixed in v0.3.13.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loothood picture loothood  路  4Comments

Hokutosei picture Hokutosei  路  4Comments

klnusbaum picture klnusbaum  路  4Comments

incker picture incker  路  3Comments

Ronaldho80 picture Ronaldho80  路  3Comments