Rocket_contrib fails to compile on latest Rust nightly

Created on 15 Aug 2017  路  4Comments  路  Source: SergioBenitez/Rocket

I haven't seen any issues filed for this, yet, so here goes...

Rocket is latest version from git master.
OS is Ubuntu 16.
The bug is produced trying to compile with latest nightly rust (08-15-2017).

   Compiling rocket_contrib v0.4.0-dev (https://github.com/SergioBenitez/Rocket#f66780bd)
error[E0616]: field `liberated_fn_sigs` of struct `rustc::ty::TypeckTables` is private
   --> /home/micucci/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/f66780b/codegen/src/lints/mod.rs:264:28
    |
264 |         if let Some(sig) = cx.tables.liberated_fn_sigs.get(&fn_id) {
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: a method `liberated_fn_sigs` also exists, perhaps you wish to call it

error[E0308]: mismatched types
   --> /home/micucci/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/f66780b/codegen/src/lints/mod.rs:264:60
    |
264 |         if let Some(sig) = cx.tables.liberated_fn_sigs.get(&fn_id) {
    |                                                            ^^^^^^ expected struct `rustc::hir::ItemLocalId`, found struct `syntax::ast::NodeId`
    |
    = note: expected type `&rustc::hir::ItemLocalId`
               found type `&syntax::ast::NodeId`

error[E0616]: field `type_dependent_defs` of struct `rustc::ty::TypeckTables` is private
  --> /home/micucci/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/f66780b/codegen/src/lints/utils.rs:49:5
   |
49 |     cx.tables.type_dependent_defs
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: a method `type_dependent_defs` also exists, perhaps you wish to call it

error[E0308]: mismatched types
  --> /home/micucci/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/f66780b/codegen/src/lints/utils.rs:50:14
   |
50 |         .get(&expr.id)
   |              ^^^^^^^^ expected struct `rustc::hir::ItemLocalId`, found struct `syntax::ast::NodeId`
   |
   = note: expected type `&rustc::hir::ItemLocalId`
              found type `&syntax::ast::NodeId`

error[E0308]: mismatched types
  --> /home/micucci/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/f66780b/codegen/src/lints/utils.rs:85:53
   |
85 |             let def_id = cx.tables.qpath_def(qpath, expr.id).def_id();
   |                                                     ^^^^^^^ expected struct `rustc::hir::HirId`, found struct `syntax::ast::NodeId`
   |
   = note: expected type `rustc::hir::HirId`
              found type `syntax::ast::NodeId`

error[E0308]: mismatched types
   --> /home/micucci/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/f66780b/codegen/src/lints/utils.rs:119:70
    |
119 |                                 let def = cx.tables.qpath_def(qpath, expr.id);
    |                                                                      ^^^^^^^ expected struct `rustc::hir::HirId`, found struct `syntax::ast::NodeId`
    |
    = note: expected type `rustc::hir::HirId`
               found type `syntax::ast::NodeId`

error: aborting due to 6 previous errors

error: Could not compile `rocket_codegen`.
warning: build failed, waiting for other jobs to finish...
error[E0599]: no method named `current_level` found for type `&rustc::lint::LateContext<'a, 'tcx>` in the current scope
   --> /home/micucci/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/9108e79/codegen/src/lints/mod.rs:252:15
    |
252 |         if cx.current_level(UNMOUNTED_ROUTE) != Level::Allow {
    |               ^^^^^^^^^^^^^

error[E0599]: no method named `current_level` found for type `&rustc::lint::LateContext<'a, 'tcx>` in the current scope
   --> /home/micucci/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/9108e79/codegen/src/lints/mod.rs:258:15
    |
258 |         if cx.current_level(UNMANAGED_STATE) == Level::Allow {
    |               ^^^^^^^^^^^^^

error[E0616]: field `liberated_fn_sigs` of struct `rustc::ty::TypeckTables` is private
   --> /home/micucci/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/9108e79/codegen/src/lints/mod.rs:264:28
    |
264 |         if let Some(sig) = cx.tables.liberated_fn_sigs.get(&fn_id) {
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: a method `liberated_fn_sigs` also exists, perhaps you wish to call it

error[E0308]: mismatched types
   --> /home/micucci/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/9108e79/codegen/src/lints/mod.rs:264:60
    |
264 |         if let Some(sig) = cx.tables.liberated_fn_sigs.get(&fn_id) {
    |                                                            ^^^^^^ expected struct `rustc::hir::ItemLocalId`, found struct `syntax::ast::NodeId`
    |
    = note: expected type `&rustc::hir::ItemLocalId`
               found type `&syntax::ast::NodeId`

error[E0616]: field `type_dependent_defs` of struct `rustc::ty::TypeckTables` is private
  --> /home/micucci/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/9108e79/codegen/src/lints/utils.rs:49:5
   |
49 |     cx.tables.type_dependent_defs
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: a method `type_dependent_defs` also exists, perhaps you wish to call it

error[E0308]: mismatched types
  --> /home/micucci/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/9108e79/codegen/src/lints/utils.rs:50:14
   |
50 |         .get(&expr.id)
   |              ^^^^^^^^ expected struct `rustc::hir::ItemLocalId`, found struct `syntax::ast::NodeId`
   |
   = note: expected type `&rustc::hir::ItemLocalId`
              found type `&syntax::ast::NodeId`

error[E0308]: mismatched types
  --> /home/micucci/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/9108e79/codegen/src/lints/utils.rs:85:53
   |
85 |             let def_id = cx.tables.qpath_def(qpath, expr.id).def_id();
   |                                                     ^^^^^^^ expected struct `rustc::hir::HirId`, found struct `syntax::ast::NodeId`
   |
   = note: expected type `rustc::hir::HirId`
              found type `syntax::ast::NodeId`

error[E0308]: mismatched types
   --> /home/micucci/.cargo/git/checkouts/rocket-8bf16d9ca7e90bdc/9108e79/codegen/src/lints/utils.rs:119:70
    |
119 |                                 let def = cx.tables.qpath_def(qpath, expr.id);
    |                                                                      ^^^^^^^ expected struct `rustc::hir::HirId`, found struct `syntax::ast::NodeId`
    |
    = note: expected type `rustc::hir::HirId`
               found type `syntax::ast::NodeId`

error: aborting due to 8 previous errors

error: Could not compile `rocket_codegen`.
enhancement

Most helpful comment

Same issue here. Logs

[package]
name = "hello-rocket"
version = "0.1.0"
authors = ["Stepan Kuzmin <[email protected]>"]

[dependencies]
rocket = "0.3.1"
rocket_codegen = "0.3.1"
#![feature(plugin)]
#![plugin(rocket_codegen)]

extern crate rocket;

#[get("/")]
fn index() -> &'static str {
    "Hello, world!"
}

fn main() {
    rocket::ignite().mount("/", routes![index]).launch();
}

macOS Sierra 10.12.6
nightly-x86_64-apple-darwin - rustc 1.21.0-nightly (df511d554 2017-08-14)

All 4 comments

Same issue here. Logs

[package]
name = "hello-rocket"
version = "0.1.0"
authors = ["Stepan Kuzmin <[email protected]>"]

[dependencies]
rocket = "0.3.1"
rocket_codegen = "0.3.1"
#![feature(plugin)]
#![plugin(rocket_codegen)]

extern crate rocket;

#[get("/")]
fn index() -> &'static str {
    "Hello, world!"
}

fn main() {
    rocket::ignite().mount("/", routes![index]).launch();
}

macOS Sierra 10.12.6
nightly-x86_64-apple-darwin - rustc 1.21.0-nightly (df511d554 2017-08-14)

Yes, this is known. The latest nightly introduced breaking changes to linting, yet again. There will be a new release shortly.

For the moment, please use yesterday's nightly. You can do this with rustup as follows: rustup default nightly-2017-08-13.

Fixed with 8183f636305cef4adaa9525506c33cbea72d1745. Working on pushing a release now.

Confirmed that master now builds on latest rust. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Turakar picture Turakar  路  4Comments

shssoichiro picture shssoichiro  路  4Comments

lucklove picture lucklove  路  4Comments

Ronaldho80 picture Ronaldho80  路  3Comments

sphinxc0re picture sphinxc0re  路  3Comments