Skip to content

Fix some issues with future-incompat report generation #15345

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 7 commits into from
Mar 22, 2025

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Mar 21, 2025

This fixes various issues with the future-incompat report. In particular, it addresses the off-by-one for the --id flag when the report is already cached, and it doesn't recommend updating dependencies when the error comes from a local crate. See each commit for more details.

Fixes #15337

ehuss added 7 commits March 21, 2025 16:04
This updates some tests to include the full output for both a local
crate and a dependency.
This fixes a problem introduced by
rust-lang#11648 where the future-incompat
report will tell you to run with an `--id` flag with the wrong value
if the report is already cached.

The solution is to add a method to determine which ID to use for the
suggestions *before* attempting to save the report.
This removes the suggestion to update dependencies when the future
incompat error comes from the local crate. It doesn't make sense to
suggest that.
The udpate_message already has a newline when it is there. When it is an
empty string, it ends up adding an unnecessary blank line.
@rustbot
Copy link
Collaborator

rustbot commented Mar 21, 2025

r? @weihanglo

rustbot has assigned @weihanglo.
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

@rustbot rustbot added A-build-execution Area: anything dealing with executing the compiler A-future-incompat Area: future incompatible reporting S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 21, 2025
Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

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

Thanks for the fix and cleanup!

@weihanglo weihanglo added this pull request to the merge queue Mar 22, 2025
Merged via the queue into rust-lang:master with commit 7d11b58 Mar 22, 2025
21 checks passed
@mcclure
Copy link

mcclure commented Mar 22, 2025

Cool

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 27, 2025
Update cargo

10 commits in 307cbfda3119f06600e43cd38283f4a746fe1f8b..a6c604d1b8a2f2a8ff1f3ba6092f9fda42f4b7e9
2025-03-20 20:00:39 +0000 to 2025-03-26 18:11:00 +0000
- fix(package): update tracking issue for `--message-format` (rust-lang/cargo#15354)
- docs(contrib): Expand the description of team meetings (rust-lang/cargo#15349)
- feat(package): add unstable `--message-format` flag  (rust-lang/cargo#15311)
- feat(complete): Added completion for `--profile` (rust-lang/cargo#15308)
- Uplift windows Cygwin DLL import libraries (rust-lang/cargo#15193)
- do not pass cdylib link args to test (rust-lang/cargo#15317)
- fix: revert the behavior checking lockfile's VCS status (rust-lang/cargo#15341)
- Temporarily ignore cargo_test_doctest_xcompile_ignores (rust-lang/cargo#15348)
- docs: fix typo in the "Shared cache" section (rust-lang/cargo#15346)
- Fix some issues with future-incompat report generation (rust-lang/cargo#15345)

r? ghost
@rustbot rustbot added this to the 1.87.0 milestone Mar 27, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-build-execution Area: anything dealing with executing the compiler A-future-incompat Area: future incompatible reporting S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Diagnostics] --future-incompat-report gave me incorrect information and incorrect instructions
4 participants