rust-lang / rust-clippy

A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
https://rust-lang.github.io/rust-clippy/
Other
11.04k stars 1.48k forks source link

cargo clippy --fix fails and requests a bug report be entered #10133

Open hschimke opened 1 year ago

hschimke commented 1 year ago

When running cargo clippy --fix on my library project rxing (https://github.com/hschimke/rxing) I receive the below error with a request to submit the issue as a bug report for rustc.

rustc:

rustc --version
rustc 1.66.0 (69f9c33d7 2022-12-12)

cargo:

cargo --version
cargo 1.66.0 (d65d197ad 2022-11-15)

clippy:

cargo clippy --version 
clippy 0.1.66 (69f9c33d 2022-12-12)

Here is the complete text of the error:

warning: failed to automatically apply fixes suggested by rustc to crate `rxing`

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

  * src/client/result/CalendarParsedResult.rs
  * src/common/detector/monochrome_rectangle_detector.rs
  * src/common/reedsolomon/generic_gf_poly.rs
  * src/datamatrix/data_matrix_writer.rs
  * src/datamatrix/decoder/decoded_bit_stream_parser.rs
  * src/maxicode/decoder/decoded_bit_stream_parser.rs
  * src/multi_format_writer.rs
  * src/oned/multi_format_one_d_reader.rs
  * src/oned/multi_format_upc_ean_reader.rs
  * src/oned/rss/expanded/decoders/abstract_decoder_test_utils.rs
  * src/oned/rss/expanded/decoders/field_parser.rs
  * src/pdf417/decoder/decoded_bit_stream_parser.rs
  * src/pdf417/decoder/detection_result.rs
  * src/pdf417/decoder/ec/modulus_poly.rs
  * src/pdf417/decoder/pdf_417_scanning_decoder.rs
  * src/pdf417/encoder/pdf_417_high_level_encoder.rs
  * src/qrcode/encoder/encoder.rs
  * src/qrcode/encoder/minimal_encoder.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/rust/issues
quoting the full output of this command we'd be very appreciative!
Note that you may be able to make some more progress in the near-term
fixing code with the `--broken-code` flag

The following errors were reported:
error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_one_d_reader.rs:86:36
   |
86 |                 readers.push(Box::<oned::itf_reader::ITFReader>::default());
   |                                    ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
   --> src/oned/multi_format_one_d_reader.rs:104:32
    |
104 |             readers.push(Box::<oned::itf_reader::ITFReader>::default());
    |                                ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_upc_ean_reader.rs:49:36
   |
49 |                 readers.push(Box::<oned::ean_13_reader::EAN13Reader>::default());
   |                                    ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_upc_ean_reader.rs:51:36
   |
51 |                 readers.push(Box::<oned::upc_a_reader::UPCAReader>::default());
   |                                    ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_upc_ean_reader.rs:54:36
   |
54 |                 readers.push(Box::<oned::ean_8_reader::EAN8Reader>::default());
   |                                    ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_upc_ean_reader.rs:57:36
   |
57 |                 readers.push(Box::<oned::upc_e_reader::UPCEReader>::default());
   |                                    ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_upc_ean_reader.rs:61:32
   |
61 |             readers.push(Box::<oned::ean_13_reader::EAN13Reader>::default());
   |                                ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_upc_ean_reader.rs:63:32
   |
63 |             readers.push(Box::<oned::ean_8_reader::EAN8Reader>::default());
   |                                ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_upc_ean_reader.rs:64:32
   |
64 |             readers.push(Box::<oned::upc_e_reader::UPCEReader>::default());
   |                                ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:58:43
   |
58 |             BarcodeFormat::EAN_8 => Box::<oned::ean_8_writer::EAN8Writer>::default(),
   |                                           ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:59:43
   |
59 |             BarcodeFormat::UPC_E => Box::<oned::upc_e_writer::UPCEWriter>::default(),
   |                                           ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:60:44
   |
60 |             BarcodeFormat::EAN_13 => Box::<oned::ean_13_writer::EAN13Writer>::default(),
   |                                            ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:61:43
   |
61 |             BarcodeFormat::UPC_A => Box::<oned::upc_a_writer::UPCAWriter>::default(),
   |                                           ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:63:45
   |
63 |             BarcodeFormat::CODE_39 => Box::<oned::code_39_writer::Code39Writer>::default(),
   |                                             ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:64:45
   |
64 |             BarcodeFormat::CODE_93 => Box::<oned::code_93_writer::Code93Writer>::default(),
   |                                             ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:65:46
   |
65 |             BarcodeFormat::CODE_128 => Box::<oned::code_128_writer::Code128Writer>::default(),
   |                                              ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:66:41
   |
66 |             BarcodeFormat::ITF => Box::<oned::itf_writer::ITFWriter>::default(),
   |                                         ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:69:45
   |
69 |             BarcodeFormat::CODABAR => Box::<oned::code_128_writer::Code128Writer>::default(),
   |                                             ^^^^ use of undeclared crate or module `oned`

warning: unnecessary parentheses around block return value
   --> src/maxicode/decoder/decoded_bit_stream_parser.rs:262:5
    |
262 |     (str1_u16 - str2_u16)
    |     ^                   ^
    |
    = note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
    |
262 -     (str1_u16 - str2_u16)
262 +     str1_u16 - str2_u16
    |

warning: unused doc comment
  --> src/qrcode/encoder/encoder.rs:54:1
   |
54 | / /**
55 | |  * @author satorux@google.com (Satoru Takabayashi) - creator
56 | |  * @author dswitkin@google.com (Daniel Switkin) - ported from C++
57 | |  */
   | |___^ rustdoc does not generate documentation for macro invocations
   |
   = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion
   = note: `#[warn(unused_doc_comments)]` on by default

warning: unnecessary parentheses around function argument
   --> src/datamatrix/decoder/decoded_bit_stream_parser.rs:318:59
    |
318 |                         result.append_char(char::from_u32((cValue + 128)).unwrap());
    |                                                           ^            ^
    |
help: remove these parentheses
    |
318 -                         result.append_char(char::from_u32((cValue + 128)).unwrap());
318 +                         result.append_char(char::from_u32(cValue + 128).unwrap());
    |

warning: unused doc comment
  --> src/oned/rss/expanded/decoders/field_parser.rs:33:1
   |
33 | / /**
34 | |  * @author Pablo Orduña, University of Deusto (pablo.orduna@deusto.es)
35 | |  * @author Eduardo Castillejo, University of Deusto (eduardo.castillejo@deusto.es)
36 | |  */
   | |___^ rustdoc does not generate documentation for macro invocations
   |
   = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion

warning: unused import: `super::ITFReader`
  --> src/oned/multi_format_one_d_reader.rs:23:5
   |
23 | use super::ITFReader;
   |     ^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: unused import: `super::EAN13Reader`
  --> src/oned/multi_format_upc_ean_reader.rs:23:5
   |
23 | use super::EAN13Reader;
   |     ^^^^^^^^^^^^^^^^^^

warning: unused import: `super::EAN8Reader`
  --> src/oned/multi_format_upc_ean_reader.rs:24:5
   |
24 | use super::EAN8Reader;
   |     ^^^^^^^^^^^^^^^^^

warning: unused import: `super::UPCAReader`
  --> src/oned/multi_format_upc_ean_reader.rs:26:5
   |
26 | use super::UPCAReader;
   |     ^^^^^^^^^^^^^^^^^

warning: unused import: `super::UPCEReader`
  --> src/oned/multi_format_upc_ean_reader.rs:27:5
   |
27 | use super::UPCEReader;
   |     ^^^^^^^^^^^^^^^^^

warning: unused imports: `Code128Writer`, `Code39Writer`, `Code93Writer`, `EAN13Writer`, `EAN8Writer`, `ITFWriter`, `UPCAWriter`, `UPCEWriter`
  --> src/multi_format_writer.rs:23:9
   |
23 |         Code128Writer, Code39Writer, Code93Writer, EAN13Writer, EAN8Writer, ITFWriter, UPCAWriter,
   |         ^^^^^^^^^^^^^  ^^^^^^^^^^^^  ^^^^^^^^^^^^  ^^^^^^^^^^^  ^^^^^^^^^^  ^^^^^^^^^  ^^^^^^^^^^
24 |         UPCEWriter,
   |         ^^^^^^^^^^

warning: this `else { if .. }` block can be collapsed
   --> src/common/reedsolomon/generic_gf_poly.rs:309:24
    |
309 |                   } else {
    |  ________________________^
310 | |                     if !result.is_empty() {
311 | |                         result.push_str(" + ");
312 | |                     }
313 | |                 }
    | |_________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
    = note: `#[warn(clippy::collapsible_else_if)]` on by default
help: collapse nested if block
    |
309 ~                 } else if !result.is_empty() {
310 +                     result.push_str(" + ");
311 +                 }
    |

warning: this `else { if .. }` block can be collapsed
   --> src/qrcode/encoder/minimal_encoder.rs:204:16
    |
204 |           } else {
    |  ________________^
205 | |             if version.getVersionNumber() <= 26 {
206 | |                 VersionSize::MEDIUM
207 | |             } else {
208 | |                 VersionSize::LARGE
209 | |             }
210 | |         }
    | |_________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
help: collapse nested if block
    |
204 ~         } else if version.getVersionNumber() <= 26 {
205 +             VersionSize::MEDIUM
206 +         } else {
207 +             VersionSize::LARGE
208 +         }
    |

warning: consider removing unnecessary double parentheses
   --> src/datamatrix/decoder/decoded_bit_stream_parser.rs:318:59
    |
318 |                         result.append_char(char::from_u32((cValue + 128)).unwrap());
    |                                                           ^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_parens
    = note: `#[warn(clippy::double_parens)]` on by default

warning: this is a decimal constant
   --> src/pdf417/decoder/ec/modulus_poly.rs:144:32
    |
144 |         let mut sumDiff = vec![0032; largerCoefficients.len()];
    |                                ^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#zero_prefixed_literal
    = note: `#[warn(clippy::zero_prefixed_literal)]` on by default
