Skip to content

Commit 3b4797c

Browse files
committed
Auto merge of rust-lang#76153 - matklad:rollup-vlblfup, r=matklad
Rollup of 9 pull requests Successful merges: - rust-lang#75969 (Switch to intra-doc links in core/src/{convert,iter}/mod.rs) - rust-lang#76023 (Liballoc extend use intra doc link) - rust-lang#76033 (Add missing hyphen) - rust-lang#76052 (rust-langGH-66816: Remove disable attr before return) - rust-lang#76055 (Keep doc standard for Vec DrainFilter) - rust-lang#76058 (Use assertions on Vec doc) - rust-lang#76069 (Use explicit intra-doc link in path for Vec resize) - rust-lang#76117 (Update README.md) - rust-lang#76134 (Update MinGW instructions to include ninja) Failed merges: r? @ghost
2 parents 8bfe289 + bd91b08 commit 3b4797c

File tree

7 files changed

+46
-65
lines changed

7 files changed

+46
-65
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ build.
112112
# Install build tools needed for Rust. If you're building a 32-bit compiler,
113113
# then replace "x86_64" below with "i686". If you've already got git, python,
114114
# or CMake installed and in PATH you can remove them from this list. Note
115-
# that it is important that you do **not** use the 'python2' and 'cmake'
115+
# that it is important that you do **not** use the 'python2', 'cmake' and 'ninja'
116116
# packages from the 'msys2' subsystem. The build has historically been known
117117
# to fail with these packages.
118118
$ pacman -S git \
@@ -121,7 +121,8 @@ build.
121121
tar \
122122
mingw-w64-x86_64-python \
123123
mingw-w64-x86_64-cmake \
124-
mingw-w64-x86_64-gcc
124+
mingw-w64-x86_64-gcc \
125+
mingw-w64-x86_64-ninja
125126
```
126127
127128
4. Navigate to Rust's source code (or clone it), then build it:

library/alloc/src/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ macro_rules! acquire {
111111
///
112112
/// # Cloning references
113113
///
114-
/// Creating a new reference from an existing reference counted pointer is done using the
114+
/// Creating a new reference from an existing reference-counted pointer is done using the
115115
/// `Clone` trait implemented for [`Arc<T>`][Arc] and [`Weak<T>`][Weak].
116116
///
117117
/// ```

