Skip to content

Rollup of 6 pull requests #139734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 13, 2025
Merged
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,7 @@ pub enum PatKind<'hir> {
Never,

/// A tuple pattern (e.g., `(a, b)`).
/// If the `..` pattern fragment is present, then `Option<usize>` denotes its position.
/// If the `..` pattern fragment is present, then `DotDotPos` denotes its position.
/// `0 <= position <= subpats.len()`
Tuple(&'hir [Pat<'hir>], DotDotPos),

Expand Down
32 changes: 16 additions & 16 deletions library/std/src/f128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ impl f128 {
#[unstable(feature = "f128", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn cbrt(self) -> f128 {
unsafe { cmath::cbrtf128(self) }
cmath::cbrtf128(self)
}

/// Compute the distance between the origin and a point (`x`, `y`) on the
Expand Down Expand Up @@ -703,7 +703,7 @@ impl f128 {
#[unstable(feature = "f128", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn hypot(self, other: f128) -> f128 {
unsafe { cmath::hypotf128(self, other) }
cmath::hypotf128(self, other)
}

/// Computes the sine of a number (in radians).
Expand Down Expand Up @@ -789,7 +789,7 @@ impl f128 {
#[unstable(feature = "f128", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn tan(self) -> f128 {
unsafe { cmath::tanf128(self) }
cmath::tanf128(self)
}

/// Computes the arcsine of a number. Return value is in radians in
Expand Down Expand Up @@ -824,7 +824,7 @@ impl f128 {
#[unstable(feature = "f128", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn asin(self) -> f128 {
unsafe { cmath::asinf128(self) }
cmath::asinf128(self)
}

/// Computes the arccosine of a number. Return value is in radians in
Expand Down Expand Up @@ -859,7 +859,7 @@ impl f128 {
#[unstable(feature = "f128", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn acos(self) -> f128 {
unsafe { cmath::acosf128(self) }
cmath::acosf128(self)
}

/// Computes the arctangent of a number. Return value is in radians in the
Expand Down Expand Up @@ -893,7 +893,7 @@ impl f128 {
#[unstable(feature = "f128", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn atan(self) -> f128 {
unsafe { cmath::atanf128(self) }
cmath::atanf128(self)
}

/// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`) in radians.
Expand Down Expand Up @@ -939,7 +939,7 @@ impl f128 {
#[unstable(feature = "f128", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn atan2(self, other: f128) -> f128 {
unsafe { cmath::atan2f128(self, other) }
cmath::atan2f128(self, other)
}

/// Simultaneously computes the sine and cosine of the number, `x`. Returns
Expand Down Expand Up @@ -1008,7 +1008,7 @@ impl f128 {
#[unstable(feature = "f128", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn exp_m1(self) -> f128 {
unsafe { cmath::expm1f128(self) }
cmath::expm1f128(self)
}

