Skip to content

Commit 254db01

Browse files
committed
Auto merge of #68011 - JohnTitor:rollup-44s8twu, r=JohnTitor
Rollup of 10 pull requests Successful merges: - #67774 (Try statx for all linux-gnu target.) - #67781 (Move `is_min_const_fn` query to librustc_mir.) - #67798 (Remove wrong advice about spin locks from `spin_loop_hint` docs) - #67849 (Add a check for swapped words when we can't find an identifier) - #67875 (Distinguish between private items and hidden items in rustdoc) - #67887 (`Option::{expect,unwrap}` and `Result::{expect, expect_err, unwrap, unwrap_err}` have `#[track_caller]`) - #67955 (rustdoc: Remove more `#[doc(cfg(..))]` duplicates) - #67977 (Updates for VxWorks) - #67985 (Remove insignificant notes from CStr documentation) - #68003 (ci: fix wrong shared.sh import for publish_toolstate) Failed merges: - #67820 (Parse the syntax described in RFC 2632) - #67979 (Move `intravisit` => `rustc_hir` + misc cleanup) r? @ghost
2 parents ed6468d + 844530e commit 254db01

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+537
-385
lines changed

src/ci/publish_toolstate.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -euo pipefail
44
IFS=$'\n\t'
55

6-
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
6+
source "$(cd "$(dirname "$0")" && pwd)/shared.sh"
77

88
# The following lines are also found in src/bootstrap/toolstate.rs,
99
# so if updating here, please also update that file.

src/libcore/option.rs

