rust-lang / rust-lang/rust

[cosmetic] "may come from an old version of the … crate" suggestion may use "_" instead of "-"

Open
#139,545 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-diagnostics T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Code
not relevant.
Current output
warning: unexpected `cfg` condition name: `ruma_unstable_exhaustive_types`
  --> src/pub_banlist.rs:18:48
   |
18 | #[derive(Clone, Debug, Deserialize, Serialize, EventContent)]
   |                                                ^^^^^^^^^^^^
   |
   = help: expected names are: `docsrs`, `feature`, and `test` and 31 more
   = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate
   = help: try referring to `EventContent` crate for guidance on how handle this unexpected cfg
   = help: the derive macro `EventContent` may come from an old version of the **`ruma_macros`** crate, try updating your dependency with `cargo update -p ruma_macros`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default
   = note: this warning originates in the derive macro `EventContent` (in Nightly builds, run with -Z macro-backtrace for more info)
Desired output
Not sure whether it's feasible to expect "ruma-macros" instead of "ruma_macros", or it's converted internally and the original name isn't available for the help system.
Rationale and extra context

$ cargo update -p ruma_macros
error: package ID specification ruma_macros did not match any packages

help: a package with a similar name exists: ruma-macros

That's rather a cosmetic problem, as cargo suggests the proper name later. You may want to fix it or close this issue.

Other cases

Rust Version
rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: x86_64-unknown-linux-gnu
release: 1.86.0
LLVM version: 19.1.7
Anything else?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the warning shown with Rust 1.86.0 and compare the package name used in the diagnostic with Cargo's hyphenated package name. Start by tracing the compiler diagnostic or help-generation path responsible for the old-version suggestion; done means the suggestion uses the valid package name without regressing other dependency-update hints.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.