Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

refactor: Use Config::emit_diagnostic to emit warnings #12531

Closed
wants to merge 1 commit into from

Conversation

Muscraft
Copy link
Member

#12235 is tracking user control over warnings. Part of the effort means moving warnings from being emitted by Shell to Config. This is for a few reasons:

  1. Shell should not know what a user wants to do with a given warning other than emit anything that is passed to it
  2. Config should (eventually) know what a user wants to do for each warning cargo is attempting to display, be that forbid, deny, warn, or allow.

In both scenarios, it makes sense to move things to Config, which is what this PR does. It adds a new function Config::emit_diagnostic, which is a copy of Shell::warn, and moves all calls from Shell::warn to this new function.

@rustbot
Copy link
Collaborator

rustbot commented Aug 19, 2023

r? @weihanglo

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-build-execution Area: anything dealing with executing the compiler A-cargo-targets Area: selection and definition of targets (lib, bins, examples, tests, benches) A-cfg-expr Area: Platform cfg expressions A-cli Area: Command-line interface, option parsing, etc. A-configuration Area: cargo config files and env vars A-console-output Area: Terminal output, colors, progress bar, etc. A-diagnostics Area: Error and warning messages generated by Cargo itself. A-future-incompat Area: future incompatible reporting A-infrastructure Area: infrastructure around the cargo repo, ci, releases, etc. A-interacts-with-crates.io Area: interaction with registries A-manifest Area: Cargo.toml issues A-networking Area: networking issues, curl, etc. A-profiles Area: profiles A-registries Area: registries A-registry-authentication Area: registry authentication and authorization (authn authz) A-workspaces Area: workspaces Command-add Command-clean Command-doc Command-generate-lockfile Command-install Command-metadata Command-new Command-package Command-publish Command-read-manifest Command-remove labels Aug 19, 2023
@weihanglo weihanglo added A-cargo-api Area: cargo-the-library API and internal code issues and removed Command-clean Command-publish Command-new Command-install Command-metadata A-interacts-with-crates.io Area: interaction with registries A-build-execution Area: anything dealing with executing the compiler Command-generate-lockfile Command-package Command-read-manifest A-workspaces Area: workspaces A-profiles Area: profiles A-registries Area: registries A-console-output Area: Terminal output, colors, progress bar, etc. A-manifest Area: Cargo.toml issues A-networking Area: networking issues, curl, etc. A-cli Area: Command-line interface, option parsing, etc. A-cfg-expr Area: Platform cfg expressions A-cargo-targets Area: selection and definition of targets (lib, bins, examples, tests, benches) Command-tree A-future-incompat Area: future incompatible reporting Command-add Command-remove A-registry-authentication Area: registry authentication and authorization (authn authz) A-infrastructure Area: infrastructure around the cargo repo, ci, releases, etc. labels Aug 26, 2023
@bors
Copy link
Contributor

bors commented Aug 27, 2023

☔ The latest upstream changes (presumably #12573) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cargo-api Area: cargo-the-library API and internal code issues A-diagnostics Area: Error and warning messages generated by Cargo itself. 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.

5 participants