tamer: diagnose::report: `int_log` feature: {=>i}log10

https://github.com/rust-lang/rust/pull/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:

  https://github.com/rust-lang/rust/issues/70887#issuecomment-1210602692
main
Mike Gerwitz 2022-08-12 16:16:06 -04:00
parent 2a36bc4210
commit 13641e1812
2 changed files with 5 additions and 1 deletions

View File

@ -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
}
}

View File

@ -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,