Skip to content

Commit

Permalink
Fix Step feature flag, make tidy lint more useful to find things li…
Browse files Browse the repository at this point in the history
…ke this
  • Loading branch information
clarfonthey committed May 9, 2021
1 parent 380bbe8 commit e6b12c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions library/core/src/iter/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down
14 changes: 12 additions & 2 deletions src/tools/tidy/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;

Expand Down Expand Up @@ -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(),
);
}
}
Expand Down

0 comments on commit e6b12c8

Please # to comment.