Skip to content

Commit

Permalink
tamer: diagnose::report: int_log feature: {=>i}log10
Browse files Browse the repository at this point in the history
rust-lang/rust#100332

The above MR replaces `log10` and friends with `ilog10`; this is the first
time an unstable feature bit us in a substantially backwards-incompatible
way that's a pain to deal with.

Fortunately, I'm just not going to deal with it: this is used with the
diagnostic system, which isn't yet used by our projects (outside of me
testing), and so those builds shouldn't fail before people upgrade.

This is now pending stabalization with the new name, so hopefully we're good
now:

  rust-lang/rust#70887 (comment)
  • Loading branch information
Mike Gerwitz committed Aug 12, 2022
1 parent 2a36bc4 commit 13641e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tamer/src/diagnose/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ impl<'s, 'd> Section<'d> {
/// gutter width is 2
/// ```
fn gutter_text_width(&self) -> usize {
self.line_max.log10().add(1).max(2) as usize
self.line_max.ilog10().add(1).max(2) as usize
}
}

Expand Down
4 changes: 4 additions & 0 deletions tamer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
// Convenience features that are easily replaced if not stabalized.
#![feature(nonzero_min_max)]
#![feature(nonzero_ops)]
// Note: this is the first time TAMER was hit by a change in an unstable
// feature,
// when `log10` et al. were renamed to `ilog10` et al:
// <https://github.com/rust-lang/rust/pull/100332>
#![feature(int_log)]
// Used for const params like `&'static str` in `crate::fmt`.
// If this is not stabalized,
Expand Down

0 comments on commit 13641e1

Please sign in to comment.