-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Removal of the lang feature gate tests whitelist #39059
Comments
This removes the safe_suggestion feature from feature_gate.rs. It was added in commit 164f010 and then removed again in commit c11fe55 . As the removal was in the same PR rust-lang#38099 as the addition, we don't move it to the "removed" section. Removes an element from the whitelist of non gate tested unstable lang features (issue rust-lang#39059).
This marks the pushpop_unsafe feature as removed inside the feature_gate. It was added in commit 1829fa5 and then removed again in commit d399098 . Seems that the second commit forgot to mark it as removed in feature_gate.rs. This enables us to remove another element from the whitelist of non gate tested unstable lang features (issue rust-lang#39059).
Mark safe_suggestion and pushpop_unsafe as removed in feature_gate.rs This removes two features from feature_gate.rs: `safe_suggestion` and `pushpop_unsafe`. Both had been removed in other places already, but were forgotten to be removed from feature_gate.rs. * `safe_suggestion` was added in commit 164f010 and then removed again in commit c11fe55 both in the same PR #38099. * `pushpop_unsafe` was added in commit 1829fa5 and removed again in commit d399098 Removes two elements from the whitelist of non gate tested unstable lang features (issue #39059).
Mark safe_suggestion and pushpop_unsafe as removed in feature_gate.rs This removes two features from feature_gate.rs: `safe_suggestion` and `pushpop_unsafe`. Both had been removed in other places already, but were forgotten to be removed from feature_gate.rs. * `safe_suggestion` was added in commit 164f010 and then removed again in commit c11fe55 both in the same PR #38099. * `pushpop_unsafe` was added in commit 1829fa5 and removed again in commit d399098 Removes two elements from the whitelist of non gate tested unstable lang features (issue #39059).
Nice idea. |
Hello folks, I'm just announcing that I'll try to do the |
Guess I will do the already has tests section today! |
@est31 for example, in
Where in the codebase is the build actually looking at these comments to detect if they should run or not? I'm used to annotations or functions declaring test groups in code (junit in java or jasmine in javascript). I am new to rust, is this a rust standard? |
@est31 When I run the tidy check, everything run ok, but the following command produces an error:
|
No, this notation is actually internal to the rust compiler codebase. Its not used in normal rust codebases. The standard way of doing tests in rust is to use an attribute. The compiler however has special needs, and part of the information usually passed via attributes (like whether it should panic or not) is encoded in the path (run-pass vs compile-fail etc.) the test is inside. Also, the checking is done in an executable separate from the compiler, which doesn't have access to the parser. Doing it via comments makes this check simpler to implement. The specific check is implemented here: https://github.com/rust-lang/rust/blob/master/src/tools/tidy/src/features.rs#L118-L164 About your errors: don't know what the problem is. Did you do a clean clone? Running |
@est31 I think it's something to do with the |
@cseale I'm not sure, maybe there is a script at |
Removal of the lang feature gate tests whitelist rust-lang#39059 r? @est31
Okay, found two further gate tests, so I moved "quote" and "macro_reexport" to the section of features that need only marking. Note that their marking won't be effective until #39247 gets merged. |
@danobi no, the |
Add compile fail test for unboxed_closures feature Hello, this is my first contribution to rust. Issue rust-lang#39059.
Add compile fail test for unboxed_closures feature Hello, this is my first contribution to rust. Issue rust-lang#39059.
Add compile fail test for unboxed_closures feature Hello, this is my first contribution to rust. Issue rust-lang#39059.
Add compile fail test for unboxed_closures feature Hello, this is my first contribution to rust. Issue rust-lang#39059.
…arget-has-atomic, r=alexcrichton Add compile test for cfg_target_has_atomic Issue rust-lang#39059. I am concerned about whether the test is excessive.
…arget-has-atomic, r=alexcrichton Add compile test for cfg_target_has_atomic Issue rust-lang#39059. I am concerned about whether the test is excessive.
…tx, r=petrochenkov Add compile fail test for abi_ptx Issue rust-lang#39059.
Is |
@topecongiro I think its partly stable, partly not. See this comment: #15701 (comment) Relevant for us is the status in |
@est31 There are three files that have Maybe a test file like the following is required to test #![feature(stmt_expr_attributes)]
fn main() {
let x = #[allow(dead_code)] 8;
} |
Add compile fail test for SIMD This completes the missing SIMD test task for issue #39059.
Does it fail when you remove the |
It does fail after removing the |
…=petrochenkov Add compile fail test for stmt_expr_attributes Adds a missing feature gate test for `stmt_expr_attributes`. Issue #39059.
I took the last two, |
Test copied from src/test/codegen/extern-functions.rs. Refs: rust-lang#39059
Test copied from src/test/run-pass/thread-local-extern-static.rs. Refs: rust-lang#39059
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):
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_suggestion
pushpop_unsafe
Needs 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.md
andCOMPILER_TESTS.md
src/test/run-pass
suite for tests of that featurefeature-gate-FEAT-NAME.rs
) and remove the#![feature(...)]
line./x.py test src/tools/tidy
and./x.py test src/test/compile-fail --test-args feature-gate-FEAT-NAME
)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:
CONTRIBUTING.md
andCOMPILER_TESTS.md
(second one is not strictly required, but it never harms :D)// gate-test-FEATURE_NAME
to 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!
The text was updated successfully, but these errors were encountered: