Skip to content

Commit 180dd68

Browse files
committed
Auto merge of rust-lang#91962 - matthiaskrgr:rollup-2g082jw, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#91880 (fix clippy::single_char_pattern perf findings) - rust-lang#91885 (Remove `in_band_lifetimes` from `rustc_codegen_ssa`) - rust-lang#91898 (Make `TyS::is_suggestable` check for non-suggestable types structually) - rust-lang#91915 (Add another regression test for unnormalized fn args with Self) - rust-lang#91916 (Fix a bunch of typos) - rust-lang#91918 (Constify `bool::then{,_some}`) - rust-lang#91920 (Use `tcx.def_path_hash` in `ExistentialPredicate.stable_cmp`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents bc97720 + 8c98b28 commit 180dd68

File tree

32 files changed

+81
-57
lines changed

32 files changed

+81
-57
lines changed

alloc/tests/boxed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::mem::MaybeUninit;
33
use std::ptr::NonNull;
44

55
#[test]
6-
fn unitialized_zero_size_box() {
6+
fn uninitialized_zero_size_box() {
77
assert_eq!(
88
&*Box::<()>::new_uninit() as *const _,
99
NonNull::<MaybeUninit<()>>::dangling().as_ptr(),

alloc/tests/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ fn test_join_for_different_lengths_with_long_separator() {
162162
}
163163

164164
#[test]
165-
fn test_join_isue_80335() {
165+
fn test_join_issue_80335() {
166166
use core::{borrow::Borrow, cell::Cell};
167167

168168
struct WeirdBorrow {

core/src/alloc/layout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ impl Layout {
157157
///
158158
/// - If `T` is `Sized`, this function is always safe to call.
159159
/// - If the unsized tail of `T` is:
160-
/// - a [slice], then the length of the slice tail must be an intialized
160+
/// - a [slice], then the length of the slice tail must be an initialized
161161
/// integer, and the size of the *entire value*
162162
/// (dynamic tail length + statically sized prefix) must fit in `isize`.
163163
/// - a [trait object], then the vtable part of the pointer must point
164-
/// to a valid vtable for the type `T` acquired by an unsizing coersion,
164+
/// to a valid vtable for the type `T` acquired by an unsizing coercion,
165165
/// and the size of the *entire value*
166166
/// (dynamic tail length + statically sized prefix) must fit in `isize`.
167167
/// - an (unstable) [extern type], then this function is always safe to

core/src/bool.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ impl bool {
1414
/// assert_eq!(true.then_some(0), Some(0));
1515
/// ```
1616
#[unstable(feature = "bool_to_option", issue = "80967")]
17+
#[rustc_const_unstable(feature = "const_bool_to_option", issue = "91917")]
1718
#[inline]
18-
pub fn then_some<T>(self, t: T) -> Option<T> {
19+
pub const fn then_some<T>(self, t: T) -> Option<T>
20+
where
21+
T: ~const Drop,
22+
{
1923
if self { Some(t) } else { None }
2024
}
2125

@@ -29,8 +33,13 @@ impl bool {
2933
/// assert_eq!(true.then(|| 0), Some(0));
3034
/// ```
3135
#[stable(feature = "lazy_bool_to_option", since = "1.50.0")]
36+
#[rustc_const_unstable(feature = "const_bool_to_option", issue = "91917")]
3237
#[inline]
33-
pub fn then<T, F: FnOnce() -> T>(self, f: F) -> Option<T> {
38+
pub const fn then<T, F>(self, f: F) -> Option<T>
39+
where
40+
F: ~const FnOnce() -> T,
41+
F: ~const Drop,
42+
{
3443
if self { Some(f()) } else { None }
3544
}
3645
}

core/src/cell.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ impl<T: ?Sized> RefCell<T> {
898898
Ok(Ref { value: unsafe { &*self.value.get() }, borrow: b })
899899
}
900900
None => Err(BorrowError {
901-
// If a borrow occured, then we must already have an outstanding borrow,
901+
// If a borrow occurred, then we must already have an outstanding borrow,
902902
// so `borrowed_at` will be `Some`
903903
#[cfg(feature = "debug_refcell")]
904904
location: self.borrowed_at.get().unwrap(),
@@ -983,7 +983,7 @@ impl<T: ?Sized> RefCell<T> {
983983
Ok(RefMut { value: unsafe { &mut *self.value.get() }, borrow: b })
984984
}
985985
None => Err(BorrowMutError {
986-
// If a borrow occured, then we must already have an outstanding borrow,
986+
// If a borrow occurred, then we must already have an outstanding borrow,
987987
// so `borrowed_at` will be `Some`
988988
#[cfg(feature = "debug_refcell")]
989989
location: self.borrowed_at.get().unwrap(),
@@ -1104,7 +1104,7 @@ impl<T: ?Sized> RefCell<T> {
11041104
Ok(unsafe { &*self.value.get() })
11051105
} else {
11061106
Err(BorrowError {
1107-
// If a borrow occured, then we must already have an outstanding borrow,
1107+
// If a borrow occurred, then we must already have an outstanding borrow,
11081108
// so `borrowed_at` will be `Some`
11091109
#[cfg(feature = "debug_refcell")]
11101110
location: self.borrowed_at.get().unwrap(),

core/src/iter/adapters/zip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ impl<A: Debug + TrustedRandomAccessNoCoerce, B: Debug + TrustedRandomAccessNoCoe
516516
/// * It must also be safe to drop `self` after calling `self.__iterator_get_unchecked(idx)`.
517517
/// * If `T` is a subtype of `Self`, then it must be safe to coerce `self` to `T`.
518518
//
519-
// FIXME: Clarify interaction with SourceIter/InPlaceIterable. Calling `SouceIter::as_inner`
519+
// FIXME: Clarify interaction with SourceIter/InPlaceIterable. Calling `SourceIter::as_inner`
520520
// after `__iterator_get_unchecked` is supposed to be allowed.
521521
#[doc(hidden)]
522522
#[unstable(feature = "trusted_random_access", issue = "none")]

core/src/iter/range.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ range_exact_iter_impl! {
777777
usize u8 u16
778778
isize i8 i16
779779

780-
// These are incorect per the reasoning above,
780+
// These are incorrect per the reasoning above,
781781
// but removing them would be a breaking change as they were stabilized in Rust 1.0.0.
782782
// So e.g. `(0..66_000_u32).len()` for example will compile without error or warnings
783783
// on 16-bit platforms, but continue to give a wrong result.
@@ -805,7 +805,7 @@ range_incl_exact_iter_impl! {
805805
u8
806806
i8
807807

808-
// These are incorect per the reasoning above,
808+
// These are incorrect per the reasoning above,
809809
// but removing them would be a breaking change as they were stabilized in Rust 1.26.0.
810810
// So e.g. `(0..=u16::MAX).len()` for example will compile without error or warnings
811811
// on 16-bit platforms, but continue to give a wrong result.

core/src/num/dec2flt/number.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl Number {
4040
&& !self.many_digits
4141
}
4242

43-
/// The fast path algorithmn using machine-sized integers and floats.
43+
/// The fast path algorithm using machine-sized integers and floats.
4444
///
4545
/// This is extracted into a separate function so that it can be attempted before constructing
4646
/// a Decimal. This only works if both the mantissa and the exponent

core/src/num/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Shared utilties used by both float and integer formatting.
1+
//! Shared utilities used by both float and integer formatting.
22
#![doc(hidden)]
33
#![unstable(
44
feature = "numfmt",

core/src/slice/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl<'a, T> IterMut<'a, T> {
221221
// the length, to also allows for the fast `ptr == end` check.
222222
//
223223
// See the `next_unchecked!` and `is_empty!` macros as well as the
224-
// `post_inc_start` method for more informations.
224+
// `post_inc_start` method for more information.
225225
unsafe {
226226
assume(!ptr.is_null());
227227

0 commit comments

Comments
 (0)