rust-lang / cargo

The Rust package manager
https://doc.rust-lang.org/cargo
Apache License 2.0
12.71k stars 2.41k forks source link

Cargo fix fails without error - 2018 edition #6389

Closed ambaxter closed 5 years ago

ambaxter commented 5 years ago

Problem cargo fix fails without any errors for the new 2018 edition

abaxter$ cargo fix
    Checking rand_core v0.3.0
    Checking void v1.0.2
    Checking stable_deref_trait v1.1.1
    Checking cfg-if v0.1.6
    Checking rustc-demangle v0.1.9
    Checking scopeguard v0.3.3
    Checking either v1.5.0
    Checking bitflags v1.0.4
    Checking rustc-serialize v0.3.24
    Checking ord_subset v3.1.1
    Checking bimap v0.1.5
    Checking anymap v0.12.1
    Checking enum_index v0.2.0
    Checking owning_ref v0.4.0
    Checking num-traits v0.2.6
    Checking libc v0.2.44
    Checking serde v1.0.80
    Checking unreachable v1.0.0
    Checking itertools v0.7.11
    Checking smallvec v0.6.7
    Checking rand_core v0.2.2
    Checking lock_api v0.1.5
    Checking rand v0.5.5
    Checking backtrace v0.3.9
    Checking time v0.1.40
    Checking failure v0.1.3
    Checking num-integer v0.1.39
    Checking num-traits v0.1.43
    Checking num-complex v0.2.1
    Checking float-cmp v0.4.0
    Checking ordered-float v0.5.2
    Checking num-bigint v0.2.1
    Checking num-iter v0.1.37
    Checking chrono v0.4.6
    Checking parking_lot_core v0.3.1
    Checking parking_lot v0.6.4
    Checking num-rational v0.2.1
    Checking num v0.2.0
    Checking decimal v2.0.4
    Checking string-interner v0.7.0
    Checking expert v0.1.0 (/Users/abaxter/Projects/rust/expert)
warning: failed to automatically apply fixes suggested by rustc to crate `expert`

after fixes were automatically applied the compiler reported errors within these files:

  * src/builder.rs
  * src/lib.rs
  * src/shared/compiler/as_ref.rs
  * src/shared/compiler/as_vec.rs
  * src/shared/compiler/builder.rs
  * src/shared/context.rs
  * src/shared/fact.rs
  * src/shared/nodes/beta.rs
  * src/shared/runtimes/array/builder.rs

This likely indicates a bug in either rustc or cargo itself,
and we would appreciate a bug report! You're likely to see
a number of compiler warnings after this message which cargo
attempted to fix but failed. If you could open an issue at
https://github.com/rust-lang/cargo/issues
quoting the full output of this command we'd be very appreciative!

warning: unused `#[macro_use]` import
 --> src/lib.rs:1:1
  |
1 | #[macro_use]
  | ^^^^^^^^^^^^
  |
  = note: #[warn(unused_imports)] on by default

warning: unused `#[macro_use]` import
 --> src/lib.rs:9:1
  |
9 | #[macro_use]
  | ^^^^^^^^^^^^

warning: unused `#[macro_use]` import
  --> src/lib.rs:18:1
   |
18 | #[macro_use]
   | ^^^^^^^^^^^^

warning: unused `#[macro_use]` import
  --> src/lib.rs:27:1
   |
27 | #[macro_use]
   | ^^^^^^^^^^^^

warning: unused import: `Duration`
 --> src/shared/fact.rs:7:41
  |
7 | use chrono::{NaiveTime, Date, DateTime, Duration, Utc};
  |                                         ^^^^^^^^

warning: unused import: `crate::runtime::memory::StringCache`
  --> src/shared/fact.rs:11:5
   |
11 | use crate::runtime::memory::StringCache;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::shared::nodes::alpha::HashEqField`
  --> src/shared/fact.rs:12:5
   |
12 | use crate::shared::nodes::alpha::HashEqField;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::shared::nodes::alpha::HashEqField`
   --> src/shared/compiler/as_ref.rs:116:9
    |
