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

Error diagnostics for lints are duplicated with -Z unstable-options #82638

Open
jyn514 opened this issue Feb 28, 2021 · 0 comments
Open

Error diagnostics for lints are duplicated with -Z unstable-options #82638

jyn514 opened this issue Feb 28, 2021 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jyn514
Copy link
Member

jyn514 commented Feb 28, 2021

I tried this code: https://github.com/rust-lang/rust/blob/573a697a6197abaad5a2d7208dbf1bbc77f4dcf3/src/test/ui/deduplicate-diagnostics.rs

I expected to see this happen: The same error output with and without unstable-options.

Instead, this happened: One of the errors is duplicated three times instead of only twice:

diff --git a/src/test/ui/deduplicate-diagnostics.duplicate.stderr b/src/test/ui/deduplicate-diagnostics.duplicate.stderr
index 3b100b59995..cd4700c7a7c 100644
--- a/src/test/ui/deduplicate-diagnostics.duplicate.stderr
+++ b/src/test/ui/deduplicate-diagnostics.duplicate.stderr
@@ -22,12 +22,6 @@ error[E0452]: malformed lint attribute input
 LL | #[deny("literal")]
    |        ^^^^^^^^^ bad attribute argument
 
-error[E0452]: malformed lint attribute input
-  --> $DIR/deduplicate-diagnostics.rs:8:8
-   |
-LL | #[deny("literal")]
-   |        ^^^^^^^^^ bad attribute argument
-
-error: aborting due to 5 previous errors
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0452`.

There are many other affected tests, see 3205303 for details.

cc @petrochenkov, do you know what's going wrong here?

@jyn514 jyn514 added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Feb 28, 2021
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 10, 2021
Don't pass -Z unstable-options by default for UI tests

Unconditionally passing -Z unstable-options makes it impossible to test whether an option requires unstable-options or not.

This uncovered quite a lot of bugs, I'll open issues for each. These don't strictly need to be fixed before this is merged, it just makes the diff much larger because of the changes to diagnostics.

- rust-lang#82636
- rust-lang#82637
- rust-lang#82638
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

1 participant