about summary refs log tree commit diff
diff options
context:
space:
mode:
authorltdk <usr@ltdk.xyz>2021-05-09 17:13:22 -0400
committerltdk <usr@ltdk.xyz>2021-05-09 17:15:54 -0400
commite6b12c8e4f7817d6317ab7b981e440f260a8137e (patch)
tree6fd439731a645607bad0afdcebd4c02de365f4d6
parent380bbe8d478e2252b60b79b82f285b9464227f5c (diff)
downloadrust-e6b12c8e4f7817d6317ab7b981e440f260a8137e.tar.gz
rust-e6b12c8e4f7817d6317ab7b981e440f260a8137e.zip
Fix `Step` feature flag, make tidy lint more useful to find things like this
-rw-r--r--library/core/src/iter/range.rs4
-rw-r--r--src/tools/tidy/src/features.rs14
2 files changed, 14 insertions, 4 deletions
diff --git a/library/core/src/iter/range.rs b/library/core/src/iter/range.rs
index 4b293c596e7..5e39e71252f 100644
--- a/library/core/src/iter/range.rs
+++ b/library/core/src/iter/range.rs
@@ -106,7 +106,7 @@ pub unsafe trait Step: Clone + PartialOrd + Sized {
     /// For any `a` and `n`, where no overflow occurs:
     ///
     /// * `Step::forward_unchecked(a, n)` is equivalent to `Step::forward(a, n)`
-    #[unstable(feature = "unchecked_math", reason = "niche optimization path", issue = "none")]
+    #[unstable(feature = "step_trait_ext", reason = "recently added", issue = "42168")]
     unsafe fn forward_unchecked(start: Self, count: usize) -> Self {
         Step::forward(start, count)
     }
@@ -178,7 +178,7 @@ pub unsafe trait Step: Clone + PartialOrd + Sized {
     /// For any `a` and `n`, where no overflow occurs:
     ///
     /// * `Step::backward_unchecked(a, n)` is equivalent to `Step::backward(a, n)`
-    #[unstable(feature = "unchecked_math", reason = "niche optimization path", issue = "none")]
+    #[unstable(feature = "step_trait_ext", reason = "recently added", issue = "42168")]
     unsafe fn backward_unchecked(start: Self, count: usize) -> Self {
         Step::backward(start, count)
     }
diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs
index b14b5aeb572..a7e700b935e 100644
--- a/src/tools/tidy/src/features.rs
+++ b/src/tools/tidy/src/features.rs
@@ -51,6 +51,14 @@ pub struct Feature {
     pub has_gate_test: bool,
     pub tracking_issue: Option<NonZeroU32>,
 }
+impl Feature {
+    fn tracking_issue_display(&self) -> impl fmt::Display {
+        match self.tracking_issue {
+            None => "none".to_string(),
+            Some(x) => x.to_string(),
+        }
+    }
+}
 
 pub type Features = HashMap<String, Feature>;
 
@@ -361,10 +369,12 @@ fn get_and_check_lib_features(
                     if f.tracking_issue != s.tracking_issue && f.level != Status::Stable {
                         tidy_error!(
                             bad,
-                            "{}:{}: mismatches the `issue` in {}",
+                            "{}:{}: `issue` \"{}\" mismatches the {} `issue` of \"{}\"",
                             file.display(),
                             line,
-                            display
+                            f.tracking_issue_display(),
+                            display,
+                            s.tracking_issue_display(),
                         );
                     }
                 }