help: if you mean to use a decimal constant, remove the `0` to avoid confusion
    |
144 |         let mut sumDiff = vec![32; largerCoefficients.len()];
    |                                ~~
help: if you mean to use an octal constant, use `0o`
    |
144 |         let mut sumDiff = vec![0o32; largerCoefficients.len()];
    |                                ~~~~

warning: this `if` statement can be collapsed
   --> src/pdf417/decoder/detection_result.rs:170:13
    |
170 | /             if
171 | |             //let (Some(lricw), Some(rricw)) =
172 | |             self.detectionRXingResultColumns[0]
173 | |                 .as_ref()
...   |
253 | |                 }
254 | |             }
    | |_____________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
    = note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
    |
170 ~             if self.detectionRXingResultColumns[0]
171 +                 .as_ref()
172 +                 .unwrap()
173 +                 .getCodewords()[codewordsRow]
174 +                 .is_some() && self.detectionRXingResultColumns[self.barcodeColumnCount + 1]
175 +                     .as_ref()
176 +                     .unwrap()
177 +                     .getCodewords()[codewordsRow]
178 +                     .is_some() && self.detectionRXingResultColumns[0]
179 +                     .as_ref()
180 +                     .unwrap()
181 +                     .getCodewords()[codewordsRow]
182 +                     .as_ref()
183 +                     .unwrap()
184 +                     .getRowNumber() == self.detectionRXingResultColumns[self.barcodeColumnCount + 1]
185 +                         .as_ref()
186 +                         .unwrap()
187 +                         .getCodewords()[codewordsRow]
188 +                         .as_ref()
189 +                         .unwrap()
190 +                         .getRowNumber() {
191 +                 // if (LRIcodewords[codewordsRow] != null &&
192 +                 //     RRIcodewords[codewordsRow] != null &&
193 +                 //     LRIcodewords[codewordsRow].getRowNumber() == RRIcodewords[codewordsRow].getRowNumber()) {
194 +                 for barcodeColumn in 1..=self.barcodeColumnCount {
195 +                     // for (int barcodeColumn = 1; barcodeColumn <= barcodeColumnCount; barcodeColumn++) {
196 +                     if self.detectionRXingResultColumns[barcodeColumn].is_some()
197 +                     //let Some(dc_col) =
198 +                     //&mut self.detectionRXingResultColumns[barcodeColumn]
199 +                     {
200 +                         if self.detectionRXingResultColumns[barcodeColumn]
201 +                             .as_mut()
202 +                             .unwrap()
203 +                             .getCodewordsMut()[codewordsRow]
204 +                             .is_some()
205 +                         {
206 +                             //let Some(codeword) = &mut self.detectionRXingResultColumns[barcodeColumn].as_mut().unwrap().getCodewordsMut()[codewordsRow] {
207 +                             let new_row_number = self.detectionRXingResultColumns[0]
208 +                                 .as_ref()
209 +                                 .unwrap()
210 +                                 .getCodewords()[codewordsRow]
211 +                                 .as_ref()
212 +                                 .unwrap()
213 +                                 .getRowNumber();
214 +                             self.detectionRXingResultColumns[barcodeColumn]
215 +                                 .as_mut()
216 +                                 .unwrap()
217 +                                 .getCodewordsMut()[codewordsRow]
218 +                                 .as_mut()
219 +                                 .unwrap()
220 +                                 .setRowNumber(new_row_number);
221 +                             if !self.detectionRXingResultColumns[barcodeColumn]
222 +                                 .as_mut()
223 +                                 .unwrap()
224 +                                 .getCodewordsMut()[codewordsRow]
225 +                                 .as_ref()
226 +                                 .unwrap()
227 +                                 .hasValidRowNumber()
228 +                             {
229 +                                 // self.detectionRXingResultColumns[barcodeColumn].getCodewords()[codewordsRow] = None;
230 +                                 self.detectionRXingResultColumns[barcodeColumn]
231 +                                     .as_mut()
232 +                                     .unwrap()
233 +                                     .getCodewordsMut()[codewordsRow] = None;
234 +                             }
235 +                         } else {
236 +                             continue;
237 +                         }
238 +                     } else {
239 +                         continue;
240 +                     }
241 +                     // let codeword = self.detectionRXingResultColumns[barcodeColumn].getCodewords()[codewordsRow];
242 +                     // if (codeword == null) {
243 +                     //   continue;
244 +                     // }
245 +                 }
246 +             }
    |