116 |     use crate::shared::nodes::alpha::HashEqField;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::shared::nodes::alpha::HashEqField`
   --> src/shared/compiler/as_vec.rs:116:9
    |
116 |     use crate::shared::nodes::alpha::HashEqField;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `DrainWhere`
 --> src/shared/compiler/builder.rs:3:40
  |
3 | use crate::shared::compiler::prelude::{DrainWhere, ProvidesNode};
  |                                        ^^^^^^^^^^

warning: patterns aren't allowed in methods without bodies
  --> src/shared/compiler/builder.rs:40:55
   |
40 |     fn rule_with_agenda<S: AsRef<str>, A: AsRef<str>>(mut self, name: S, agenda_group: A) -> Self::RB;
   |                                                       ^^^^^^^^
   |
   = note: #[warn(patterns_in_fns_without_body)] on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #35203 <https://github.com/rust-lang/rust/issues/35203>

warning: unused import: `Duration`
 --> src/shared/context.rs:4:41
  |
4 | use chrono::{NaiveTime, Date, DateTime, Duration, Utc};
  |                                         ^^^^^^^^

warning: unused import: `std::string::ToString`
 --> src/shared/nodes/beta.rs:2:5
  |
2 | use std::string::ToString;
  |     ^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: `Float`, `Integer`, `NumCast`, `ToPrimitive`
 --> src/shared/nodes/beta.rs:3:11
  |
3 | use num::{Integer, Float, ToPrimitive, NumCast};
  |           ^^^^^^^  ^^^^^  ^^^^^^^^^^^  ^^^^^^^

warning: unused import: `num::cast`
 --> src/shared/nodes/beta.rs:4:5
  |
4 | use num::cast;
  |     ^^^^^^^^^

warning: unused import: `Duration`
 --> src/shared/nodes/beta.rs:9:41
  |
9 | use chrono::{NaiveTime, Date, DateTime, Duration, Utc};
  |                                         ^^^^^^^^

warning: unused import: `DrainWhere`
 --> src/shared/runtimes/array/builder.rs:6:40
  |
6 | use crate::shared::compiler::prelude::{DrainWhere, ProvidesNode};
  |                                        ^^^^^^^^^^

warning: unused import: `crate::shared::nodes::alpha::HashEqField`
  --> src/shared/runtimes/array/builder.rs:14:5
   |
14 | use crate::shared::nodes::alpha::HashEqField;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `std::any::TypeId`
  --> src/shared/runtimes/array/builder.rs:23:5
   |
23 | use std::any::TypeId;
   |     ^^^^^^^^^^^^^^^^

warning: unused import: `std::fmt::Debug`
  --> src/shared/runtimes/array/builder.rs:24:5
   |
24 | use std::fmt::Debug;
   |     ^^^^^^^^^^^^^^^

warning: unused import: `self::StatementGroup::*`
   --> src/shared/runtimes/array/builder.rs:105:13
    |
105 |         use self::StatementGroup::*;
    |             ^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `self::StatementGroup::*`
   --> src/shared/runtimes/array/builder.rs:114:13
    |
114 |         use self::StatementGroup::*;
    |             ^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `self::Stage1Node::*`
   --> src/shared/runtimes/array/builder.rs:327:13
    |
327 |         use self::Stage1Node::*;
    |             ^^^^^^^^^^^^^^^^^^^

warning: unreachable pattern
  --> src/traits.rs:95:13
   |
95 |             _ => {}
   |             ^
   |
   = note: #[warn(unreachable_patterns)] on by default

warning: unreachable pattern
   --> src/network/tests.rs:241:13
    |
241 |             _ => false
    |             ^

warning: unreachable pattern
   --> src/builder.rs:419:13
    |
419 |             _ => {}
    |             ^

warning: unused variable: `s`
    --> src/shared/nodes/beta.rs:1411:13
     |
1411 |         let s: SLimit<&'static str, &'static str> = SLimit::St("Test");
     |             ^ help: consider using `_s` instead
     |
     = note: #[warn(unused_variables)] on by default

warning: unused variable: `string_repo`
  --> src/base.rs:54:14
   |
54 |         let (string_repo, rules, condition_map) = builder.explode();
   |              ^^^^^^^^^^^ help: consider using `_string_repo` instead

warning: unused variable: `hash_eq_nodes`
  --> src/base.rs:57:14
   |
57 |         let (hash_eq_nodes, alpha_network, statement_memories) = Self::compile_alpha_network(condition_map);
   |              ^^^^^^^^^^^^^ help: consider using `_hash_eq_nodes` instead

warning: unused variable: `alpha_network`
  --> src/base.rs:57:29
   |
57 |         let (hash_eq_nodes, alpha_network, statement_memories) = Self::compile_alpha_network(condition_map);
   |                             ^^^^^^^^^^^^^ help: consider using `_alpha_network` instead

warning: unused variable: `statement_memories`
  --> src/base.rs:57:44
   |
57 |         let (hash_eq_nodes, alpha_network, statement_memories) = Self::compile_alpha_network(condition_map);
   |                                            ^^^^^^^^^^^^^^^^^^ help: consider using `_statement_memories` instead

warning: unused variable: `pos`
   --> src/base.rs:216:28
    |
216 |                 .filter(|&(pos, ref intersect)| !intersect.is_empty())
    |                            ^^^ help: consider using `_pos` instead

warning: unused variable: `pos`
   --> src/base.rs:217:32
    |
217 |                 .max_by_key(|&(pos, ref intersect)| !intersect.len()) {
    |                                ^^^ help: consider using `_pos` instead

warning: unused variable: `data`
   --> src/network/tests.rs:291:22
    |
291 |             &Ord(ref data, ref test) => {
    |                      ^^^^ help: consider using `_data` instead

warning: unused variable: `test`
   --> src/network/tests.rs:291:32
    |
291 |             &Ord(ref data, ref test) => {
    |                                ^^^^ help: consider using `_test` instead

warning: unused variable: `data`
   --> src/network/tests.rs:294:21
    |
294 |             &Fl(ref data, ref test) => {
    |                     ^^^^ help: consider using `_data` instead

warning: unused variable: `test`
   --> src/network/tests.rs:294:31
    |
294 |             &Fl(ref data, ref test) => {
    |                               ^^^^ help: consider using `_test` instead

warning: unused variable: `data`
   --> src/network/tests.rs:297:22
    |
297 |             &Str(ref data, ref test) => {
    |                      ^^^^ help: consider using `_data` instead

warning: unused variable: `test`
   --> src/network/tests.rs:297:32
    |
297 |             &Str(ref data, ref test) => {
    |                                ^^^^ help: consider using `_test` instead

warning: unused variable: `data`
   --> src/builder.rs:339:22
    |
339 |             &Ord{ref data, test} => {
    |                      ^^^^ help: try ignoring the field: `data: _`

warning: unused variable: `test`
   --> src/builder.rs:339:28
    |
339 |             &Ord{ref data, test} => {
    |                            ^^^^ help: try ignoring the field: `test: _`

warning: unused variable: `conditions`
   --> src/shared/compiler/as_ref.rs:144:27
    |
144 |         fn create_hash_eq(conditions: &[AlphaNode<Self>]) -> Self::HashEq {
    |                           ^^^^^^^^^^ help: consider using `_conditions` instead

warning: unused variable: `conditions`
   --> src/shared/compiler/as_vec.rs:144:27
    |
144 |         fn create_hash_eq(conditions: &[AlphaNode<Self>]) -> Self::HashEq {
    |                           ^^^^^^^^^^ help: consider using `_conditions` instead

warning: variable does not need to be mutable
   --> src/builder.rs:162:12
    |
162 |     fn new(mut rule_builder: RuleBuilder<T>) -> StatementBuilder<T> {
    |            ----^^^^^^^^^^^^
    |            |
    |            help: remove this `mut`
    |
    = note: #[warn(unused_mut)] on by default

warning: variable does not need to be mutable
   --> src/shared/compiler/prelude.rs:518:17
    |
518 |             for mut o in any.drain_where(|n| n.is_singleton()) {
    |                 ----^
    |                 |
    |                 help: remove this `mut`

warning: variable does not need to be mutable
   --> src/shared/compiler/prelude.rs:541:17
    |
541 |             for mut o in all.drain_where(|n| n.is_singleton()) {
    |                 ----^
    |                 |
    |                 help: remove this `mut`

warning: variable does not need to be mutable
   --> src/shared/compiler/prelude.rs:556:17
    |
556 |             for mut o in cum_any {
    |                 ----^
    |                 |
    |                 help: remove this `mut`

warning: variable does not need to be mutable
   --> src/shared/runtimes/array/builder.rs:379:28
    |
379 |     fn rule<S: AsRef<str>>(mut self, name: S) -> Self::RB {
    |                            ----^^^^
    |                            |
    |                            help: remove this `mut`

warning: variable does not need to be mutable
   --> src/shared/runtimes/array/builder.rs:595:17
    |
595 |             let mut current_group_id = self.rule_data.current_group;
    |                 ----^^^^^^^^^^^^^^^^
    |                 |
    |                 help: remove this `mut`

warning: variable does not need to be mutable
   --> src/shared/runtimes/array/builder.rs:596:17
    |
596 |             let mut parent_id = self.rule_data.statement_groups[&current_group_id].parent();
    |                 ----^^^^^^^^^
    |                 |
    |                 help: remove this `mut`

warning: method is never used: `compile_beta_network`
   --> src/base.rs:174:5
    |
174 | /     fn compile_beta_network(statement_memories: &HashMap<StatementId, MemoryId>,
175 | |                             statement_rule_map: &HashMap<StatementId, RuleId>,
176 | |                             mut hash_eq_nodes: HashMap<HashEqId, (T::HashEq, HashEqNode)>,
177 | |                             mut alpha_network: Vec<AlphaNode<T>>) {
...   |
235 | |         }
236 | |     }
    | |_____^
    |
    = note: #[warn(dead_code)] on by default

warning: method is never used: `add_alpha_destination`
   --> src/base.rs:238:5
    |
238 | /     fn add_alpha_destination(hash_eq_nodes: &mut HashMap<HashEqId, (T::HashEq, HashEqNode)>,
239 | |                              alpha_network: &mut Vec<AlphaNode<T>>,
240 | |                              memory: MemoryId,
241 | |                              destination: DestinationNode) {
...   |
247 | |         }
248 | |     }
    | |_____^

warning: field is never used: `id`
   --> src/base.rs:291:5
    |
291 |     id: AlphaId,
    |     ^^^^^^^^^^^

warning: field is never used: `test`
   --> src/base.rs:292:5
    |
292 |     test: AlphaTest<T>,
    |     ^^^^^^^^^^^^^^^^^^

warning: field is never used: `store`
   --> src/base.rs:293:5
    |
293 |     store: bool,
    |     ^^^^^^^^^^^

warning: field is never used: `dest`
   --> src/base.rs:294:5
    |
294 |     dest: Vec<DestinationNode>
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `hash_eq_node`
   --> src/base.rs:311:5
    |
311 |     hash_eq_node: HashMap<T::HashEq, HashEqNode>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `alpha_network`
   --> src/base.rs:312:5
    |
312 |     alpha_network: Vec<AlphaNode<T>>
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `id`
   --> src/base.rs:335:5
    |
335 |     id: BetaId,
    |     ^^^^^^^^^^

warning: field is never used: `b_type`
   --> src/base.rs:336:5
    |
336 |     b_type: BetaNodeType,
    |     ^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `destinations`
   --> src/base.rs:337:5
    |
337 |     destinations: Vec<DestinationNode>
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `b_network`
   --> src/base.rs:341:5
    |
341 |     b_network: Vec<BetaNode>
    |     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `tripwire`
   --> src/base.rs:345:5
    |
345 |     tripwire: Vec<bool>,
    |     ^^^^^^^^^^^^^^^^^^^

warning: method is never used: `collapse`
   --> src/builders/statement.rs:269:5
    |
269 |     fn collapse(mut self) -> Result<R> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `condition_id`
   --> src/shared/runtimes/array/builder.rs:188:5
    |
188 |     condition_id: ConditionId,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^

warning: method is never used: `test`
   --> src/shared/runtimes/array/builder.rs:490:5
    |
490 |     fn test(&mut self) {
    |     ^^^^^^^^^^^^^^^^^^

warning: field is never used: `rule_data`
   --> src/shared/runtimes/array/builder.rs:618:5
    |
618 |     rule_data: ArrayRuleData,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `consequence_data`
   --> src/shared/runtimes/array/builder.rs:619:5
    |
619 |     consequence_data: ArrayConsequenceData,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused `#[macro_use]` import
 --> src/lib.rs:1:1
  |
