Skip to content

Commit

Permalink
Update stable Rust and typos (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored Jan 18, 2025
1 parent 858da7d commit b0b868e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ env:
# version like 1.70. Note that we only specify MAJOR.MINOR and not PATCH so that bugfixes still
# come automatically. If the version specified here is no longer the latest stable version,
# then please feel free to submit a PR that adjusts it along with the potential clippy fixes.
RUST_STABLE_VER: "1.83" # In quotes because otherwise (e.g.) 1.70 would be interpreted as 1.7
RUST_STABLE_VER: "1.84" # In quotes because otherwise (e.g.) 1.70 would be interpreted as 1.7
# The purpose of checking with the minimum supported Rust toolchain is to detect its staleness.
# If the compilation fails, then the version specified here needs to be bumped up to reality.
# Be sure to also update the rust-version property in the workspace Cargo.toml file,
Expand Down Expand Up @@ -324,4 +324,4 @@ jobs:
- uses: actions/checkout@v4

- name: check typos
uses: crate-ci/typos@v1.28.4
uses: crate-ci/typos@v1.29.4
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ version = "0.2.2"
edition = "2021"
# Keep in sync with RUST_MIN_VER in .github/workflows/ci.yml, with the relevant README.md files
# and with the MSRV in the `Unreleased` section of CHANGELOG.md.
# When updating to 1.83 or later, update `color/src/flags.rs` and remove this note.
# When updating to 1.84 or later, update `color/src/floatfuncs.rs` and remove this note.
rust-version = "1.82"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/linebender/color"
Expand Down
10 changes: 10 additions & 0 deletions color/src/floatfuncs.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
// Copyright 2024 the Color Authors
// SPDX-License-Identifier: Apache-2.0 OR MIT

// In Rust 1.84 (https://github.com/rust-lang/rust/pull/131304), `abs` and
// `copysign` were added to `core`, so we no longer need these forwarded to
// libm.
#![cfg_attr(
not(feature = "std"),
allow(dead_code, reason = "abs and copysign were added to core in 1.84")
)]

//! Shims for math functions that ordinarily come from std.
/// Defines a trait that chooses between libstd or libm implementations of float methods.
Expand Down Expand Up @@ -35,10 +43,12 @@ macro_rules! define_float_funcs {
}

define_float_funcs! {
// This is not needed once the MSRV is 1.84 or later.
fn abs(self) -> Self => fabsf;
fn atan2(self, other: Self) -> Self => atan2f;
fn cbrt(self) -> Self => cbrtf;
fn ceil(self) -> Self => ceilf;
// This is not needed once the MSRV is 1.84 or later.
fn copysign(self, sign: Self) -> Self => copysignf;
fn floor(self) -> Self => floorf;
fn hypot(self, other: Self) -> Self => hypotf;
Expand Down

0 comments on commit b0b868e

Please sign in to comment.