Skip to content

Fix unused dep annotation - #17625

Merged
Muscraft merged 2 commits into
rust-lang:masterfrom
Muscraft:fix-unused-dep-annotation
Oct 23, 2026
Merged

Muscraft merged 2 commits into
rust-lang:masterfrom
Muscraft:fix-unused-dep-annotation

Conversation

@Muscraft

@Muscraft Muscraft commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

What does this PR try to resolve?

#17609 showed that when an unused dependency was written as a table, Cargo would lint the ] after the dependency name. This was happening because Cargo tried to annotate the toml key and value of the unused dependency, and when the dep was written as a table, the span for the value would be the whole table, i.e. [dependencies.foo]. To fix this, I decided it was best if Cargo just annotated the key (name) of the dependency, since that is the part that really matters.


🤖 LLM involvement: An LLM was used to help find the original manifest so that I could test changes against it

Fixes #17609

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 23, 2026
@rustbot

rustbot commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Muscraft, @epage, @weihanglo
  • @Muscraft, @epage, @weihanglo expanded to Muscraft, epage, weihanglo
  • Random selection from epage, weihanglo

@weihanglo weihanglo left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Underlining package name is a reasonable fix to me.

View changes since this review

@weihanglo
weihanglo added this pull request to the merge queue Oct 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 23, 2026
@Muscraft
Muscraft added this pull request to the merge queue Oct 23, 2026
Merged via the queue into rust-lang:master with commit 1dd6c6c Oct 23, 2026
30 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 23, 2026
@Muscraft
Muscraft deleted the fix-unused-dep-annotation branch October 23, 2026 14:43
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Oct 24, 2026
Update cargo submodule

11 commits in 15be64aa0859b5c36f7a86d52f7aa0db44ba4d84..cad07cf8e597397fff5d0f6cb79c9f870c0b1dd2
2026-10-20 16:03:21 +0000 to 2026-10-23 22:04:58 +0000
- build-rs: rename `cargo_target_family` to `cargo_cfg_target_family` (rust-lang/cargo#17636)
- chore: replace `cfg(any())` with `cfg(false)` (rust-lang/cargo#17633)
- feat(timings): peak memory as a column in unit table (rust-lang/cargo#17631)
- Change `build_rs::input::cargo_cfg_target_env` to return `Option` (rust-lang/cargo#17632)
- Update gix to 0.90.0 and adapt Git error recovery (rust-lang/cargo#17578)
- Fix unused dep annotation (rust-lang/cargo#17625)
- fix!: stop uplifting rlibs on nightly  (rust-lang/cargo#17621)
- refactor(config): Pull out the ConfigStore into its own module (rust-lang/cargo#17614)
- test: simplify file content assertions (rust-lang/cargo#17617)
- perf(context): Don't initialize windows-specific code on all platforms (rust-lang/cargo#17615)
- refactor(context): Remove RLS-specific function (rust-lang/cargo#17616)
@rustbot rustbot added this to the 1.101.0 milestone Oct 24, 2026
mehmettoplu-rs pushed a commit to mehmettoplu-rs/miri that referenced this pull request Oct 24, 2026
Update cargo submodule

11 commits in 15be64aa0859b5c36f7a86d52f7aa0db44ba4d84..cad07cf8e597397fff5d0f6cb79c9f870c0b1dd2
2026-10-20 16:03:21 +0000 to 2026-10-23 22:04:58 +0000
- build-rs: rename `cargo_target_family` to `cargo_cfg_target_family` (rust-lang/cargo#17636)
- chore: replace `cfg(any())` with `cfg(false)` (rust-lang/cargo#17633)
- feat(timings): peak memory as a column in unit table (rust-lang/cargo#17631)
- Change `build_rs::input::cargo_cfg_target_env` to return `Option` (rust-lang/cargo#17632)
- Update gix to 0.90.0 and adapt Git error recovery (rust-lang/cargo#17578)
- Fix unused dep annotation (rust-lang/cargo#17625)
- fix!: stop uplifting rlibs on nightly  (rust-lang/cargo#17621)
- refactor(config): Pull out the ConfigStore into its own module (rust-lang/cargo#17614)
- test: simplify file content assertions (rust-lang/cargo#17617)
- perf(context): Don't initialize windows-specific code on all platforms (rust-lang/cargo#17615)
- refactor(context): Remove RLS-specific function (rust-lang/cargo#17616)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minor off-by-one error in the span underlnie of "unused dependency" warning

4 participants