/// Returns `ln(1+n)` (natural logarithm) more accurately than if
Expand Down Expand Up @@ -1055,7 +1055,7 @@ impl f128 {
#[rustc_allow_incoherent_impl]
#[unstable(feature = "f128", issue = "116909")]
pub fn ln_1p(self) -> f128 {
unsafe { cmath::log1pf128(self) }
cmath::log1pf128(self)
}

/// Hyperbolic sine function.
Expand Down Expand Up @@ -1090,7 +1090,7 @@ impl f128 {
#[unstable(feature = "f128", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn sinh(self) -> f128 {
unsafe { cmath::sinhf128(self) }
cmath::sinhf128(self)
}

/// Hyperbolic cosine function.
Expand Down Expand Up @@ -1125,7 +1125,7 @@ impl f128 {
#[unstable(feature = "f128", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn cosh(self) -> f128 {
unsafe { cmath::coshf128(self) }
cmath::coshf128(self)
}

/// Hyperbolic tangent function.
Expand Down Expand Up @@ -1160,7 +1160,7 @@ impl f128 {
#[unstable(feature = "f128", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn tanh(self) -> f128 {
unsafe { cmath::tanhf128(self) }
cmath::tanhf128(self)
}

/// Inverse hyperbolic sine function.
Expand Down Expand Up @@ -1289,7 +1289,7 @@ impl f128 {
// #[unstable(feature = "float_gamma", issue = "99842")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn gamma(self) -> f128 {
unsafe { cmath::tgammaf128(self) }
cmath::tgammaf128(self)
}

/// Natural logarithm of the absolute value of the gamma function
Expand Down Expand Up @@ -1325,7 +1325,7 @@ impl f128 {
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn ln_gamma(self) -> (f128, i32) {
let mut signgamp: i32 = 0;
let x = unsafe { cmath::lgammaf128_r(self, &mut signgamp) };
let x = cmath::lgammaf128_r(self, &mut signgamp);
(x, signgamp)
}

Expand Down Expand Up @@ -1365,7 +1365,7 @@ impl f128 {
// #[unstable(feature = "float_erf", issue = "136321")]
#[inline]
pub fn erf(self) -> f128 {
unsafe { cmath::erff128(self) }
cmath::erff128(self)
}

/// Complementary error function.
Expand Down Expand Up @@ -1398,6 +1398,6 @@ impl f128 {
// #[unstable(feature = "float_erf", issue = "136321")]
#[inline]
pub fn erfc(self) -> f128 {
unsafe { cmath::erfcf128(self) }
cmath::erfcf128(self)
}
}
32 changes: 16 additions & 16 deletions library/std/src/f16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ impl f16 {
#[unstable(feature = "f16", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn cbrt(self) -> f16 {
(unsafe { cmath::cbrtf(self as f32) }) as f16
cmath::cbrtf(self as f32) as f16
}

/// Compute the distance between the origin and a point (`x`, `y`) on the
Expand Down Expand Up @@ -701,7 +701,7 @@ impl f16 {
#[unstable(feature = "f16", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn hypot(self, other: f16) -> f16 {
(unsafe { cmath::hypotf(self as f32, other as f32) }) as f16
cmath::hypotf(self as f32, other as f32) as f16
}

/// Computes the sine of a number (in radians).
Expand Down Expand Up @@ -787,7 +787,7 @@ impl f16 {
#[unstable(feature = "f16", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn tan(self) -> f16 {
(unsafe { cmath::tanf(self as f32) }) as f16
cmath::tanf(self as f32) as f16
}

/// Computes the arcsine of a number. Return value is in radians in
Expand Down Expand Up @@ -822,7 +822,7 @@ impl f16 {
#[unstable(feature = "f16", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn asin(self) -> f16 {
(unsafe { cmath::asinf(self as f32) }) as f16
cmath::asinf(self as f32) as f16
}

/// Computes the arccosine of a number. Return value is in radians in
Expand Down Expand Up @@ -857,7 +857,7 @@ impl f16 {
#[unstable(feature = "f16", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn acos(self) -> f16 {
(unsafe { cmath::acosf(self as f32) }) as f16
cmath::acosf(self as f32) as f16
}

/// Computes the arctangent of a number. Return value is in radians in the
Expand Down Expand Up @@ -891,7 +891,7 @@ impl f16 {
#[unstable(feature = "f16", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn atan(self) -> f16 {
(unsafe { cmath::atanf(self as f32) }) as f16
cmath::atanf(self as f32) as f16
}

/// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`) in radians.
Expand Down Expand Up @@ -937,7 +937,7 @@ impl f16 {
#[unstable(feature = "f16", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn atan2(self, other: f16) -> f16 {
(unsafe { cmath::atan2f(self as f32, other as f32) }) as f16
cmath::atan2f(self as f32, other as f32) as f16
}

/// Simultaneously computes the sine and cosine of the number, `x`. Returns
Expand Down Expand Up @@ -1006,7 +1006,7 @@ impl f16 {
#[unstable(feature = "f16", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn exp_m1(self) -> f16 {
(unsafe { cmath::expm1f(self as f32) }) as f16
cmath::expm1f(self as f32) as f16
}

/// Returns `ln(1+n)` (natural logarithm) more accurately than if
Expand Down Expand Up @@ -1053,7 +1053,7 @@ impl f16 {
#[unstable(feature = "f16", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn ln_1p(self) -> f16 {
(unsafe { cmath::log1pf(self as f32) }) as f16
cmath::log1pf(self as f32) as f16
}

/// Hyperbolic sine function.
Expand Down Expand Up @@ -1088,7 +1088,7 @@ impl f16 {
#[unstable(feature = "f16", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn sinh(self) -> f16 {
(unsafe { cmath::sinhf(self as f32) }) as f16
cmath::sinhf(self as f32) as f16
}

/// Hyperbolic cosine function.
Expand Down Expand Up @@ -1123,7 +1123,7 @@ impl f16 {
#[unstable(feature = "f16", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn cosh(self) -> f16 {
(unsafe { cmath::coshf(self as f32) }) as f16
cmath::coshf(self as f32) as f16
}

/// Hyperbolic tangent function.
Expand Down Expand Up @@ -1158,7 +1158,7 @@ impl f16 {
#[unstable(feature = "f16", issue = "116909")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn tanh(self) -> f16 {
(unsafe { cmath::tanhf(self as f32) }) as f16
cmath::tanhf(self as f32) as f16
}

/// Inverse hyperbolic sine function.
Expand Down Expand Up @@ -1287,7 +1287,7 @@ impl f16 {
// #[unstable(feature = "float_gamma", issue = "99842")]
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn gamma(self) -> f16 {
(unsafe { cmath::tgammaf(self as f32) }) as f16
cmath::tgammaf(self as f32) as f16
}

/// Natural logarithm of the absolute value of the gamma function
Expand Down Expand Up @@ -1323,7 +1323,7 @@ impl f16 {
#[must_use = "method returns a new number and does not mutate the original value"]
pub fn ln_gamma(self) -> (f16, i32) {
let mut signgamp: i32 = 0;
let x = (unsafe { cmath::lgammaf_r(self as f32, &mut signgamp) }) as f16;
let x = cmath::lgammaf_r(self as f32, &mut signgamp) as f16;
(x, signgamp)
}

Expand Down Expand Up @@ -1363,7 +1363,7 @@ impl f16 {
// #[unstable(feature = "float_erf", issue = "136321")]
#[inline]
pub fn erf(self) -> f16 {
(unsafe { cmath::erff(self as f32) }) as f16
cmath::erff(self as f32) as f16
}

/// Complementary error function.
Expand Down Expand Up @@ -1396,6 +1396,6 @@ impl f16 {
// #[unstable(feature = "float_erf", issue = "136321")]
#[inline]
pub fn erfc(self) -> f16 {
(unsafe { cmath::erfcf(self as f32) }) as f16
cmath::erfcf(self as f32) as f16
}
}
Loading
Loading