In #71862 I tried to feature-gate a lint by adding a check in
LintLevelsBuilder::push. However, when running
-Zdeduplicate-diagnostics=no, it actually emits 2 duplicate errors, and when running with
-Zunstable-options, it emits 3 errors. Can someone help me out here?
@nikomatsakis CI fails on #71862 because of this. Should I just slap a FIXME to unblock the PR?
I'm confused :)
what does -Zunstable-options even do?
oh, right, I remember
@LeSeulArtichaut any idea why it's changed? I suppose it has to do with that code in the lint levels stuff runing more times somehow?
No, I have no idea
I'm going to re-read my code :D
The check I added is similar to other checks in the same place
Like the "unknown lint" check which doesn't get repeated
Could it be because the code is in a separate function?
I kind of have no idea
do you see the difference when you run manually?
i.e., with rustc on the command line?
rustc +stage1 -D unsafe_op_in_unsafe_fn -Zunstable-options -Zdeduplicate-diagnostics=no src/test/ui/feature-gates/feature-gate-unsafe_block_in_unsafe_fn.rs
Also gives me 3 errors.
Howeber I'm a bit surprised that
rustc +stage1 -Zdeduplicate-diagnostics=no -Zunstable-options -W azerty personal_tests/issue-53738.rs
Also gives me 3 errors:
error[E0602]: unknown lint: `azerty` | = note: requested on the command line with `-W azerty` error[E0602]: unknown lint: `azerty` | = note: requested on the command line with `-W azerty` error[E0602]: unknown lint: `azerty` | = note: requested on the command line with `-W azerty`
@nikomatsakis This isn't expected behaviour, right? Should I open an issue for this?
Hmm, this seems to be the case since #67122 where
-Zdeduplicate-diagnostics=no is applied
So I guess it is acceptable to have deduplicated errors in #71862?