+6
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ impl<T> Option<T> {
341341
/// x.expect("the world is ending"); // panics with `the world is ending`
342342
/// ```
343343
#[inline]
344+
#[track_caller]
344345
#[stable(feature = "rust1", since = "1.0.0")]
345346
pub fn expect(self, msg: &str) -> T {
346347
match self {
@@ -374,6 +375,7 @@ impl<T> Option<T> {
374375
/// assert_eq!(x.unwrap(), "air"); // fails
375376
/// ```
376377
#[inline]
378+
#[track_caller]
377379
#[stable(feature = "rust1", since = "1.0.0")]
378380
pub fn unwrap(self) -> T {
379381
match self {
@@ -1015,6 +1017,7 @@ impl<T: fmt::Debug> Option<T> {
10151017
/// }
10161018
/// ```
10171019
#[inline]
1020+
#[track_caller]
10181021
#[unstable(feature = "option_expect_none", reason = "newly added", issue = "62633")]
10191022
pub fn expect_none(self, msg: &str) {
10201023
if let Some(val) = self {
@@ -1057,6 +1060,7 @@ impl<T: fmt::Debug> Option<T> {
10571060
/// }
10581061
/// ```
10591062
#[inline]
1063+
#[track_caller]
10601064
#[unstable(feature = "option_unwrap_none", reason = "newly added", issue = "62633")]
10611065
pub fn unwrap_none(self) {
10621066
if let Some(val) = self {
@@ -1184,13 +1188,15 @@ impl<T, E> Option<Result<T, E>> {
11841188
// This is a separate function to reduce the code size of .expect() itself.
11851189
#[inline(never)]
11861190
#[cold]
1191+
#[track_caller]
11871192
fn expect_failed(msg: &str) -> ! {
11881193
panic!("{}", msg)
11891194
}
11901195

11911196
// This is a separate function to reduce the code size of .expect_none() itself.
11921197
#[inline(never)]
11931198
#[cold]
1199+
#[track_caller]
11941200
fn expect_none_failed(msg: &str, value: &dyn fmt::Debug) -> ! {
11951201
panic!("{}: {:?}", msg, value)
11961202
}

src/libcore/result.rs

+5
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ impl<T, E: fmt::Debug> Result<T, E> {
957957
/// x.unwrap(); // panics with `emergency failure`
958958
/// ```
959959
#[inline]
960+
#[track_caller]
960961
#[stable(feature = "rust1", since = "1.0.0")]
961962
pub fn unwrap(self) -> T {
962963
match self {
@@ -984,6 +985,7 @@ impl<T, E: fmt::Debug> Result<T, E> {
984985
/// x.expect("Testing expect"); // panics with `Testing expect: emergency failure`
985986
/// ```
986987
#[inline]
988+
#[track_caller]
987989
#[stable(feature = "result_expect", since = "1.4.0")]
988990
pub fn expect(self, msg: &str) -> T {
989991
match self {
@@ -1017,6 +1019,7 @@ impl<T: fmt::Debug, E> Result<T, E> {
10171019
/// assert_eq!(x.unwrap_err(), "emergency failure");
10181020
/// ```
10191021
#[inline]
1022+
#[track_caller]
10201023
#[stable(feature = "rust1", since = "1.0.0")]
10211024
pub fn unwrap_err(self) -> E {
10221025
match self {
@@ -1044,6 +1047,7 @@ impl<T: fmt::Debug, E> Result<T, E> {
10441047
/// x.expect_err("Testing expect_err"); // panics with `Testing expect_err: 10`
10451048
/// ```
10461049
#[inline]
1050+
#[track_caller]
10471051
#[stable(feature = "result_expect_err", since = "1.17.0")]
10481052
pub fn expect_err(self, msg: &str) -> E {
10491053
match self {
@@ -1188,6 +1192,7 @@ impl<T, E> Result<Option<T>, E> {
11881192
// This is a separate function to reduce the code size of the methods
11891193
#[inline(never)]
11901194
#[cold]
1195+
#[track_caller]
11911196
fn unwrap_failed(msg: &str, error: &dyn fmt::Debug) -> ! {
11921197
panic!("{}: {:?}", msg, error)
11931198
}

src/libcore/sync/atomic.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,10 @@ use crate::hint::spin_loop;
134134
/// This function is different from [`std::thread::yield_now`] which directly yields to the
135135
/// system's scheduler, whereas `spin_loop_hint` does not interact with the operating system.
136136
///
137-
/// Spin locks can be very efficient for short lock durations because they do not involve context
138-
/// switches or interaction with the operating system. For long lock durations they become wasteful
139-
/// however because they use CPU cycles for the entire lock duration, and using a
140-
/// [`std::sync::Mutex`] is likely the better approach. If actively spinning for a long time is
141-
/// required, e.g. because code polls a non-blocking API, calling [`std::thread::yield_now`]
142-
/// or [`std::thread::sleep`] may be the best option.
143-
///
144-
/// **Note**: Spin locks are based on the underlying assumption that another thread will release
145-
/// the lock 'soon'. In order for this to work, that other thread must run on a different CPU or
146-
/// core (at least potentially). Spin locks do not work efficiently on single CPU / core platforms.
137+
/// A common use case for `spin_loop_hint` is implementing bounded optimistic spinning in a CAS
138+
/// loop in synchronization primitives. To avoid problems like priority inversion, it is strongly
139+
/// recommended that the spin loop is terminated after a finite amount of iterations and an
140+
/// appropriate blocking syscall is made.
147141
///
148142
/// **Note**: On platforms that do not support receiving spin-loop hints this function does not
149143
/// do anything at all.

src/librustc/ty/constness.rs

-156
This file was deleted.

src/librustc/ty/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ pub mod cast;
9797
#[macro_use]
9898
pub mod codec;
9999
pub mod _match;
100-
mod constness;
101100
mod erase_regions;
102101
pub mod error;
103102
pub mod fast_reject;
@@ -3318,7 +3317,6 @@ pub fn provide(providers: &mut ty::query::Providers<'_>) {
33183317
context::provide(providers);
33193318
erase_regions::provide(providers);
33203319
layout::provide(providers);
3321-
constness::provide(providers);
33223320
*providers = ty::query::Providers {
33233321
asyncness,
33243322
associated_item,

src/librustc_mir/const_eval.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ use crate::interpret::{intern_const_alloc_recursive, ConstValue, InterpCx};
99

1010
mod error;
1111
mod eval_queries;
12+
mod fn_queries;
1213
mod machine;
1314

1415
pub use error::*;
1516
pub use eval_queries::*;
17+
pub use fn_queries::*;
1618
pub use machine::*;
1719

1820
/// Extracts a field of a (variant of a) const.

0 commit comments

Comments
 (0)