Skip to content

Clippy slice panic on --fix #8878

Closed
@Raytwo

Description

@Raytwo

Summary

Getting a panic message slice index starts at 1 but ends at 0 by running the following command:

cargo +nightly-2022-05-21 clippy --fix --no-default-features

Which results in this stack backtrace:

Backtrace (Click to Expand)
stack backtrace:
   0:     0x7ff6dd68b3bf - git_midx_writer_dump
   1:     0x7ff6dd6b112a - git_midx_writer_dump
   2:     0x7ff6dd6818e9 - git_midx_writer_dump
   3:     0x7ff6dd68e67b - git_midx_writer_dump
   4:     0x7ff6dd68e26e - git_midx_writer_dump
   5:     0x7ff6dd68ec71 - git_midx_writer_dump
   6:     0x7ff6dd68eb2d - git_midx_writer_dump
   7:     0x7ff6dd68bf77 - git_midx_writer_dump
   8:     0x7ff6dd68e809 - git_midx_writer_dump
   9:     0x7ff6dd7449e5 - git_midx_writer_dump
  10:     0x7ff6dd6b2f2b - git_midx_writer_dump
  11:     0x7ff6dd6a9659 - git_midx_writer_dump
  12:     0x7ff6dd6ae4f9 - git_midx_writer_dump
  13:     0x7ff6dd744b29 - git_midx_writer_dump
  14:     0x7ff6dd519b48 - git_midx_writer_dump
  15:     0x7ff6dd519e8d - git_midx_writer_dump
  16:     0x7ff6dd29efdf - git_filter_source_path
  17:     0x7ff6dd29f7a2 - git_filter_source_path
  18:     0x7ff6dcd957e9 - <unknown>
  19:     0x7ff6dd019435 - git_odb_object_id
  20:     0x7ff6dcd0c270 - <unknown>
  21:     0x7ff6dcd562d6 - <unknown>
  22:     0x7ff6dcd7d50c - <unknown>
  23:     0x7ff6dd678411 - git_midx_writer_dump
  24:     0x7ff6dcd0e877 - <unknown>
  25:     0x7ff6dd6b96d0 - git_midx_writer_dump
  26:     0x7fffbbd9244d - BaseThreadInitThunk
  27:     0x7fffbcd0df88 - RtlUserThreadStart
error: could not compile `arcropolis

Reproducer

Code and commit

Simply run the following command: cargo +nightly-2022-05-21 clippy --fix --no-default-features

Version

rustc 1.63.0-nightly (e6a4afc3a 2022-05-20)
binary: rustc
commit-hash: e6a4afc3af2d2a53f91fc8a77bdfe94bea375b29
commit-date: 2022-05-20
host: x86_64-pc-windows-msvc
release: 1.63.0-nightly
LLVM version: 14.0.4

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions