Auto merge of #97600 - matthiaskrgr:rollup-yivyeu5, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #97316 (Put a bound on collection misbehavior)
 - #97578 (alloc: remove repeated word in comment)
 - #97593 (⬆️ rust-analyzer)
 - #97596 (Fixup feature name to be more consistent with others)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2022-05-31 23:24:39 +00:00
commit 6f481f8b71
8 changed files with 23 additions and 20 deletions

View File

@ -166,9 +166,10 @@
/// item's ordering relative to any other item, as determined by the [`Ord`] /// item's ordering relative to any other item, as determined by the [`Ord`]
/// trait, changes while it is in the heap. This is normally only possible /// trait, changes while it is in the heap. This is normally only possible
/// through [`Cell`], [`RefCell`], global state, I/O, or unsafe code. The /// through [`Cell`], [`RefCell`], global state, I/O, or unsafe code. The
/// behavior resulting from such a logic error is not specified (it /// behavior resulting from such a logic error is not specified, but will
/// could include panics, incorrect results, aborts, memory leaks, or /// be encapsulated to the `BinaryHeap` that observed the logic error and not
/// non-termination) but will not be undefined behavior. /// result in undefined behavior. This could include panics, incorrect results,
/// aborts, memory leaks, and non-termination.
/// ///
/// # Examples /// # Examples
/// ///

View File

@ -64,9 +64,9 @@
/// It is a logic error for a key to be modified in such a way that the key's ordering relative to /// It is a logic error for a key to be modified in such a way that the key's ordering relative to
/// any other key, as determined by the [`Ord`] trait, changes while it is in the map. This is /// any other key, as determined by the [`Ord`] trait, changes while it is in the map. This is
/// normally only possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code. /// normally only possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code.
/// The behavior resulting from such a logic error is not specified (it could include panics, /// The behavior resulting from such a logic error is not specified, but will be encapsulated to the
/// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined /// `BTreeMap` that observed the logic error and not result in undefined behavior. This could
/// behavior. /// include panics, incorrect results, aborts, memory leaks, and non-termination.
/// ///
/// Iterators obtained from functions such as [`BTreeMap::iter`], [`BTreeMap::values`], or /// Iterators obtained from functions such as [`BTreeMap::iter`], [`BTreeMap::values`], or
/// [`BTreeMap::keys`] produce their items in order by key, and take worst-case logarithmic and /// [`BTreeMap::keys`] produce their items in order by key, and take worst-case logarithmic and

View File

@ -23,9 +23,9 @@
/// It is a logic error for an item to be modified in such a way that the item's ordering relative /// It is a logic error for an item to be modified in such a way that the item's ordering relative
/// to any other item, as determined by the [`Ord`] trait, changes while it is in the set. This is /// to any other item, as determined by the [`Ord`] trait, changes while it is in the set. This is
/// normally only possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code. /// normally only possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code.
/// The behavior resulting from such a logic error is not specified (it could include panics, /// The behavior resulting from such a logic error is not specified, but will be encapsulated to the
/// incorrect results, aborts, memory leaks, or non-termination) but will not be undefined /// `BTreeSet` that observed the logic error and not result in undefined behavior. This could
/// behavior. /// include panics, incorrect results, aborts, memory leaks, and non-termination.
/// ///
/// Iterators returned by [`BTreeSet::iter`] produce their items in order, and take worst-case /// Iterators returned by [`BTreeSet::iter`] produce their items in order, and take worst-case
/// logarithmic and amortized constant time per item returned. /// logarithmic and amortized constant time per item returned.

View File

@ -2472,7 +2472,7 @@ unsafe fn spec_extend_from_within(&mut self, src: Range<usize>) {
// SAFETY: // SAFETY:
// - Both pointers are created from unique slice references (`&mut [_]`) // - Both pointers are created from unique slice references (`&mut [_]`)
// so they are valid and do not overlap. // so they are valid and do not overlap.
// - Elements are :Copy so it's OK to to copy them, without doing // - Elements are :Copy so it's OK to copy them, without doing
// anything with the original values // anything with the original values
// - `count` is equal to the len of `source`, so source is valid for // - `count` is equal to the len of `source`, so source is valid for
// `count` reads // `count` reads

View File

@ -264,7 +264,7 @@ pub const fn from_mut<T>(s: &mut T) -> &mut [T] {
/// ///
/// [valid]: ptr#safety /// [valid]: ptr#safety
#[unstable(feature = "slice_from_ptr_range", issue = "89792")] #[unstable(feature = "slice_from_ptr_range", issue = "89792")]
#[rustc_const_unstable(feature = "slice_from_mut_ptr_range_const", issue = "89792")] #[rustc_const_unstable(feature = "const_slice_from_mut_ptr_range", issue = "89792")]
pub const unsafe fn from_mut_ptr_range<'a, T>(range: Range<*mut T>) -> &'a mut [T] { pub const unsafe fn from_mut_ptr_range<'a, T>(range: Range<*mut T>) -> &'a mut [T] {
// SAFETY: the caller must uphold the safety contract for `from_mut_ptr_range`. // SAFETY: the caller must uphold the safety contract for `from_mut_ptr_range`.
unsafe { from_raw_parts_mut(range.start, range.end.sub_ptr(range.start)) } unsafe { from_raw_parts_mut(range.start, range.end.sub_ptr(range.start)) }

View File

@ -54,7 +54,8 @@
/// the [`Eq`] trait, changes while it is in the map. This is normally only /// the [`Eq`] trait, changes while it is in the map. This is normally only
/// possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code. /// possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code.
/// The behavior resulting from such a logic error is not specified, but will /// The behavior resulting from such a logic error is not specified, but will
/// not result in undefined behavior. This could include panics, incorrect results, /// be encapsulated to the `HashMap` that observed the logic error and not
/// result in undefined behavior. This could include panics, incorrect results,
/// aborts, memory leaks, and non-termination. /// aborts, memory leaks, and non-termination.
/// ///
/// The hash table implementation is a Rust port of Google's [SwissTable]. /// The hash table implementation is a Rust port of Google's [SwissTable].

View File

@ -33,13 +33,14 @@
/// In other words, if two keys are equal, their hashes must be equal. /// In other words, if two keys are equal, their hashes must be equal.
/// ///
/// ///
/// It is a logic error for an item to be modified in such a way that the /// It is a logic error for a key to be modified in such a way that the key's
/// item's hash, as determined by the [`Hash`] trait, or its equality, as /// hash, as determined by the [`Hash`] trait, or its equality, as determined by
/// determined by the [`Eq`] trait, changes while it is in the set. This is /// the [`Eq`] trait, changes while it is in the map. This is normally only
/// normally only possible through [`Cell`], [`RefCell`], global state, I/O, or /// possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code.
/// unsafe code. The behavior resulting from such a logic error is not /// The behavior resulting from such a logic error is not specified, but will
/// specified (it could include panics, incorrect results, aborts, memory /// be encapsulated to the `HashSet` that observed the logic error and not
/// leaks, or non-termination) but will not be undefined behavior. /// result in undefined behavior. This could include panics, incorrect results,
/// aborts, memory leaks, and non-termination.
/// ///
/// # Examples /// # Examples
/// ///

@ -1 +1 @@
Subproject commit 5d5bbec9b60010dd7389a084c56693baf6bda780 Subproject commit f94fa62d69faf5bd63b3772d3ec4f0c76cf2db57