Skip to content

Commit 3e50a64

Browse files
committed
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
2 parents d06ca0f + 8e0a8cd commit 3e50a64

File tree

8 files changed

+48
-1
lines changed

8 files changed

+48
-1
lines changed

Diff for: library/core/src/num/int_macros.rs

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

Diff for: library/core/src/num/uint_macros.rs

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

Diff for: library/std/src/f32.rs

+10
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ impl f32 {
6161
/// assert_eq!(f.ceil(), 4.0);
6262
/// assert_eq!(g.ceil(), 4.0);
6363
/// ```
64+
#[doc(alias = "ceiling")]
6465
#[rustc_allow_incoherent_impl]
6566
#[must_use = "method returns a new number and does not mutate the original value"]
6667
#[stable(feature = "rust1", since = "1.0.0")]
@@ -135,6 +136,7 @@ impl f32 {
135136
/// assert_eq!(g.trunc(), 3.0);
136137
/// assert_eq!(h.trunc(), -3.0);
137138
/// ```
139+
#[doc(alias = "truncate")]
138140
#[rustc_allow_incoherent_impl]
139141
#[must_use = "method returns a new number and does not mutate the original value"]
140142
#[stable(feature = "rust1", since = "1.0.0")]
@@ -321,6 +323,7 @@ impl f32 {
321323
/// // limitation due to round-off error
322324
/// assert!((-f32::EPSILON).rem_euclid(3.0) != 0.0);
323325
/// ```
326+
#[doc(alias = "modulo", alias = "mod")]
324327
#[rustc_allow_incoherent_impl]
325328
#[must_use = "method returns a new number and does not mutate the original value"]
326329
#[inline]
@@ -672,6 +675,7 @@ impl f32 {
672675
///
673676
/// assert!(abs_difference <= f32::EPSILON);
674677
/// ```
678+
#[doc(alias = "arcsin")]
675679
#[rustc_allow_incoherent_impl]
676680
#[must_use = "method returns a new number and does not mutate the original value"]
677681
#[stable(feature = "rust1", since = "1.0.0")]
@@ -694,6 +698,7 @@ impl f32 {
694698
///
695699
/// assert!(abs_difference <= f32::EPSILON);
696700
/// ```
701+
#[doc(alias = "arccos")]
697702
#[rustc_allow_incoherent_impl]
698703
#[must_use = "method returns a new number and does not mutate the original value"]
699704
#[stable(feature = "rust1", since = "1.0.0")]
@@ -715,6 +720,7 @@ impl f32 {
715720
///
716721
/// assert!(abs_difference <= f32::EPSILON);
717722
/// ```
723+
#[doc(alias = "arctan")]
718724
#[rustc_allow_incoherent_impl]
719725
#[must_use = "method returns a new number and does not mutate the original value"]
720726
#[stable(feature = "rust1", since = "1.0.0")]
@@ -772,6 +778,7 @@ impl f32 {
772778
/// assert!(abs_difference_0 <= f32::EPSILON);
773779
/// assert!(abs_difference_1 <= f32::EPSILON);
774780
/// ```
781+
#[doc(alias = "sincos")]
775782
#[rustc_allow_incoherent_impl]
776783
#[stable(feature = "rust1", since = "1.0.0")]
777784
#[inline]
@@ -904,6 +911,7 @@ impl f32 {
904911
///
905912
/// assert!(abs_difference <= f32::EPSILON);
906913
/// ```
914+
#[doc(alias = "arcsinh")]
907915
#[rustc_allow_incoherent_impl]
908916
#[must_use = "method returns a new number and does not mutate the original value"]
909917
#[stable(feature = "rust1", since = "1.0.0")]
@@ -926,6 +934,7 @@ impl f32 {
926934
///
927935
/// assert!(abs_difference <= f32::EPSILON);
928936
/// ```
937+
#[doc(alias = "arccosh")]
929938
#[rustc_allow_incoherent_impl]
930939
#[must_use = "method returns a new number and does not mutate the original value"]
931940
#[stable(feature = "rust1", since = "1.0.0")]
@@ -950,6 +959,7 @@ impl f32 {
950959
///
951960
/// assert!(abs_difference <= 1e-5);
952961
/// ```
962+
#[doc(alias = "arctanh")]
953963
#[rustc_allow_incoherent_impl]
954964
#[must_use = "method returns a new number and does not mutate the original value"]
955965
#[stable(feature = "rust1", since = "1.0.0")]

Diff for: library/std/src/f64.rs

+10
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ impl f64 {
6161
/// assert_eq!(f.ceil(), 4.0);
6262
/// assert_eq!(g.ceil(), 4.0);
6363
/// ```
64+
#[doc(alias = "ceiling")]
6465
#[rustc_allow_incoherent_impl]
6566
#[must_use = "method returns a new number and does not mutate the original value"]
6667
#[stable(feature = "rust1", since = "1.0.0")]
@@ -135,6 +136,7 @@ impl f64 {
135136
/// assert_eq!(g.trunc(), 3.0);
136137
/// assert_eq!(h.trunc(), -3.0);
137138
/// ```
139+
#[doc(alias = "truncate")]
138140
#[rustc_allow_incoherent_impl]
139141
#[must_use = "method returns a new number and does not mutate the original value"]
140142
#[stable(feature = "rust1", since = "1.0.0")]
@@ -321,6 +323,7 @@ impl f64 {
321323
/// // limitation due to round-off error
322324
/// assert!((-f64::EPSILON).rem_euclid(3.0) != 0.0);
323325
/// ```
326+
#[doc(alias = "modulo", alias = "mod")]
324327
#[rustc_allow_incoherent_impl]
325328
#[must_use = "method returns a new number and does not mutate the original value"]
326329
#[inline]
@@ -672,6 +675,7 @@ impl f64 {
672675
///
673676
/// assert!(abs_difference < 1e-10);
674677
/// ```
678+
#[doc(alias = "arcsin")]
675679
#[rustc_allow_incoherent_impl]
676680
#[must_use = "method returns a new number and does not mutate the original value"]
677681
#[stable(feature = "rust1", since = "1.0.0")]
@@ -694,6 +698,7 @@ impl f64 {
694698
///
695699
/// assert!(abs_difference < 1e-10);
696700
/// ```
701+
#[doc(alias = "arccos")]
697702
#[rustc_allow_incoherent_impl]
698703
#[must_use = "method returns a new number and does not mutate the original value"]
699704
#[stable(feature = "rust1", since = "1.0.0")]
@@ -715,6 +720,7 @@ impl f64 {
715720
///
716721
/// assert!(abs_difference < 1e-10);
717722
/// ```
723+
#[doc(alias = "arctan")]
718724
#[rustc_allow_incoherent_impl]
719725
#[must_use = "method returns a new number and does not mutate the original value"]
720726
#[stable(feature = "rust1", since = "1.0.0")]
@@ -772,6 +778,7 @@ impl f64 {
772778
/// assert!(abs_difference_0 < 1e-10);
773779
/// assert!(abs_difference_1 < 1e-10);
774780
/// ```
781+
#[doc(alias = "sincos")]
775782
#[rustc_allow_incoherent_impl]
776783
#[stable(feature = "rust1", since = "1.0.0")]
777784
#[inline]
@@ -904,6 +911,7 @@ impl f64 {
904911
///
905912
/// assert!(abs_difference < 1.0e-10);
906913
/// ```
914+
#[doc(alias = "arcsinh")]
907915
#[rustc_allow_incoherent_impl]
908916
#[must_use = "method returns a new number and does not mutate the original value"]
909917
#[stable(feature = "rust1", since = "1.0.0")]
@@ -926,6 +934,7 @@ impl f64 {
926934
///
927935
/// assert!(abs_difference < 1.0e-10);
928936
/// ```
937+
#[doc(alias = "arccosh")]
929938
#[rustc_allow_incoherent_impl]
930939
#[must_use = "method returns a new number and does not mutate the original value"]
931940
#[stable(feature = "rust1", since = "1.0.0")]
@@ -950,6 +959,7 @@ impl f64 {
950959
///
951960
/// assert!(abs_difference < 1.0e-10);
952961
/// ```
962+
#[doc(alias = "arctanh")]
953963
#[rustc_allow_incoherent_impl]
954964
#[must_use = "method returns a new number and does not mutate the original value"]
955965
#[stable(feature = "rust1", since = "1.0.0")]

Diff for: tests/run-make/optimization-remarks-dir-pgo/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# needs-profiler-support
22
# ignore-windows-gnu
3+
# ignore-cross-compile
34

45
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
56
# properly. Since we only have GCC on the CI ignore the test for now.

Diff for: tests/ui/inline-const/required-const.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// build-fail
2+
// compile-flags: -Zmir-opt-level=3
3+
#![feature(inline_const)]
4+
5+
fn foo<T>() {
6+
if false {
7+
const { panic!() } //~ ERROR E0080
8+
}
9+
}
10+
11+
fn main() {
12+
foo::<i32>();
13+
}

Diff for: tests/ui/inline-const/required-const.stderr

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0080]: evaluation of `foo::<i32>::{constant#0}` failed
2+
--> $DIR/required-const.rs:7:17
3+
|
4+
LL | const { panic!() }
5+
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/required-const.rs:7:17
6+
|
7+
= 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)
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0080`.

Diff for: triagebot.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ cc = ["@nnethercote"]
489489
[assign]
490490
warn_non_default_branch = true
491491
contributing_url = "https://rustc-dev-guide.rust-lang.org/getting-started.html"
492-
users_on_vacation = ["jyn514", "WaffleLapkin", "clubby789", "oli-obk"]
492+
users_on_vacation = ["jyn514", "clubby789", "oli-obk"]
493493

494494
[assign.adhoc_groups]
495495
compiler-team = [

0 commit comments

Comments
 (0)