From a371581adf7be9ef534cb583790f4f834e630466 Mon Sep 17 00:00:00 2001 From: jhilton Date: Sat, 6 Apr 2024 15:33:44 -0400 Subject: [PATCH] Fix tidy issues, allow no tracking issue for Cilk --- src/tools/tidy/src/features.rs | 5 ++++- .../ui/cilk/error_when_value_returned_from_spawned_block.rs | 4 ++-- tests/ui/cilk/fib_block_recurse_type_ascription.rs | 2 +- tests/ui/feature-gates/feature-gate-cilk.rs | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs index d673ce7a736d9..ca2dd31f1e17e 100644 --- a/src/tools/tidy/src/features.rs +++ b/src/tools/tidy/src/features.rs @@ -412,7 +412,10 @@ fn collect_lang_features_in(features: &mut Features, base: &Path, file: &str, ba let issue_str = parts.next().unwrap().trim(); let tracking_issue = if issue_str.starts_with("None") { - if level == Status::Unstable && !next_feature_omits_tracking_issue { + // NOTE(jhilton): we allow Cilk to not have a tracking issue since although it's an + // unstable feature, progress on it isn't in the main Rust repo so there isn't a + // reasonable tracking issue to point to. + if level == Status::Unstable && !next_feature_omits_tracking_issue && name != "cilk" { tidy_error!( bad, "{}:{}: no tracking issue for feature {}", diff --git a/tests/ui/cilk/error_when_value_returned_from_spawned_block.rs b/tests/ui/cilk/error_when_value_returned_from_spawned_block.rs index 1be47ccf5ddef..b0a5aba78a8f0 100644 --- a/tests/ui/cilk/error_when_value_returned_from_spawned_block.rs +++ b/tests/ui/cilk/error_when_value_returned_from_spawned_block.rs @@ -3,9 +3,9 @@ // a sync runs. fn main() { - let x = { + let x = { let y = cilk_spawn { 1 }; y //~^ ERROR: used binding `y` is possibly-uninitialized [E0381] }; -} \ No newline at end of file +} diff --git a/tests/ui/cilk/fib_block_recurse_type_ascription.rs b/tests/ui/cilk/fib_block_recurse_type_ascription.rs index 3f9340f9c4c55..67d99dcb22938 100644 --- a/tests/ui/cilk/fib_block_recurse_type_ascription.rs +++ b/tests/ui/cilk/fib_block_recurse_type_ascription.rs @@ -12,4 +12,4 @@ fn fib(n: usize) -> usize { x + y } -fn main() {} \ No newline at end of file +fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-cilk.rs b/tests/ui/feature-gates/feature-gate-cilk.rs index 373e23749b9c6..fe225e8a2ae23 100644 --- a/tests/ui/feature-gates/feature-gate-cilk.rs +++ b/tests/ui/feature-gates/feature-gate-cilk.rs @@ -1,4 +1,4 @@ fn main() { cilk_spawn { 5 }; //~ ERROR cilk keywords are experimental [E0658] cilk_sync; //~ ERROR cilk keywords are experimental [E0658] -} \ No newline at end of file +}