warning: this `if` statement can be collapsed
   --> src/pdf417/decoder/pdf_417_scanning_decoder.rs:405:12
    |
405 |       } else if numberOfCodewords[0] != calculatedNumberOfCodewords {
    |  ____________^
406 | |         if (1..=pdf_417_common::MAX_CODEWORDS_IN_BARCODE).contains(&calculatedNumberOfCodewords)
407 | |         {
408 | |             // The calculated one is more reliable as it is derived from the row indicator columns
409 | |             barcodeMatrix01.setValue(calculatedNumberOfCodewords);
410 | |         }
411 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
help: collapse nested if block
    |
405 ~     } else if numberOfCodewords[0] != calculatedNumberOfCodewords && (1..=pdf_417_common::MAX_CODEWORDS_IN_BARCODE).contains(&calculatedNumberOfCodewords) {
406 +         // The calculated one is more reliable as it is derived from the row indicator columns
407 +         barcodeMatrix01.setValue(calculatedNumberOfCodewords);
408 +     }
    |

warning: this `else { if .. }` block can be collapsed
   --> src/pdf417/encoder/pdf_417_high_level_encoder.rs:439:28
    |
439 |                       } else {
    |  ____________________________^
440 | |                         if isAlphaUpper(ch) {
441 | |                             submode = SUBMODE_ALPHA;
442 | |                             tmp.push(28 as char); //al
...   |
456 | |                         }
457 | |                     }
    | |_____________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
help: collapse nested if block
    |
439 ~                     } else if isAlphaUpper(ch) {
440 +                         submode = SUBMODE_ALPHA;
441 +                         tmp.push(28 as char); //al
442 +                         continue;
443 +                     } else if isAlphaLower(ch) {
444 +                         submode = SUBMODE_LOWER;
445 +                         tmp.push(27 as char); //ll
446 +                         continue;
447 +                     } else {
448 +                         if startpos + idx + 1 < count && !input.isECI(startpos + idx + 1)? && isPunctuation(input.charAt((startpos + idx + 1) as usize)?) {
449 +                             submode = SUBMODE_PUNCTUATION;
450 +                             tmp.push(25 as char); //pl
451 +                             continue;
452 +                         }
453 +                         tmp.push(29 as char); //ps
454 +                         tmp.push(char::from_u32(PUNCTUATION[ch as usize] as u32).unwrap());
455 +                     }
    |

warning: use of deprecated struct `common::detector::monochrome_rectangle_detector::MonochromeRectangleDetector`
  --> src/common/detector/monochrome_rectangle_detector.rs:35:6
   |
35 | impl MonochromeRectangleDetector {
   |      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated unit variant `encode_hints::EncodeHintType::MIN_SIZE`
  --> src/datamatrix/data_matrix_writer.rs:91:63
   |
91 |             let requestedMinSize = hints.get(&EncodeHintType::MIN_SIZE);
   |                                                               ^^^^^^^^

warning: use of deprecated tuple variant `encode_hints::EncodeHintValue::MinSize`
  --> src/datamatrix/data_matrix_writer.rs:92:42
   |
92 |             if let Some(EncodeHintValue::MinSize(rq)) = requestedMinSize {
   |                                          ^^^^^^^

warning: use of deprecated unit variant `encode_hints::EncodeHintType::MAX_SIZE`
  --> src/datamatrix/data_matrix_writer.rs:96:63
   |
96 |             let requestedMaxSize = hints.get(&EncodeHintType::MAX_SIZE);
   |                                                               ^^^^^^^^

warning: use of deprecated tuple variant `encode_hints::EncodeHintValue::MinSize`
  --> src/datamatrix/data_matrix_writer.rs:97:42
   |
97 |             if let Some(EncodeHintValue::MinSize(rq)) = requestedMaxSize {
   |                                          ^^^^^^^

warning: use of deprecated associated function `chrono::NaiveDateTime::from_timestamp`: use `from_timestamp_opt()` instead
   --> src/client/result/CalendarParsedResult.rs:259:24
    |
259 |         NaiveDateTime::from_timestamp(date, 0)
    |                        ^^^^^^^^^^^^^^

warning: use of deprecated field `common::detector::monochrome_rectangle_detector::MonochromeRectangleDetector::image`
  --> src/common/detector/monochrome_rectangle_detector.rs:38:13
   |
38 |             image: image.clone(),
   |             ^^^^^^^^^^^^^^^^^^^^

warning: use of deprecated field `common::detector::monochrome_rectangle_detector::MonochromeRectangleDetector::image`
  --> src/common/detector/monochrome_rectangle_detector.rs:53:22
   |
53 |         let height = self.image.getHeight() as i32;
   |                      ^^^^^^^^^^

warning: use of deprecated field `common::detector::monochrome_rectangle_detector::MonochromeRectangleDetector::image`
  --> src/common/detector/monochrome_rectangle_detector.rs:54:21
   |
54 |         let width = self.image.getWidth() as i32;
   |                     ^^^^^^^^^^

warning: use of deprecated field `common::detector::monochrome_rectangle_detector::MonochromeRectangleDetector::image`
   --> src/common/detector/monochrome_rectangle_detector.rs:241:17
    |
241 |                 self.image.get(start as u32, fixedDimension as u32)
    |                 ^^^^^^^^^^

warning: use of deprecated field `common::detector::monochrome_rectangle_detector::MonochromeRectangleDetector::image`
   --> src/common/detector/monochrome_rectangle_detector.rs:243:17
    |
243 |                 self.image.get(fixedDimension as u32, start as u32)
    |                 ^^^^^^^^^^

warning: use of deprecated field `common::detector::monochrome_rectangle_detector::MonochromeRectangleDetector::image`
   --> src/common/detector/monochrome_rectangle_detector.rs:251:25
    |
251 |                         self.image.get(start as u32, fixedDimension as u32)
    |                         ^^^^^^^^^^

warning: use of deprecated field `common::detector::monochrome_rectangle_detector::MonochromeRectangleDetector::image`
   --> src/common/detector/monochrome_rectangle_detector.rs:253:25
    |
253 |                         self.image.get(fixedDimension as u32, start as u32)
    |                         ^^^^^^^^^^

warning: use of deprecated field `common::detector::monochrome_rectangle_detector::MonochromeRectangleDetector::image`
   --> src/common/detector/monochrome_rectangle_detector.rs:271:17
    |
271 |                 self.image.get(end as u32, fixedDimension as u32)
    |                 ^^^^^^^^^^

warning: use of deprecated field `common::detector::monochrome_rectangle_detector::MonochromeRectangleDetector::image`
   --> src/common/detector/monochrome_rectangle_detector.rs:273:17
    |
273 |                 self.image.get(fixedDimension as u32, end as u32)
    |                 ^^^^^^^^^^

warning: use of deprecated field `common::detector::monochrome_rectangle_detector::MonochromeRectangleDetector::image`
   --> src/common/detector/monochrome_rectangle_detector.rs:281:25
    |
281 |                         self.image.get(end as u32, fixedDimension as u32)
    |                         ^^^^^^^^^^

warning: use of deprecated field `common::detector::monochrome_rectangle_detector::MonochromeRectangleDetector::image`
   --> src/common/detector/monochrome_rectangle_detector.rs:283:25
    |
283 |                         self.image.get(fixedDimension as u32, end as u32)
    |                         ^^^^^^^^^^

warning: use of deprecated field `encode_hints::EncodeHintValue::MinSize::0`
  --> src/datamatrix/data_matrix_writer.rs:92:50
   |
92 |             if let Some(EncodeHintValue::MinSize(rq)) = requestedMinSize {
   |                                                  ^^

warning: use of deprecated field `encode_hints::EncodeHintValue::MinSize::0`
  --> src/datamatrix/data_matrix_writer.rs:97:50
   |
97 |             if let Some(EncodeHintValue::MinSize(rq)) = requestedMaxSize {
   |                                                  ^^

warning: use of deprecated associated function `pdf417::pdf_417_result_metadata::PDF417RXingResultMetadata::setOptionalData`
   --> src/pdf417/decoder/decoded_bit_stream_parser.rs:318:24
    |
318 |         resultMetadata.setOptionalData(
    |                        ^^^^^^^^^^^^^^^

warning: unused import: `AbstractExpandedDecoder`
  --> src/oned/rss/expanded/decoders/abstract_decoder_test_utils.rs:29:58
   |
29 |     decoders::{abstract_expanded_decoder::createDecoder, AbstractExpandedDecoder},
   |                                                          ^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 18 previous errors; 38 warnings emitted

For more information about this error, try `rustc --explain E0433`.
Original diagnostics will follow.
hschimke commented 1 year ago

with the current version (https://github.com/hschimke/rxing/releases/tag/v0.2.1) I can confirm that running with --broken-code will complete.

The broken compiler reports errors in only one file, they match what is attached below.

    Checking rxing v0.2.1 (/Users/henry/Sandbox/j2rust/rxing)
error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_one_d_reader.rs:86:36
   |
86 |                 readers.push(Box::<oned::itf_reader::ITFReader>::default());
   |                                    ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
   --> src/oned/multi_format_one_d_reader.rs:104:32
    |
104 |             readers.push(Box::<oned::itf_reader::ITFReader>::default());
    |                                ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_upc_ean_reader.rs:49:36
   |
49 |                 readers.push(Box::<oned::ean_13_reader::EAN13Reader>::default());
   |                                    ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_upc_ean_reader.rs:51:36
   |
51 |                 readers.push(Box::<oned::upc_a_reader::UPCAReader>::default());
   |                                    ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_upc_ean_reader.rs:54:36
   |
54 |                 readers.push(Box::<oned::ean_8_reader::EAN8Reader>::default());
   |                                    ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_upc_ean_reader.rs:57:36
   |
57 |                 readers.push(Box::<oned::upc_e_reader::UPCEReader>::default());
   |                                    ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_upc_ean_reader.rs:61:32
   |
61 |             readers.push(Box::<oned::ean_13_reader::EAN13Reader>::default());
   |                                ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_upc_ean_reader.rs:63:32
   |
63 |             readers.push(Box::<oned::ean_8_reader::EAN8Reader>::default());
   |                                ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/oned/multi_format_upc_ean_reader.rs:64:32
   |
64 |             readers.push(Box::<oned::upc_e_reader::UPCEReader>::default());
   |                                ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:58:43
   |
58 |             BarcodeFormat::EAN_8 => Box::<oned::ean_8_writer::EAN8Writer>::default(),
   |                                           ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:59:43
   |
59 |             BarcodeFormat::UPC_E => Box::<oned::upc_e_writer::UPCEWriter>::default(),
   |                                           ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:60:44
   |
60 |             BarcodeFormat::EAN_13 => Box::<oned::ean_13_writer::EAN13Writer>::default(),
   |                                            ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:61:43
   |
61 |             BarcodeFormat::UPC_A => Box::<oned::upc_a_writer::UPCAWriter>::default(),
   |                                           ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:63:45
   |
63 |             BarcodeFormat::CODE_39 => Box::<oned::code_39_writer::Code39Writer>::default(),
   |                                             ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:64:45
   |
64 |             BarcodeFormat::CODE_93 => Box::<oned::code_93_writer::Code93Writer>::default(),
   |                                             ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:65:46
   |
65 |             BarcodeFormat::CODE_128 => Box::<oned::code_128_writer::Code128Writer>::default(),
   |                                              ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:66:41
   |
66 |             BarcodeFormat::ITF => Box::<oned::itf_writer::ITFWriter>::default(),
   |                                         ^^^^ use of undeclared crate or module `oned`

error[E0433]: failed to resolve: use of undeclared crate or module `pdf417`
  --> src/multi_format_writer.rs:67:45
   |
67 |             BarcodeFormat::PDF_417 => Box::<pdf417::pdf_417_writer::PDF417Writer>::default(),
   |                                             ^^^^^^ use of undeclared crate or module `pdf417`

error[E0433]: failed to resolve: use of undeclared crate or module `oned`
  --> src/multi_format_writer.rs:68:45
   |
68 |             BarcodeFormat::CODABAR => Box::<oned::code_128_writer::Code128Writer>::default(),
   |                                             ^^^^ use of undeclared crate or module `oned`
Niki4tap commented 1 year ago

@rustbot label +I-suggestion-causes-error

Seems related to #10089