1 | #[macro_use]
  | ^^^^^^^^^^^^
  |
  = note: #[warn(unused_imports)] on by default

warning: unused `#[macro_use]` import
 --> src/lib.rs:9:1
  |
9 | #[macro_use]
  | ^^^^^^^^^^^^

warning: unused `#[macro_use]` import
  --> src/lib.rs:18:1
   |
18 | #[macro_use]
   | ^^^^^^^^^^^^

warning: unused `#[macro_use]` import
  --> src/lib.rs:27:1
   |
27 | #[macro_use]
   | ^^^^^^^^^^^^

warning: unused import: `Duration`
 --> src/shared/fact.rs:7:41
  |
7 | use chrono::{NaiveTime, Date, DateTime, Duration, Utc};
  |                                         ^^^^^^^^

warning: unused import: `crate::runtime::memory::StringCache`
  --> src/shared/fact.rs:11:5
   |
11 | use crate::runtime::memory::StringCache;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::shared::nodes::alpha::HashEqField`
  --> src/shared/fact.rs:12:5
   |
12 | use crate::shared::nodes::alpha::HashEqField;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `DrainWhere`
 --> src/shared/compiler/builder.rs:3:40
  |
3 | use crate::shared::compiler::prelude::{DrainWhere, ProvidesNode};
  |                                        ^^^^^^^^^^

warning: patterns aren't allowed in methods without bodies
  --> src/shared/compiler/builder.rs:40:55
   |
40 |     fn rule_with_agenda<S: AsRef<str>, A: AsRef<str>>(mut self, name: S, agenda_group: A) -> Self::RB;
   |                                                       ^^^^^^^^
   |
   = note: #[warn(patterns_in_fns_without_body)] on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #35203 <https://github.com/rust-lang/rust/issues/35203>

warning: unused import: `Duration`
 --> src/shared/context.rs:4:41
  |
4 | use chrono::{NaiveTime, Date, DateTime, Duration, Utc};
  |                                         ^^^^^^^^

warning: unused import: `std::string::ToString`
 --> src/shared/nodes/beta.rs:2:5
  |
2 | use std::string::ToString;
  |     ^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: `Float`, `Integer`, `NumCast`, `ToPrimitive`
 --> src/shared/nodes/beta.rs:3:11
  |
3 | use num::{Integer, Float, ToPrimitive, NumCast};
  |           ^^^^^^^  ^^^^^  ^^^^^^^^^^^  ^^^^^^^

warning: unused import: `num::cast`
 --> src/shared/nodes/beta.rs:4:5
  |
4 | use num::cast;
  |     ^^^^^^^^^

warning: unused import: `Duration`
 --> src/shared/nodes/beta.rs:9:41
  |
9 | use chrono::{NaiveTime, Date, DateTime, Duration, Utc};
  |                                         ^^^^^^^^

warning: unused import: `DrainWhere`
 --> src/shared/runtimes/array/builder.rs:6:40
  |
6 | use crate::shared::compiler::prelude::{DrainWhere, ProvidesNode};
  |                                        ^^^^^^^^^^

warning: unused import: `crate::shared::nodes::alpha::HashEqField`
  --> src/shared/runtimes/array/builder.rs:14:5
   |
14 | use crate::shared::nodes::alpha::HashEqField;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `std::any::TypeId`
  --> src/shared/runtimes/array/builder.rs:23:5
   |
23 | use std::any::TypeId;
   |     ^^^^^^^^^^^^^^^^

warning: unused import: `std::fmt::Debug`
  --> src/shared/runtimes/array/builder.rs:24:5
   |
24 | use std::fmt::Debug;
   |     ^^^^^^^^^^^^^^^

warning: unused import: `self::StatementGroup::*`
   --> src/shared/runtimes/array/builder.rs:105:13
    |
105 |         use self::StatementGroup::*;
    |             ^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `self::StatementGroup::*`
   --> src/shared/runtimes/array/builder.rs:114:13
    |
114 |         use self::StatementGroup::*;
    |             ^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `self::Stage1Node::*`
   --> src/shared/runtimes/array/builder.rs:327:13
    |
327 |         use self::Stage1Node::*;
    |             ^^^^^^^^^^^^^^^^^^^

warning: unreachable pattern
  --> src/traits.rs:95:13
   |
95 |             _ => {}
   |             ^
   |
   = note: #[warn(unreachable_patterns)] on by default

warning: unreachable pattern
   --> src/network/tests.rs:241:13
    |
241 |             _ => false
    |             ^

warning: unreachable pattern
   --> src/builder.rs:419:13
    |
419 |             _ => {}
    |             ^

warning: unused variable: `string_repo`
  --> src/base.rs:54:14
   |
54 |         let (string_repo, rules, condition_map) = builder.explode();
   |              ^^^^^^^^^^^ help: consider using `_string_repo` instead
   |
   = note: #[warn(unused_variables)] on by default

warning: unused variable: `hash_eq_nodes`
  --> src/base.rs:57:14
   |
57 |         let (hash_eq_nodes, alpha_network, statement_memories) = Self::compile_alpha_network(condition_map);
   |              ^^^^^^^^^^^^^ help: consider using `_hash_eq_nodes` instead

warning: unused variable: `alpha_network`
  --> src/base.rs:57:29
   |
57 |         let (hash_eq_nodes, alpha_network, statement_memories) = Self::compile_alpha_network(condition_map);
   |                             ^^^^^^^^^^^^^ help: consider using `_alpha_network` instead

warning: unused variable: `statement_memories`
  --> src/base.rs:57:44
   |
57 |         let (hash_eq_nodes, alpha_network, statement_memories) = Self::compile_alpha_network(condition_map);
   |                                            ^^^^^^^^^^^^^^^^^^ help: consider using `_statement_memories` instead

warning: unused variable: `pos`
   --> src/base.rs:216:28
    |
216 |                 .filter(|&(pos, ref intersect)| !intersect.is_empty())
    |                            ^^^ help: consider using `_pos` instead

warning: unused variable: `pos`
   --> src/base.rs:217:32
    |
217 |                 .max_by_key(|&(pos, ref intersect)| !intersect.len()) {
    |                                ^^^ help: consider using `_pos` instead

warning: unused variable: `data`
   --> src/network/tests.rs:291:22
    |
291 |             &Ord(ref data, ref test) => {
    |                      ^^^^ help: consider using `_data` instead

warning: unused variable: `test`
   --> src/network/tests.rs:291:32
    |
291 |             &Ord(ref data, ref test) => {
    |                                ^^^^ help: consider using `_test` instead

warning: unused variable: `data`
   --> src/network/tests.rs:294:21
    |
294 |             &Fl(ref data, ref test) => {
    |                     ^^^^ help: consider using `_data` instead

warning: unused variable: `test`
   --> src/network/tests.rs:294:31
    |
294 |             &Fl(ref data, ref test) => {
    |                               ^^^^ help: consider using `_test` instead

warning: unused variable: `data`
   --> src/network/tests.rs:297:22
    |
297 |             &Str(ref data, ref test) => {
    |                      ^^^^ help: consider using `_data` instead

warning: unused variable: `test`
   --> src/network/tests.rs:297:32
    |
297 |             &Str(ref data, ref test) => {
    |                                ^^^^ help: consider using `_test` instead

warning: unused variable: `data`
   --> src/builder.rs:339:22
    |
339 |             &Ord{ref data, test} => {
    |                      ^^^^ help: try ignoring the field: `data: _`

warning: unused variable: `test`
   --> src/builder.rs:339:28
    |
339 |             &Ord{ref data, test} => {
    |                            ^^^^ help: try ignoring the field: `test: _`

warning: variable does not need to be mutable
   --> src/builder.rs:162:12
    |
162 |     fn new(mut rule_builder: RuleBuilder<T>) -> StatementBuilder<T> {
    |            ----^^^^^^^^^^^^
    |            |
    |            help: remove this `mut`
    |
    = note: #[warn(unused_mut)] on by default

warning: variable does not need to be mutable
   --> src/shared/compiler/prelude.rs:518:17
    |
518 |             for mut o in any.drain_where(|n| n.is_singleton()) {
    |                 ----^
    |                 |
    |                 help: remove this `mut`

warning: variable does not need to be mutable
   --> src/shared/compiler/prelude.rs:541:17
    |
541 |             for mut o in all.drain_where(|n| n.is_singleton()) {
    |                 ----^
    |                 |
    |                 help: remove this `mut`

warning: variable does not need to be mutable
   --> src/shared/compiler/prelude.rs:556:17
    |
556 |             for mut o in cum_any {
    |                 ----^
    |                 |
    |                 help: remove this `mut`

warning: variable does not need to be mutable
   --> src/shared/runtimes/array/builder.rs:379:28
    |
379 |     fn rule<S: AsRef<str>>(mut self, name: S) -> Self::RB {
    |                            ----^^^^
    |                            |
    |                            help: remove this `mut`

warning: variable does not need to be mutable
   --> src/shared/runtimes/array/builder.rs:595:17
    |
595 |             let mut current_group_id = self.rule_data.current_group;
    |                 ----^^^^^^^^^^^^^^^^
    |                 |
    |                 help: remove this `mut`

warning: variable does not need to be mutable
   --> src/shared/runtimes/array/builder.rs:596:17
    |
596 |             let mut parent_id = self.rule_data.statement_groups[&current_group_id].parent();
    |                 ----^^^^^^^^^
    |                 |
    |                 help: remove this `mut`

warning: method is never used: `compile_beta_network`
   --> src/base.rs:174:5
    |
174 | /     fn compile_beta_network(statement_memories: &HashMap<StatementId, MemoryId>,
175 | |                             statement_rule_map: &HashMap<StatementId, RuleId>,
176 | |                             mut hash_eq_nodes: HashMap<HashEqId, (T::HashEq, HashEqNode)>,
177 | |                             mut alpha_network: Vec<AlphaNode<T>>) {
...   |
235 | |         }
236 | |     }
    | |_____^
    |
    = note: #[warn(dead_code)] on by default

warning: method is never used: `add_alpha_destination`
   --> src/base.rs:238:5
    |
238 | /     fn add_alpha_destination(hash_eq_nodes: &mut HashMap<HashEqId, (T::HashEq, HashEqNode)>,
239 | |                              alpha_network: &mut Vec<AlphaNode<T>>,
240 | |                              memory: MemoryId,
241 | |                              destination: DestinationNode) {
...   |
247 | |         }
248 | |     }
    | |_____^

warning: field is never used: `id`
   --> src/base.rs:291:5
    |
291 |     id: AlphaId,
    |     ^^^^^^^^^^^

warning: field is never used: `test`
   --> src/base.rs:292:5
    |
292 |     test: AlphaTest<T>,
    |     ^^^^^^^^^^^^^^^^^^

warning: field is never used: `store`
   --> src/base.rs:293:5
    |
293 |     store: bool,
    |     ^^^^^^^^^^^

warning: field is never used: `dest`
   --> src/base.rs:294:5
    |
294 |     dest: Vec<DestinationNode>
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `hash_eq_node`
   --> src/base.rs:311:5
    |
311 |     hash_eq_node: HashMap<T::HashEq, HashEqNode>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `alpha_network`
   --> src/base.rs:312:5
    |
312 |     alpha_network: Vec<AlphaNode<T>>
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `id`
   --> src/base.rs:335:5
    |
335 |     id: BetaId,
    |     ^^^^^^^^^^

warning: field is never used: `b_type`
   --> src/base.rs:336:5
    |
336 |     b_type: BetaNodeType,
    |     ^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `destinations`
   --> src/base.rs:337:5
    |
337 |     destinations: Vec<DestinationNode>
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `b_network`
   --> src/base.rs:341:5
    |
341 |     b_network: Vec<BetaNode>
    |     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `tripwire`
   --> src/base.rs:345:5
    |
345 |     tripwire: Vec<bool>,
    |     ^^^^^^^^^^^^^^^^^^^

warning: method is never used: `collapse`
   --> src/builders/statement.rs:269:5
    |
269 |     fn collapse(mut self) -> Result<R> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `condition_id`
   --> src/shared/runtimes/array/builder.rs:188:5
    |
188 |     condition_id: ConditionId,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^

warning: method is never used: `test`
   --> src/shared/runtimes/array/builder.rs:490:5
    |
490 |     fn test(&mut self) {
    |     ^^^^^^^^^^^^^^^^^^

warning: field is never used: `rule_data`
   --> src/shared/runtimes/array/builder.rs:618:5
    |
618 |     rule_data: ArrayRuleData,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never used: `consequence_data`
   --> src/shared/runtimes/array/builder.rs:619:5
    |
619 |     consequence_data: ArrayConsequenceData,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: `StatementValues`, `ValueHolder`
  --> src/bin/sandbox.rs:18:35
   |
18 | use expert::builders::statement::{ValueHolder, StatementValues, StatementConditions};
   |                                   ^^^^^^^^^^^  ^^^^^^^^^^^^^^^
   |
   = note: #[warn(unused_imports)] on by default

warning: unused import: `expert::shared::nodes::alpha::HashEqField`
  --> src/bin/sandbox.rs:23:5
   |
23 | use expert::shared::nodes::alpha::HashEqField;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: `StatementValues`, `ValueHolder`
  --> src/bin/sandbox.rs:18:35
   |
18 | use expert::builders::statement::{ValueHolder, StatementValues, StatementConditions};
   |                                   ^^^^^^^^^^^  ^^^^^^^^^^^^^^^
   |
   = note: #[warn(unused_imports)] on by default

warning: unused import: `expert::shared::nodes::alpha::HashEqField`
  --> src/bin/sandbox.rs:23:5
   |
23 | use expert::shared::nodes::alpha::HashEqField;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    Finished dev [unoptimized + debuginfo] target(s) in 23.29s

Steps

  1. Checkout https://github.com/ambaxter/expert-rs/tree/edition_2018
  2. Run Cargo Fix
  3. Error

Notes

Output of cargo version: abaxter$ cargo version cargo 1.32.0-nightly (5e85ba14a 2018-12-02)

OS: OS X 10.4.1

jimmycuadra commented 5 years ago

I had the same issue on another code base (cargo fix failed but didn't show any actual compiler errors.) If it'd be useful to share the code (or open a separate issue) please let me know.

ambaxter commented 5 years ago

Please do!

ehuss commented 5 years ago

This is due to rust-lang/rust#54180.

ambaxter commented 5 years ago

According to the issue that shouldn't be a problem with the 2018 edition?

ehuss commented 5 years ago

According to the issue that shouldn't be a problem with the 2018 edition?

Yea, I feel like that statement isn't quite correct. Using default binding modes is preferred in all editions, but AFAIK there are no lints for converting the old style (even with the idiom lints). Would you mind making a comment on the issue that it is affecting you on the 2018 edition? I'd fix it myself, but I don't know enough about compiler lints to know how to grow the span.

Oh, and just FYI, if you're confused that cargo didn't display the actual error, you can pass the --broken-code option to cargo fix to force it to leave the code in a broken state in which case you can manually inspect it and fix it.

ambaxter commented 5 years ago

updated

ambaxter commented 5 years ago

@ehuss yes, that was the problem. Thanks!

ehuss commented 5 years ago

Oh, I meant leave a comment on rust-lang/rust#54180. This is an issue with rustc, and the more people that report something can sometimes help raise the priority. Someone who works on the compiler will need to fix it.

ambaxter commented 5 years ago

Done

alexcrichton commented 5 years ago

Sounds like this was diagnosed (yay!) so I'm going to close this in favor of the upstream Rust bug