library/alloc/src/vec.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ use crate::raw_vec::RawVec;
114114
/// assert_eq!(vec, [0, 0, 0, 0, 0]);
115115
///
116116
/// // The following is equivalent, but potentially slower:
117-
/// let mut vec1 = Vec::with_capacity(5);
118-
/// vec1.resize(5, 0);
117+
/// let mut vec = Vec::with_capacity(5);
118+
/// vec.resize(5, 0);
119+
/// assert_eq!(vec, [0, 0, 0, 0, 0]);
119120
/// ```
120121
///
121122
/// Use a `Vec<T>` as an efficient stack:
@@ -1565,7 +1566,7 @@ impl<T: Clone> Vec<T> {
15651566
/// This method requires `T` to implement [`Clone`],
15661567
/// in order to be able to clone the passed value.
15671568
/// If you need more flexibility (or want to rely on [`Default`] instead of
1568-
/// [`Clone`]), use [`resize_with`].
1569+
/// [`Clone`]), use [`Vec::resize_with`].
15691570
///
15701571
/// # Examples
15711572
///
@@ -1578,8 +1579,6 @@ impl<T: Clone> Vec<T> {
15781579
/// vec.resize(2, 0);
15791580
/// assert_eq!(vec, [1, 2]);
15801581
/// ```
1581-
///
1582-
/// [`resize_with`]: Vec::resize_with
15831582
#[stable(feature = "vec_resize", since = "1.5.0")]
15841583
pub fn resize(&mut self, new_len: usize, value: T) {
15851584
let len = self.len();
@@ -1609,7 +1608,7 @@ impl<T: Clone> Vec<T> {
16091608
/// assert_eq!(vec, [1, 2, 3, 4]);
16101609
/// ```
16111610
///
1612-
/// [`extend`]: #method.extend
1611+
/// [`extend`]: Vec::extend
16131612
#[stable(feature = "vec_extend_from_slice", since = "1.6.0")]
16141613
pub fn extend_from_slice(&mut self, other: &[T]) {
16151614
self.spec_extend(other.iter())
@@ -3024,7 +3023,10 @@ impl<T> Drain<'_, T> {
30243023
}
30253024
}
30263025

3027-
/// An iterator produced by calling `drain_filter` on Vec.
3026+
/// An iterator which uses a closure to determine if an element should be removed.
3027+
///
3028+
/// This struct is created by [`Vec::drain_filter`].
3029+
/// See its documentation for more.
30283030
#[unstable(feature = "drain_filter", reason = "recently added", issue = "43244")]
30293031
#[derive(Debug)]
30303032
pub struct DrainFilter<'a, T, F>

library/core/src/convert/mod.rs

+14-38
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@
3131
//! `into` themselves and `from` themselves
3232
//!
3333
//! See each trait for usage examples.
34-
//!
35-
//! [`Into`]: trait.Into.html
36-
//! [`From`]: trait.From.html
37-
//! [`TryFrom`]: trait.TryFrom.html
38-
//! [`TryInto`]: trait.TryInto.html
39-
//! [`AsRef`]: trait.AsRef.html
40-
//! [`AsMut`]: trait.AsMut.html
4134
4235
#![stable(feature = "rust1", since = "1.0.0")]
4336

@@ -141,13 +134,11 @@ pub const fn identity<T>(x: T) -> T {
141134
/// want to accept all references that can be converted to [`&str`] as an argument.
142135
/// Since both [`String`] and [`&str`] implement `AsRef<str>` we can accept both as input argument.
143136
///
144-
/// [`Option<T>`]: ../../std/option/enum.Option.html
145-
/// [`Result<T, E>`]: ../../std/result/enum.Result.html
146-
/// [`Borrow`]: ../../std/borrow/trait.Borrow.html
147-
/// [`Hash`]: ../../std/hash/trait.Hash.html
148-
/// [`Eq`]: ../../std/cmp/trait.Eq.html
149-
/// [`Ord`]: ../../std/cmp/trait.Ord.html
150-
/// [`&str`]: ../../std/primitive.str.html
137+
/// [`Option<T>`]: Option
138+
/// [`Result<T, E>`]: Result
139+
/// [`Borrow`]: crate::borrow::Borrow
140+
/// [`Eq`]: crate::cmp::Eq
141+
/// [`Ord`]: crate::cmp::Ord
151142
/// [`String`]: ../../std/string/struct.String.html
152143
///
153144
/// ```
@@ -177,8 +168,8 @@ pub trait AsRef<T: ?Sized> {
177168
/// **Note: This trait must not fail**. If the conversion can fail, use a
178169
/// dedicated method which returns an [`Option<T>`] or a [`Result<T, E>`].
179170
///
180-
/// [`Option<T>`]: ../../std/option/enum.Option.html
181-
/// [`Result<T, E>`]: ../../std/result/enum.Result.html
171+
/// [`Option<T>`]: Option
172+
/// [`Result<T, E>`]: Result
182173
///
183174
/// # Generic Implementations
184175
///
@@ -278,12 +269,9 @@ pub trait AsMut<T: ?Sized> {
278269
/// is_hello(s);
279270
/// ```
280271
///
281-
/// [`TryInto`]: trait.TryInto.html
282-
/// [`Option<T>`]: ../../std/option/enum.Option.html
283-
/// [`Result<T, E>`]: ../../std/result/enum.Result.html
272+
/// [`Option<T>`]: Option
273+
/// [`Result<T, E>`]: Result
284274
/// [`String`]: ../../std/string/struct.String.html
285-
/// [`From`]: trait.From.html
286-
/// [`Into`]: trait.Into.html
287275
/// [`Vec`]: ../../std/vec/struct.Vec.html
288276
#[stable(feature = "rust1", since = "1.0.0")]
289277
pub trait Into<T>: Sized {
@@ -370,12 +358,10 @@ pub trait Into<T>: Sized {
370358
/// }
371359
/// ```
372360
///
373-
/// [`TryFrom`]: trait.TryFrom.html
374-
/// [`Option<T>`]: ../../std/option/enum.Option.html
375-
/// [`Result<T, E>`]: ../../std/result/enum.Result.html
361+
/// [`Option<T>`]: Option
362+
/// [`Result<T, E>`]: Result
376363
/// [`String`]: ../../std/string/struct.String.html
377-
/// [`Into`]: trait.Into.html
378-
/// [`from`]: trait.From.html#tymethod.from
364+
/// [`from`]: From::from
379365
/// [book]: ../../book/ch09-00-error-handling.html
380366
#[rustc_diagnostic_item = "from_trait"]
381367
#[stable(feature = "rust1", since = "1.0.0")]
@@ -404,9 +390,6 @@ pub trait From<T>: Sized {
404390
///
405391
/// This suffers the same restrictions and reasoning as implementing
406392
/// [`Into`], see there for details.
407-
///
408-
/// [`TryFrom`]: trait.TryFrom.html
409-
/// [`Into`]: trait.Into.html
410393
#[stable(feature = "try_from", since = "1.34.0")]
411394
pub trait TryInto<T>: Sized {
412395
/// The type returned in the event of a conversion error.
@@ -485,11 +468,9 @@ pub trait TryInto<T>: Sized {
485468
/// assert!(try_successful_smaller_number.is_ok());
486469
/// ```
487470
///
488-
/// [`try_from`]: trait.TryFrom.html#tymethod.try_from
489-
/// [`TryInto`]: trait.TryInto.html
490-
/// [`i32::MAX`]: ../../std/i32/constant.MAX.html
471+
/// [`i32::MAX`]: crate::i32::MAX
472+
/// [`try_from`]: TryFrom::try_from
491473
/// [`!`]: ../../std/primitive.never.html
492-
/// [`Infallible`]: enum.Infallible.html
493474
#[stable(feature = "try_from", since = "1.34.0")]
494475
pub trait TryFrom<T>: Sized {
495476
/// The type returned in the event of a conversion error.
@@ -676,7 +657,6 @@ impl AsRef<str> for str {
676657
///
677658
/// … and eventually deprecate `Infallible`.
678659
///
679-
///
680660
/// However there is one case where `!` syntax can be used
681661
/// before `!` is stabilized as a full-fledged type: in the position of a function’s return type.
682662
/// Specifically, it is possible implementations for two different function pointer types:
@@ -692,10 +672,6 @@ impl AsRef<str> for str {
692672
/// the two `impl`s will start to overlap
693673
/// and therefore will be disallowed by the language’s trait coherence rules.
694674
///
695-
/// [`Ok`]: ../result/enum.Result.html#variant.Ok
696-
/// [`Result`]: ../result/enum.Result.html
697-
/// [`TryFrom`]: trait.TryFrom.html
698-
/// [`Into`]: trait.Into.html
699675
/// [never]: ../../std/primitive.never.html
700676
#[stable(feature = "convert_infallible", since = "1.34.0")]
701677
#[derive(Copy)]

library/core/src/iter/mod.rs

+10-12
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@
5454
//! below for more details.
5555
//!
5656
//! [`Some(Item)`]: Some
57-
//! [`Iterator`]: trait.Iterator.html
58-
//! [`next`]: trait.Iterator.html#tymethod.next
57+
//! [`next`]: Iterator::next
5958
//! [`TryIter`]: ../../std/sync/mpsc/struct.TryIter.html
6059
//!
6160
//! # The three forms of iteration
@@ -159,8 +158,7 @@
159158
//! Let's take a look at that `for` loop again, and what the compiler converts
160159
//! it into:
161160
//!
162-
//! [`IntoIterator`]: trait.IntoIterator.html
163-
//! [`into_iter`]: trait.IntoIterator.html#tymethod.into_iter
161+
//! [`into_iter`]: IntoIterator::into_iter
164162
//!
165163
//! ```
166164
//! let values = vec![1, 2, 3, 4, 5];
@@ -222,9 +220,9 @@
222220
//! across versions of Rust, so you should avoid relying on the exact values
223221
//! returned by an iterator which panicked.
224222
//!
225-
//! [`map`]: trait.Iterator.html#method.map
226-
//! [`take`]: trait.Iterator.html#method.take
227-
//! [`filter`]: trait.Iterator.html#method.filter
223+
//! [`map`]: Iterator::map
224+
//! [`take`]: Iterator::take
225+
//! [`filter`]: Iterator::filter
228226
//!
229227
//! # Laziness
230228
//!
@@ -261,13 +259,13 @@
261259
//! }
262260
//! ```
263261
//!
264-
//! [`map`]: trait.Iterator.html#method.map
265-
//! [`for_each`]: trait.Iterator.html#method.for_each
262+
//! [`map`]: Iterator::map
263+
//! [`for_each`]: Iterator::for_each
266264
//!
267265
//! Another common way to evaluate an iterator is to use the [`collect`]
268266
//! method to produce a new collection.
269267
//!
270-
//! [`collect`]: trait.Iterator.html#method.collect
268+
//! [`collect`]: Iterator::collect
271269
//!
272270
//! # Infinity
273271
//!
@@ -305,8 +303,8 @@
305303
//! println!("The smallest number one is {}.", least);
306304
//! ```
307305
//!
308-
//! [`take`]: trait.Iterator.html#method.take
309-
//! [`min`]: trait.Iterator.html#method.min
306+
//! [`take`]: Iterator::take
307+
//! [`min`]: Iterator::min
310308
311309
#![stable(feature = "rust1", since = "1.0.0")]
312310

src/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
This directory contains the source code of the rust project, including:
2-
- `rustc` and its tests
2+
- The test suite
33
- The bootstrapping build system
44
- Various submodules for tools, like rustdoc, rls, etc.
55

src/librustdoc/html/static/main.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -2740,10 +2740,17 @@ function defocusSearchBar() {
27402740
});
27412741
}
27422742

2743+
function enableSearchInput() {
2744+
if (search_input) {
2745+
search_input.removeAttribute('disabled');
2746+
}
2747+
}
2748+
27432749
window.addSearchOptions = function(crates) {
27442750
var elem = document.getElementById("crate-search");
27452751

27462752
if (!elem) {
2753+
enableSearchInput();
27472754
return;
27482755
}
27492756
var crates_text = [];
@@ -2781,10 +2788,7 @@ function defocusSearchBar() {
27812788
elem.value = savedCrate;
27822789
}
27832790
}
2784-
2785-
if (search_input) {
2786-
search_input.removeAttribute('disabled');
2787-
}
2791+
enableSearchInput();
27882792
};
27892793

27902794
function buildHelperPopup() {

0 commit comments

Comments
 (0)