Skip to content

cargo clean -p Suggestion after ICE uses incorrect name #116725

Open
@AldaronLau

Description

@AldaronLau

Summary

When clippy gets and ICE in a package with a - in the name, it suggests fixing but with an _.

I'm not sure if this happens on the current stable release or not since I don't know how to reliably trigger an ICE, but am willing to test if I could.

Reproducer

I tried this code:

[package]                                                                                            
name = "package-name"

I expected to see this happen:

error: internal compiler error: encountered incremental compilation error with mir_built(70094b76db2b4923-9e5dabcfe18f14d7)
  |
  = help: This is a known issue with the compiler. Run `cargo clean -p package-name` or `cargo clean` to allow your project to compile
  = note: Please follow the instructions below to create a bug report with the provided information
  = note: See <https://github.com/rust-lang/rust/issues/84970> for more information

Instead, this happened:

error: internal compiler error: encountered incremental compilation error with mir_built(70094b76db2b4923-9e5dabcfe18f14d7)
  |
  = help: This is a known issue with the compiler. Run `cargo clean -p package_name` or `cargo clean` to allow your project to compile
  = note: Please follow the instructions below to create a bug report with the provided information
  = note: See <https://github.com/rust-lang/rust/issues/84970> for more information

And then, of course:

$ cargo clean -p package_name
error: package ID specification `package_name` did not match any packages

	Did you mean `package-name`?

Version

rustc 1.70.0 (90c541806 2023-05-31)
binary: rustc
commit-hash: 90c541806f23a127002de5b4038be731ba1458ca
commit-date: 2023-05-31
host: x86_64-unknown-linux-gnu
release: 1.70.0
LLVM version: 16.0.2

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.S-blockedStatus: Blocked on something else such as an RFC or other implementation work.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions