Auto merge of #114980 - matthiaskrgr:rollup-3y7651q, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #114953 (Add myself back to review rotation)
 - #114958 (`ignore-cross-compile` on `optimization-remarks-dir-pgo` test)
 - #114971 (Add doc aliases for trigonometry and other f32,f64 methods.)
 - #114972 (Add a test to check that inline const is in required_consts)
 - #114977 (Add `modulo` and `mod` as doc aliases for `rem_euclid`.)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2023-08-19 10:58:57 +00:00
commit 3e50a641da
8 changed files with 48 additions and 1 deletions

View File

@ -2126,6 +2126,7 @@ macro_rules! int_impl {
/// assert_eq!(a.rem_euclid(-b), 3);
/// assert_eq!((-a).rem_euclid(-b), 1);
/// ```
#[doc(alias = "modulo", alias = "mod")]
#[stable(feature = "euclidean_division", since = "1.38.0")]
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
#[must_use = "this returns the result of the operation, \

View File

@ -2024,6 +2024,7 @@ macro_rules! uint_impl {
/// ```
#[doc = concat!("assert_eq!(7", stringify!($SelfT), ".rem_euclid(4), 3); // or any other integer type")]
/// ```
#[doc(alias = "modulo", alias = "mod")]
#[stable(feature = "euclidean_division", since = "1.38.0")]
#[rustc_const_stable(feature = "const_euclidean_int_methods", since = "1.52.0")]
#[must_use = "this returns the result of the operation, \

View File

@ -61,6 +61,7 @@ impl f32 {
/// assert_eq!(f.ceil(), 4.0);
/// assert_eq!(g.ceil(), 4.0);
/// ```
#[doc(alias = "ceiling")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]
@ -135,6 +136,7 @@ impl f32 {
/// assert_eq!(g.trunc(), 3.0);
/// assert_eq!(h.trunc(), -3.0);
/// ```
#[doc(alias = "truncate")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]
@ -321,6 +323,7 @@ impl f32 {
/// // limitation due to round-off error
/// assert!((-f32::EPSILON).rem_euclid(3.0) != 0.0);
/// ```
#[doc(alias = "modulo", alias = "mod")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[inline]
@ -672,6 +675,7 @@ impl f32 {
///
/// assert!(abs_difference <= f32::EPSILON);
/// ```
#[doc(alias = "arcsin")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]
@ -694,6 +698,7 @@ impl f32 {
///
/// assert!(abs_difference <= f32::EPSILON);
/// ```
#[doc(alias = "arccos")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]
@ -715,6 +720,7 @@ impl f32 {
///
/// assert!(abs_difference <= f32::EPSILON);
/// ```
#[doc(alias = "arctan")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]
@ -772,6 +778,7 @@ impl f32 {
/// assert!(abs_difference_0 <= f32::EPSILON);
/// assert!(abs_difference_1 <= f32::EPSILON);
/// ```
#[doc(alias = "sincos")]
#[rustc_allow_incoherent_impl]
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
@ -904,6 +911,7 @@ impl f32 {
///
/// assert!(abs_difference <= f32::EPSILON);
/// ```
#[doc(alias = "arcsinh")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]
@ -926,6 +934,7 @@ impl f32 {
///
/// assert!(abs_difference <= f32::EPSILON);
/// ```
#[doc(alias = "arccosh")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]
@ -950,6 +959,7 @@ impl f32 {
///
/// assert!(abs_difference <= 1e-5);
/// ```
#[doc(alias = "arctanh")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]

View File

@ -61,6 +61,7 @@ impl f64 {
/// assert_eq!(f.ceil(), 4.0);
/// assert_eq!(g.ceil(), 4.0);
/// ```
#[doc(alias = "ceiling")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]
@ -135,6 +136,7 @@ impl f64 {
/// assert_eq!(g.trunc(), 3.0);
/// assert_eq!(h.trunc(), -3.0);
/// ```
#[doc(alias = "truncate")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]
@ -321,6 +323,7 @@ impl f64 {
/// // limitation due to round-off error
/// assert!((-f64::EPSILON).rem_euclid(3.0) != 0.0);
/// ```
#[doc(alias = "modulo", alias = "mod")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[inline]
@ -672,6 +675,7 @@ impl f64 {
///
/// assert!(abs_difference < 1e-10);
/// ```
#[doc(alias = "arcsin")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]
@ -694,6 +698,7 @@ impl f64 {
///
/// assert!(abs_difference < 1e-10);
/// ```
#[doc(alias = "arccos")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]
@ -715,6 +720,7 @@ impl f64 {
///
/// assert!(abs_difference < 1e-10);
/// ```
#[doc(alias = "arctan")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]
@ -772,6 +778,7 @@ impl f64 {
/// assert!(abs_difference_0 < 1e-10);
/// assert!(abs_difference_1 < 1e-10);
/// ```
#[doc(alias = "sincos")]
#[rustc_allow_incoherent_impl]
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
@ -904,6 +911,7 @@ impl f64 {
///
/// assert!(abs_difference < 1.0e-10);
/// ```
#[doc(alias = "arcsinh")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]
@ -926,6 +934,7 @@ impl f64 {
///
/// assert!(abs_difference < 1.0e-10);
/// ```
#[doc(alias = "arccosh")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]
@ -950,6 +959,7 @@ impl f64 {
///
/// assert!(abs_difference < 1.0e-10);
/// ```
#[doc(alias = "arctanh")]
#[rustc_allow_incoherent_impl]
#[must_use = "method returns a new number and does not mutate the original value"]
#[stable(feature = "rust1", since = "1.0.0")]

View File

@ -1,5 +1,6 @@
# needs-profiler-support
# ignore-windows-gnu
# ignore-cross-compile
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
# properly. Since we only have GCC on the CI ignore the test for now.

View File

@ -0,0 +1,13 @@
// build-fail
// compile-flags: -Zmir-opt-level=3
#![feature(inline_const)]
fn foo<T>() {
if false {
const { panic!() } //~ ERROR E0080
}
}
fn main() {
foo::<i32>();
}

View File

@ -0,0 +1,11 @@
error[E0080]: evaluation of `foo::<i32>::{constant#0}` failed
--> $DIR/required-const.rs:7:17
|
LL | const { panic!() }
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/required-const.rs:7:17
|
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
For more information about this error, try `rustc --explain E0080`.

View File

@ -489,7 +489,7 @@ cc = ["@nnethercote"]
[assign]
warn_non_default_branch = true
contributing_url = "https://rustc-dev-guide.rust-lang.org/getting-started.html"
users_on_vacation = ["jyn514", "WaffleLapkin", "clubby789", "oli-obk"]
users_on_vacation = ["jyn514", "clubby789", "oli-obk"]
[assign.adhoc_groups]
compiler-team = [