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

statically guarantee that current error codes are documented #108482

Merged
merged 2 commits into from
Feb 26, 2023

Conversation

Ezrashaw
Copy link
Contributor

Closes #61137 (that's right!)

Pretty simple refactor (often just a change from Result<Option<&str>> to Result<&str>)

r? @GuillaumeGomez (could you specially look at 5304415? I believe you wrote that in the first place, just want to make sure you're happy with the change)

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 26, 2023
@rustbot
Copy link
Collaborator

rustbot commented Feb 26, 2023

These commits modify the Cargo.lock file. Random changes to Cargo.lock can be introduced when switching branches and rebasing PRs.
This was probably unintentional and should be reverted before this PR is merged.

If this was intentional then you can ignore this comment.

Some changes occurred in diagnostic error codes

cc @GuillaumeGomez

@GuillaumeGomez
Copy link
Member

I'm fine with it. Thanks a lot for working on this!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 26, 2023

📌 Commit 5304415 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 26, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 26, 2023
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#107941 (Treat `str` as containing `[u8]` for auto trait purposes)
 - rust-lang#108299 (Require `literal`s for some `(u)int_impl!` parameters)
 - rust-lang#108337 (hir-analysis: make a helpful note)
 - rust-lang#108379 (Add `ErrorGuaranteed` to `hir::{Expr,Ty}Kind::Err` variants)
 - rust-lang#108418 (Replace parse_[sth]_expr with parse_expr_[sth] function names)
 - rust-lang#108424 (rustc_infer: Consolidate obligation elaboration de-duplication)
 - rust-lang#108475 (Fix `VecDeque::shrink_to` and add tests.)
 - rust-lang#108482 (statically guarantee that current error codes are documented)
 - rust-lang#108484 (Remove `from` lang item)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit edd27cf into rust-lang:master Feb 26, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 26, 2023
@Ezrashaw Ezrashaw deleted the force-error-docs branch February 28, 2023 07:25
;
}

// Undocumented removed error codes. Note that many removed error codes are documented.
Copy link
Member

@RalfJung RalfJung Aug 27, 2023

Choose a reason for hiding this comment

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

How can a removed error code be documented? I'm trying to remove an error code in #115277 and tidy complains that the error code exists but isn't used. If I remove the error code then tidy complains that I have to also remove the documentation. So documented removed codes seem to be impossible, in contrast to what the comment says?

This file lacks guidance for what to do when an error code is being removed. Someone should please decide that and document it.

Copy link
Member

Choose a reason for hiding this comment

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

#115278 should help

Copy link
Member

Choose a reason for hiding this comment

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

This list is used for --explain, so even if not emitted by rustc, it's normal to have them. So you never remove an entry unless it doesn't have an error code explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add missing long error code explanations
5 participants