Stream: t-compiler/help

Topic: Feature-gated lint in #71862


LeSeulArtichaut (May 22 2020 at 10:03, on Zulip):

In #71862 I tried to feature-gate a lint by adding a check in LintLevelsBuilder::push. However, when running rustc with -Zdeduplicate-diagnostics=no, it actually emits 2 duplicate errors, and when running with -Zdeduplicate-diagnostics=no and -Zunstable-options, it emits 3 errors. Can someone help me out here?

LeSeulArtichaut (May 22 2020 at 21:16, on Zulip):

@nikomatsakis CI fails on #71862 because of this. Should I just slap a FIXME to unblock the PR?

nikomatsakis (May 22 2020 at 21:17, on Zulip):

I'm confused :)

nikomatsakis (May 22 2020 at 21:20, on Zulip):

what does -Zunstable-options even do?

nikomatsakis (May 22 2020 at 21:20, on Zulip):

oh, right, I remember

nikomatsakis (May 22 2020 at 21:21, on Zulip):

@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?

LeSeulArtichaut (May 22 2020 at 21:21, on Zulip):

No, I have no idea

LeSeulArtichaut (May 22 2020 at 21:22, on Zulip):

I'm going to re-read my code :D

LeSeulArtichaut (May 22 2020 at 21:24, on Zulip):

The check I added is similar to other checks in the same place

LeSeulArtichaut (May 22 2020 at 21:25, on Zulip):

Like the "unknown lint" check which doesn't get repeated

LeSeulArtichaut (May 22 2020 at 21:25, on Zulip):

Could it be because the code is in a separate function?

nikomatsakis (May 22 2020 at 21:46, on Zulip):

I kind of have no idea

nikomatsakis (May 22 2020 at 21:47, on Zulip):

do you see the difference when you run manually?

nikomatsakis (May 22 2020 at 21:47, on Zulip):

i.e., with rustc on the command line?

LeSeulArtichaut (May 23 2020 at 18:55, on Zulip):

Running:

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.

LeSeulArtichaut (May 23 2020 at 19:26, on Zulip):

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`
LeSeulArtichaut (May 23 2020 at 19:27, on Zulip):

@nikomatsakis This isn't expected behaviour, right? Should I open an issue for this?

LeSeulArtichaut (May 23 2020 at 20:03, on Zulip):

Hmm, this seems to be the case since #67122 where -Zdeduplicate-diagnostics=no is applied

LeSeulArtichaut (May 23 2020 at 20:04, on Zulip):

So I guess it is acceptable to have deduplicated errors in #71862?

Last update: Sep 28 2020 at 16:45UTC