Repository navigation
Removal of the lang feature gate tests whitelist #39059
Description
Activity
- addedE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.
on Jan 17, 2017 Nice idea.
- addedE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
on Jan 18, 2017 Hello folks, I'm just announcing that I'll try to do the
Need a testsection todayGuess I will do the already has tests section today!
54 remaining items
Is
stmt_expr_attributesstill unstable?src/rust/run-pass/cfg_stmt_expr.rscompiles without an error after removing#![feature(stmt_expr_attributes)].@topecongiro I think its partly stable, partly not. See this comment: #15701 (comment)
Relevant for us is the status in
src/libsyntax/feature_gate.rsand that says its still unstable. About that test file, I think the#![feature(...)]should be removed from it (and all other test files that still compile with#![feature(...)]included). There are other files that havestmt_expr_attributes, maybe one of them will fail to compile?@est31 There are three files that have
stmt_expr_attribuesundersrc/test/run-pass, but all of them compile successfully without#![feature(...)].Maybe a test file like the following is required to test
stmt_expr_attributeson expression?#![feature(stmt_expr_attributes)] fn main() { let x = #[allow(dead_code)] 8; }
- added a commit that references this issue
on Mar 3, 2017 Maybe a test file like the following is required to test stmt_expr_attributes on expression?
Does it fail when you remove the
#![feature(...)]? Then it can be used as gate test. If it doesn't fail then its probably a bug of the code that checks the attributes.It does fail after removing the
#![feature(...)]. I will create a PR for this.- added a commit that references this issue
on Mar 5, 2017 I took the last two,
unwind_attributesandcfg_target_thread_local, and removed the whitelist. I've never contributed to rust before but I think this is right: #40279
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.rsor include a// gate-test-NAME-OF-THE-FEATcomment. 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):
more_struct_aliases→ marked by PR [Gate Tests] - marking feature tests #39243custom_attribute→ marked by PR [Gate Tests] - marking feature tests #39243default_type_parameter_fallback→ marked by PR [Gate Tests] - marking feature tests #39243use_extern_macros→ marked by PR [Gate Tests] - marking feature tests #39243quote→ marked by PR [Gate Tests] - marking feature tests #39250macro_reexport→ marked by PR [Gate Tests] - marking feature tests #39250inclusive_range_syntax→ marked by PR Added test for inclusive_range_syntax in compile-fail test suite #40031Used nowhere in the codebase. Remove?
got all removed by PR #39071
safe_suggestionpushpop_unsafeNeeds a test (or I just haven't found a suiting test to mark, even on second look):
cfg_target_has_atomic→ got a test by Add compile test for cfg_target_has_atomic #40150simd→ got a test by Add compile fail test for SIMD #40101abi_ptx→ got a test by Add compile fail test for abi_ptx #40168const_indexing→ got a test by PR Adding compile fail test for const_indexing feature #39700stmt_expr_attributes→ got a test by PR Add compile fail test for stmt_expr_attributes #40252unwind_attributes→ got a test by PR Add compile-fail tests for remaining items in whitelist and remove it #40279static_recursion→ got a test by PR static recursion test added to compile-fail test suite #39834cfg_target_thread_local→ got a test by PR Add compile-fail tests for remaining items in whitelist and remove it #40279unboxed_closures→ got a test by PR Add compile fail test for unboxed_closures feature #40047staged_api→ got a test by PR Adding compile fail test for staged_api feature #39772Don't know what to do with this one. Any ideas?
reflect→ removed by PR Remove Reflect #39075The "Needs a test" section is a good place for beginners to help out!
You basically need to:
CONTRIBUTING.mdandCOMPILER_TESTS.mdsrc/test/run-passsuite for tests of that featurefeature-gate-FEAT-NAME.rs) and remove the#![feature(...)]line./x.py test src/tools/tidyand./x.py test src/test/compile-fail --test-args feature-gate-FEAT-NAME)It would also be very good if you searched the
compile-failtestsuite 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:
CONTRIBUTING.mdandCOMPILER_TESTS.md(second one is not strictly required, but it never harms :D)// gate-test-FEATURE_NAMEto the files that were mentioned above./x.py test src/tools/tidy, since you only added comments)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!