Skip to content

Commit 4da89a1

Browse files
committed
Auto merge of #89262 - Manishearth:rollup-vtkbetm, r=Manishearth
Rollup of 7 pull requests Successful merges: - #88895 (rustdoc: Cleanup `clean` part 2) - #88973 (Expose the std_detect env_override feature) - #89010 (Add some intra doc links) - #89198 (rustdoc: Don't show hidden trait methods) - #89216 (Consistent big O notation) - #89224 (Change the order of imports suggestions) - #89256 (Fix typo in release notes) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents addb4da + 7d9a0e5 commit 4da89a1

File tree

30 files changed

+207
-117
lines changed

30 files changed

+207
-117
lines changed

RELEASES.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Compiler
1717

1818
- [Upgrade to LLVM 13.][rust#87570]
1919
- [Support memory, address, and thread sanitizers on aarch64-unknown-freebsd.][rust#88023]
20-
- [Allow specifying an deployment target version for all iOS targets][rust#87699]
20+
- [Allow specifying a deployment target version for all iOS targets][rust#87699]
2121
- [Warnings can be forced on with `--force-warn`.][rust#87472]
2222
This feature is primarily intended for usage by `cargo fix`, rather than end users.
2323
- [Promote `aarch64-apple-ios-sim` to Tier 2\*.][rust#87760]
@@ -5170,7 +5170,7 @@ Libraries
51705170
- [Upgrade to Unicode 10.0.0][42999]
51715171
- [Reimplemented `{f32, f64}::{min, max}` in Rust instead of using CMath.][42430]
51725172
- [Skip the main thread's manual stack guard on Linux][43072]
5173-
- [Iterator::nth for `ops::{Range, RangeFrom}` is now done in O(1) time][43077]
5173+
- [Iterator::nth for `ops::{Range, RangeFrom}` is now done in *O*(1) time][43077]
51745174
- [`#[repr(align(N))]` attribute max number is now 2^31 - 1.][43097] This was
51755175
previously 2^15.
51765176
- [`{OsStr, Path}::Display` now avoids allocations where possible][42613]
@@ -8473,7 +8473,7 @@ Libraries
84738473
algorithm][s].
84748474
* [`std::io::copy` allows `?Sized` arguments][cc].
84758475
* The `Windows`, `Chunks`, and `ChunksMut` iterators over slices all
8476-
[override `count`, `nth` and `last` with an O(1)
8476+
[override `count`, `nth` and `last` with an *O*(1)
84778477
implementation][it].
84788478
* [`Default` is implemented for arrays up to `[T; 32]`][d].
84798479
* [`IntoRawFd` has been added to the Unix-specific prelude,
@@ -8995,7 +8995,7 @@ Libraries
89958995
* The `Default` implementation for `Arc` [no longer requires `Sync +
89968996
Send`][arc].
89978997
* [The `Iterator` methods `count`, `nth`, and `last` have been
8998-
overridden for slices to have O(1) performance instead of O(n)][si].
8998+
overridden for slices to have *O*(1) performance instead of *O*(*n*)][si].
89998999
* Incorrect handling of paths on Windows has been improved in both the
90009000
compiler and the standard library.
90019001
* [`AtomicPtr` gained a `Default` implementation][ap].

compiler/rustc_data_structures/src/graph/scc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Also computes as the resulting DAG if each SCC is replaced with a
44
//! node in the graph. This uses [Tarjan's algorithm](
55
//! https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm)
6-
//! that completes in *O(n)* time.
6+
//! that completes in *O*(*n*) time.
77
88
use crate::fx::FxHashSet;
99
use crate::graph::vec_graph::VecGraph;

compiler/rustc_data_structures/src/sorted_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mod index_map;
99
pub use index_map::SortedIndexMultiMap;
1010

1111
/// `SortedMap` is a data structure with similar characteristics as BTreeMap but
12-
/// slightly different trade-offs: lookup, insertion, and removal are O(log(N))
12+
/// slightly different trade-offs: lookup, insertion, and removal are *O*(log(*n*))
1313
/// and elements can be iterated in order cheaply.
1414
///
1515
/// `SortedMap` can be faster than a `BTreeMap` for small sizes (<50) since it

compiler/rustc_resolve/src/diagnostics.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,6 +1706,9 @@ crate fn show_candidates(
17061706
candidates.iter().map(|c| path_names_to_string(&c.path)).collect();
17071707

17081708
path_strings.sort();
1709+
let core_path_strings =
1710+
path_strings.drain_filter(|p| p.starts_with("core::")).collect::<Vec<String>>();
1711+
path_strings.extend(core_path_strings);
17091712
path_strings.dedup();
17101713

17111714
let (determiner, kind) = if candidates.len() == 1 {

compiler/rustc_resolve/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1212
#![feature(box_patterns)]
13+
#![feature(drain_filter)]
1314
#![feature(bool_to_option)]
1415
#![feature(crate_visibility_modifier)]
1516
#![feature(format_args_capture)]

library/alloc/src/collections/binary_heap.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Insertion and popping the largest element have *O*(log(*n*)) time complexity.
44
//! Checking the largest element is *O*(1). Converting a vector to a binary heap
55
//! can be done in-place, and has *O*(*n*) complexity. A binary heap can also be
6-
//! converted to a sorted vector in-place, allowing it to be used for an *O*(*n* \* log(*n*))
6+
//! converted to a sorted vector in-place, allowing it to be used for an *O*(*n* * log(*n*))
77
//! in-place heapsort.
88
//!
99
//! # Examples
@@ -159,9 +159,9 @@ use super::SpecExtend;
159159
/// This will be a max-heap.
160160
///
161161
/// It is a logic error for an item to be modified in such a way that the
162-
/// item's ordering relative to any other item, as determined by the `Ord`
162+
/// item's ordering relative to any other item, as determined by the [`Ord`]
163163
/// trait, changes while it is in the heap. This is normally only possible
164-
/// through `Cell`, `RefCell`, global state, I/O, or unsafe code. The
164+
/// through [`Cell`], [`RefCell`], global state, I/O, or unsafe code. The
165165
/// behavior resulting from such a logic error is not specified, but will
166166
/// not result in undefined behavior. This could include panics, incorrect
167167
/// results, aborts, memory leaks, and non-termination.
@@ -219,7 +219,7 @@ use super::SpecExtend;
219219
///
220220
/// ## Min-heap
221221
///
222-
/// Either `std::cmp::Reverse` or a custom `Ord` implementation can be used to
222+
/// Either [`core::cmp::Reverse`] or a custom [`Ord`] implementation can be used to
223223
/// make `BinaryHeap` a min-heap. This makes `heap.pop()` return the smallest
224224
/// value instead of the greatest one.
225225
///
@@ -243,13 +243,17 @@ use super::SpecExtend;
243243
///
244244
/// # Time complexity
245245
///
246-
/// | [push] | [pop] | [peek]/[peek\_mut] |
247-
/// |--------|-----------|--------------------|
248-
/// | O(1)~ | *O*(log(*n*)) | *O*(1) |
246+
/// | [push] | [pop] | [peek]/[peek\_mut] |
247+
/// |---------|---------------|--------------------|
248+
/// | *O*(1)~ | *O*(log(*n*)) | *O*(1) |
249249
///
250250
/// The value for `push` is an expected cost; the method documentation gives a
251251
/// more detailed analysis.
252252
///
253+
/// [`core::cmp::Reverse`]: core::cmp::Reverse
254+
/// [`Ord`]: core::cmp::Ord
255+
/// [`Cell`]: core::cell::Cell
256+
/// [`RefCell`]: core::cell::RefCell
253257
/// [push]: BinaryHeap::push
254258
/// [pop]: BinaryHeap::pop
255259
/// [peek]: BinaryHeap::peek
@@ -1255,9 +1259,10 @@ impl<T> FusedIterator for Iter<'_, T> {}
12551259
/// An owning iterator over the elements of a `BinaryHeap`.
12561260
///
12571261
/// This `struct` is created by [`BinaryHeap::into_iter()`]
1258-
/// (provided by the `IntoIterator` trait). See its documentation for more.
1262+
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
12591263
///
12601264
/// [`into_iter`]: BinaryHeap::into_iter
1265+
/// [`IntoIterator`]: core::iter::IntoIterator
12611266
#[stable(feature = "rust1", since = "1.0.0")]
12621267
#[derive(Clone)]
12631268
pub struct IntoIter<T> {

library/alloc/src/collections/btree/map.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,10 @@ impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for IterMut<'_, K, V> {
326326
/// An owning iterator over the entries of a `BTreeMap`.
327327
///
328328
/// This `struct` is created by the [`into_iter`] method on [`BTreeMap`]
329-
/// (provided by the `IntoIterator` trait). See its documentation for more.
329+
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
330330
///
331331
/// [`into_iter`]: IntoIterator::into_iter
332+
/// [`IntoIterator`]: core::iter::IntoIterator
332333
#[stable(feature = "rust1", since = "1.0.0")]
333334
pub struct IntoIter<K, V> {
334335
range: LazyLeafRange<marker::Dying, K, V>,

library/alloc/src/collections/btree/set.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ impl<T: fmt::Debug> fmt::Debug for Iter<'_, T> {
107107
/// An owning iterator over the items of a `BTreeSet`.
108108
///
109109
/// This `struct` is created by the [`into_iter`] method on [`BTreeSet`]
110-
/// (provided by the `IntoIterator` trait). See its documentation for more.
110+
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
111111
///
112112
/// [`into_iter`]: BTreeSet#method.into_iter
113+
/// [`IntoIterator`]: core::iter::IntoIterator
113114
#[stable(feature = "rust1", since = "1.0.0")]
114115
#[derive(Debug)]
115116
pub struct IntoIter<T> {

library/alloc/src/collections/linked_list.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ mod tests;
3838
/// let list = LinkedList::from([1, 2, 3]);
3939
/// ```
4040
///
41-
/// NOTE: It is almost always better to use `Vec` or `VecDeque` because
41+
/// NOTE: It is almost always better to use [`Vec`] or [`VecDeque`] because
4242
/// array-based containers are generally faster,
4343
/// more memory efficient, and make better use of CPU cache.
44+
///
45+
/// [`Vec`]: crate::vec::Vec
46+
/// [`VecDeque`]: super::vec_deque::VecDeque
4447
#[stable(feature = "rust1", since = "1.0.0")]
4548
#[cfg_attr(not(test), rustc_diagnostic_item = "LinkedList")]
4649
pub struct LinkedList<T> {
@@ -121,9 +124,10 @@ impl<T: fmt::Debug> fmt::Debug for IterMut<'_, T> {
121124
/// An owning iterator over the elements of a `LinkedList`.
122125
///
123126
/// This `struct` is created by the [`into_iter`] method on [`LinkedList`]
124-
/// (provided by the `IntoIterator` trait). See its documentation for more.
127+
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
125128
///
126129
/// [`into_iter`]: LinkedList::into_iter
130+
/// [`IntoIterator`]: core::iter::IntoIterator
127131
#[derive(Clone)]
128132
#[stable(feature = "rust1", since = "1.0.0")]
129133
pub struct IntoIter<T> {

library/alloc/src/collections/vec_deque/into_iter.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ use super::VecDeque;
88
/// An owning iterator over the elements of a `VecDeque`.
99
///
1010
/// This `struct` is created by the [`into_iter`] method on [`VecDeque`]
11-
/// (provided by the `IntoIterator` trait). See its documentation for more.
11+
/// (provided by the [`IntoIterator`] trait). See its documentation for more.
1212
///
1313
/// [`into_iter`]: VecDeque::into_iter
14+
/// [`IntoIterator`]: core::iter::IntoIterator
1415
#[derive(Clone)]
1516
#[stable(feature = "rust1", since = "1.0.0")]
1617
pub struct IntoIter<

0 commit comments

Comments
 (0)