Skip to content

Commit 322e4b2

Browse files
committed
Auto merge of #97265 - JohnTitor:rollup-kgthnjt, r=JohnTitor
Rollup of 6 pull requests Successful merges: - #97144 (Fix rusty grammar in `std::error::Reporter` docs) - #97225 (Fix `Display` for `cell::{Ref,RefMut}`) - #97228 (Omit stdarch workspace from rust-src) - #97236 (Recover when resolution did not resolve lifetimes.) - #97245 (Fix typo in futex RwLock::write_contended.) - #97259 (Fix typo in Mir phase docs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 4fdcddd + 5f9b90f commit 322e4b2

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

core/src/cell.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Ref<'b, U>> for Ref<'b,
14871487
#[stable(feature = "std_guard_impls", since = "1.20.0")]
14881488
impl<T: ?Sized + fmt::Display> fmt::Display for Ref<'_, T> {
14891489
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1490-
self.value.fmt(f)
1490+
(**self).fmt(f)
14911491
}
14921492
}
14931493

@@ -1735,7 +1735,7 @@ impl<'b, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<RefMut<'b, U>> for RefM
17351735
#[stable(feature = "std_guard_impls", since = "1.20.0")]
17361736
impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
17371737
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1738-
self.value.fmt(f)
1738+
(**self).fmt(f)
17391739
}
17401740
}
17411741

core/tests/cell.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,13 @@ fn ref_and_refmut_have_sensible_show() {
7373
let refcell = RefCell::new("foo");
7474

7575
let refcell_refmut = refcell.borrow_mut();
76-
assert!(format!("{refcell_refmut:?}").contains("foo"));
76+
assert_eq!(format!("{refcell_refmut}"), "foo"); // Display
77+
assert!(format!("{refcell_refmut:?}").contains("foo")); // Debug
7778
drop(refcell_refmut);
7879

7980
let refcell_ref = refcell.borrow();
80-
assert!(format!("{refcell_ref:?}").contains("foo"));
81+
assert_eq!(format!("{refcell_ref}"), "foo"); // Display
82+
assert!(format!("{refcell_ref:?}").contains("foo")); // Debug
8183
drop(refcell_ref);
8284
}
8385

std/src/error.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -863,12 +863,12 @@ impl dyn Error + Send + Sync {
863863
}
864864
}
865865

866-
/// An error reporter that print's an error and its sources.
866+
/// An error reporter that prints an error and its sources.
867867
///
868868
/// Report also exposes configuration options for formatting the error chain, either entirely on a
869869
/// single line, or in multi-line format with each cause in the error chain on a new line.
870870
///
871-
/// `Report` only requires that the wrapped error implements `Error`. It doesn't require that the
871+
/// `Report` only requires that the wrapped error implement `Error`. It doesn't require that the
872872
/// wrapped error be `Send`, `Sync`, or `'static`.
873873
///
874874
/// # Examples
@@ -972,7 +972,7 @@ impl dyn Error + Send + Sync {
972972
///
973973
/// ## Return from `main`
974974
///
975-
/// `Report` also implements `From` for all types that implement [`Error`], this when combined with
975+
/// `Report` also implements `From` for all types that implement [`Error`]; this when combined with
976976
/// the `Debug` output means `Report` is an ideal starting place for formatting errors returned
977977
/// from `main`.
978978
///
@@ -1020,7 +1020,7 @@ impl dyn Error + Send + Sync {
10201020
/// ```
10211021
///
10221022
/// **Note**: `Report`s constructed via `?` and `From` will be configured to use the single line
1023-
/// output format, if you want to make sure your `Report`s are pretty printed and include backtrace
1023+
/// output format. If you want to make sure your `Report`s are pretty printed and include backtrace
10241024
/// you will need to manually convert and enable those flags.
10251025
///
10261026
/// ```should_panic

std/src/sys/unix/locks/futex_rwlock.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,8 @@ impl RwLock {
208208

209209
// Don't go to sleep if the lock has become available,
210210
// or if the writers waiting bit is no longer set.
211-
let s = self.state.load(Relaxed);
212-
if is_unlocked(state) || !has_writers_waiting(s) {
213-
state = s;
211+
state = self.state.load(Relaxed);
212+
if is_unlocked(state) || !has_writers_waiting(state) {
214213
continue;
215214
}
216215

0 commit comments

Comments
 (0)