Rust-clippy: Build failure with nightly 2018-05-21

Created on 22 May 2018  路  4Comments  路  Source: rust-lang/rust-clippy

There are at least three breaking PRs:
https://github.com/rust-lang/rust/pull/50520
https://github.com/rust-lang/rust/pull/50801
https://github.com/rust-lang/rust/pull/50851

Clippy probably could benefit from some of those changes but it would require refactoring. I don't have enough experience/time to do it.


Click here for the build log

error[E0308]: mismatched types
   --> clippy_lints/src/utils/mod.rs:303:103
    |
303 |             .predicate_for_trait_def(cx.param_env, traits::ObligationCause::dummy(), trait_id, 0, ty, ty_params);
    |                                                                                                       ^^^^^^^^^ expected struct `rustc::ty::subst::Kind`, found reference
    |
    = note: expected type `&[rustc::ty::subst::Kind<'_>]`
               found type `&[&'tcx rustc::ty::TyS<'tcx>]`

error[E0308]: mismatched types
   --> clippy_lints/src/utils/hir_utils.rs:124:83
    |
124 |                 let mut celcx = constant_context(self.cx, self.cx.tcx.body_tables(ll_id));
    |                                                                                   ^^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
   --> clippy_lints/src/utils/hir_utils.rs:125:59
    |
125 |                 let ll = celcx.expr(&self.cx.tcx.hir.body(ll_id).value);
    |                                                           ^^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
   --> clippy_lints/src/utils/hir_utils.rs:126:83
    |
126 |                 let mut celcx = constant_context(self.cx, self.cx.tcx.body_tables(rl_id));
    |                                                                                   ^^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
   --> clippy_lints/src/utils/hir_utils.rs:127:59
    |
127 |                 let rl = celcx.expr(&self.cx.tcx.hir.body(rl_id).value);
    |                                                           ^^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
   --> clippy_lints/src/utils/hir_utils.rs:240:83
    |
240 |                 let mut celcx = constant_context(self.cx, self.cx.tcx.body_tables(ll_id));
    |                                                                                   ^^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
   --> clippy_lints/src/utils/hir_utils.rs:241:55
    |
241 |                 self.tables = self.cx.tcx.body_tables(ll_id);
    |                                                       ^^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
   --> clippy_lints/src/utils/hir_utils.rs:242:59
    |
242 |                 let ll = celcx.expr(&self.cx.tcx.hir.body(ll_id).value);
    |                                                           ^^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
   --> clippy_lints/src/utils/hir_utils.rs:244:83
    |
244 |                 let mut celcx = constant_context(self.cx, self.cx.tcx.body_tables(rl_id));
    |                                                                                   ^^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
   --> clippy_lints/src/utils/hir_utils.rs:245:55
    |
245 |                 self.tables = self.cx.tcx.body_tables(rl_id);
    |                                                       ^^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
   --> clippy_lints/src/utils/hir_utils.rs:246:59
    |
246 |                 let rl = celcx.expr(&self.cx.tcx.hir.body(rl_id).value);
    |                                                           ^^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
   --> clippy_lints/src/utils/hir_utils.rs:482:55
    |
482 |                 self.tables = self.cx.tcx.body_tables(l_id);
    |                                                       ^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
   --> clippy_lints/src/utils/hir_utils.rs:483:54
    |
483 |                 self.hash_expr(&self.cx.tcx.hir.body(l_id).value);
    |                                                      ^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
   --> clippy_lints/src/utils/inspector.rs:338:45
    |
338 |             print_expr(cx, &cx.tcx.hir.body(body_id).value, indent + 1);
    |                                             ^^^^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
  --> clippy_lints/src/enum_clike.rs:55:60
   |
55 |                     let did = cx.tcx.hir.body_owner_def_id(body_id);
   |                                                            ^^^^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
   |
   = note: expected type `rustc::hir::BodyId`
              found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
   --> clippy_lints/src/shadow.rs:353:45
    |
353 |             check_expr(cx, &cx.tcx.hir.body(body_id).value, bindings);
    |                                             ^^^^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error[E0308]: mismatched types
   --> clippy_lints/src/shadow.rs:359:62
    |
359 |         TyTypeof(body_id) => check_expr(cx, &cx.tcx.hir.body(body_id).value, bindings),
    |                                                              ^^^^^^^ expected struct `rustc::hir::BodyId`, found struct `rustc::hir::AnonConst`
    |
    = note: expected type `rustc::hir::BodyId`
               found type `rustc::hir::AnonConst`

error: aborting due to 17 previous errors

Most helpful comment

published as 0.0.204

All 4 comments

If somebody wants working clippy ASAP you can use commit referenced above.
But beware, it was made in rush with 2 factors: compile and pass tests. No guarantees it won't start another world war, begin apocalypse or whatever else.

@mati865 Feel free to open a PR and see if the tests pass on Travis and AppVeyor, if they do it's probably fine :)

I have problem too. Last test build of Travis CI used version 1.28.0-nightly (a1d4a9503 2018-05-20), but I have 1.28.0-nightly (cb20f68d0 2018-05-21) and not build clippy.

published as 0.0.204

Was this page helpful?
0 / 5 - 0 ratings