Skip to content

Commit e6b12c8

Browse files
committed
Fix Step feature flag, make tidy lint more useful to find things like this
1 parent 380bbe8 commit e6b12c8

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

library/core/src/iter/range.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pub unsafe trait Step: Clone + PartialOrd + Sized {
106106
/// For any `a` and `n`, where no overflow occurs:
107107
///
108108
/// * `Step::forward_unchecked(a, n)` is equivalent to `Step::forward(a, n)`
109-
#[unstable(feature = "unchecked_math", reason = "niche optimization path", issue = "none")]
109+
#[unstable(feature = "step_trait_ext", reason = "recently added", issue = "42168")]
110110
unsafe fn forward_unchecked(start: Self, count: usize) -> Self {
111111
Step::forward(start, count)
112112
}
@@ -178,7 +178,7 @@ pub unsafe trait Step: Clone + PartialOrd + Sized {
178178
/// For any `a` and `n`, where no overflow occurs:
179179
///
180180
/// * `Step::backward_unchecked(a, n)` is equivalent to `Step::backward(a, n)`
181-
#[unstable(feature = "unchecked_math", reason = "niche optimization path", issue = "none")]
181+
#[unstable(feature = "step_trait_ext", reason = "recently added", issue = "42168")]
182182
unsafe fn backward_unchecked(start: Self, count: usize) -> Self {
183183
Step::backward(start, count)
184184
}

src/tools/tidy/src/features.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ pub struct Feature {
5151
pub has_gate_test: bool,
5252
pub tracking_issue: Option<NonZeroU32>,
5353
}
54+
impl Feature {
55+
fn tracking_issue_display(&self) -> impl fmt::Display {
56+
match self.tracking_issue {
57+
None => "none".to_string(),
58+
Some(x) => x.to_string(),
59+
}
60+
}
61+
}
5462

5563
pub type Features = HashMap<String, Feature>;
5664

@@ -361,10 +369,12 @@ fn get_and_check_lib_features(
361369
if f.tracking_issue != s.tracking_issue && f.level != Status::Stable {
362370
tidy_error!(
363371
bad,
364-
"{}:{}: mismatches the `issue` in {}",
372+
"{}:{}: `issue` \"{}\" mismatches the {} `issue` of \"{}\"",
365373
file.display(),
366374
line,
367-
display
375+
f.tracking_issue_display(),
376+
display,
377+
s.tracking_issue_display(),
368378
);
369379
}
370380
}

0 commit comments

Comments
 (0)