Skip to content

Removal of the lang feature gate tests whitelist #39059

Closed
@est31

Description

@est31

PR #38914 has added a tidy check for gate tests in compile-fail for all unstable lang features, helping ensure that they are actually unstable. See also issue #22820.

To be recognized as gate test for a specific feature, tests either need to follow a naming scheme feature-gate-NAME-OF-THE-FEAT.rs or include a // gate-test-NAME-OF-THE-FEAT comment. For most of the currently present features, I could easily find matching tests in the test suite. Sadly, there is still a whitelist of currently 20 features for which it tolerates that it can't detect any gate tests.

The goal is to eliminate that whitelist, which this issue is tracking.

The features on the whitelist fall into the following categories:

Has already tests, they just need to be marked (found this out only on a second look):

Used nowhere in the codebase. Remove?

got all removed by PR #39071

  • safe_suggestion
  • pushpop_unsafe

Needs a test (or I just haven't found a suiting test to mark, even on second look):

Don't know what to do with this one. Any ideas?

The "Needs a test" section is a good place for beginners to help out!

You basically need to:

  1. if you haven't already, read CONTRIBUTING.md and COMPILER_TESTS.md
  2. search in the src/test/run-pass suite for tests of that feature
  3. copy one of those tests over to the compile-fail suite
  4. rename it appropriately (feature-gate-FEAT-NAME.rs) and remove the #![feature(...)] line
  5. remove the feature from the whitelist
  6. test locally (./x.py test src/tools/tidy and ./x.py test src/test/compile-fail --test-args feature-gate-FEAT-NAME)
  7. submit a PR!

It would also be very good if you searched the compile-fail testsuite for already existing gate tests and mark those instead. A good place to look is the PR that introduced that feature, they usually also add gate tests.

You can help out in the "Has already tests" section as well. Here, contributing is even easier!

You'll need to:

  1. read CONTRIBUTING.md and COMPILER_TESTS.md (second one is not strictly required, but it never harms :D)
  2. add a line with // gate-test-FEATURE_NAME to the files that were mentioned above
  3. remove the feature from the whitelist
  4. test locally (./x.py test src/tools/tidy, since you only added comments)
  5. submit a PR!

If you need help, ask in this thread. Also, its best to prevent duplicate work, so it would be nice if you could announce that you work on some of the items. Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions