Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #76153

Merged
merged 26 commits into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2d6ab12
Liballoc extend use intra doc link
pickfire Aug 28, 2020
7be129e
Add missing hyphen
camelid Aug 28, 2020
c7e428e
Liballoc vec doc use associated function
pickfire Aug 29, 2020
7ee5155
GH-66816: Removes disable before return
aszenz Aug 29, 2020
eb2bb99
GH-66816: Process before enabling search
aszenz Aug 29, 2020
d504d55
Keep doc standard for Vec DrainFilter
pickfire Aug 29, 2020
d727442
Remove brackets in drain filter docs
pickfire Aug 29, 2020
12b4cf8
Use assertions on Vec doc
pickfire Aug 29, 2020
237c500
Use explicit intra-doc link in path for Vec resize
pickfire Aug 29, 2020
be8b5eb
Reuse description from drain_filter
pickfire Aug 29, 2020
2d1ab83
Remove empty vec assertion flow distrupt
pickfire Aug 29, 2020
8a92718
Switch to intra-doc links in core/src/{convert,iter}/mod.rs
nixphix Aug 27, 2020
01d95f2
resolve comments
nixphix Aug 27, 2020
7ea4c28
add i32::MAX link
nixphix Aug 30, 2020
523fea4
revert Some(Item) link
nixphix Aug 30, 2020
0175c43
Update README.md
mark-i-m Aug 30, 2020
00d459a
Update MinGW instructions to include ninja
CDirkx Aug 30, 2020
c601714
Rollup merge of #75969 - nixphix:docs/mod, r=jyn514
matklad Aug 31, 2020
e59eb4e
Rollup merge of #76023 - pickfire:patch-4, r=jyn514
matklad Aug 31, 2020
6ce3243
Rollup merge of #76033 - camelid:patch-7, r=Dylan-DPC
matklad Aug 31, 2020
300d7f6
Rollup merge of #76052 - aszenz:GH-66816_removes_disable_attribute_be…
matklad Aug 31, 2020
af1f46c
Rollup merge of #76055 - pickfire:patch-9, r=jyn514
matklad Aug 31, 2020
d829a5b
Rollup merge of #76058 - pickfire:patch-11, r=jyn514
matklad Aug 31, 2020
13c4f04
Rollup merge of #76069 - pickfire:patch-16, r=jyn514
matklad Aug 31, 2020
f848174
Rollup merge of #76117 - mark-i-m:patch-1, r=petrochenkov
matklad Aug 31, 2020
bd91b08
Rollup merge of #76134 - CDirkx:patch-1, r=nagisa
matklad Aug 31, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ build.
# Install build tools needed for Rust. If you're building a 32-bit compiler,
# then replace "x86_64" below with "i686". If you've already got git, python,
# or CMake installed and in PATH you can remove them from this list. Note
# that it is important that you do **not** use the 'python2' and 'cmake'
# that it is important that you do **not** use the 'python2', 'cmake' and 'ninja'
# packages from the 'msys2' subsystem. The build has historically been known
# to fail with these packages.
$ pacman -S git \
Expand All @@ -121,7 +121,8 @@ build.
tar \
mingw-w64-x86_64-python \
mingw-w64-x86_64-cmake \
mingw-w64-x86_64-gcc
mingw-w64-x86_64-gcc \
mingw-w64-x86_64-ninja
```

4. Navigate to Rust's source code (or clone it), then build it:
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ macro_rules! acquire {
///
/// # Cloning references
///
/// Creating a new reference from an existing reference counted pointer is done using the
/// Creating a new reference from an existing reference-counted pointer is done using the
/// `Clone` trait implemented for [`Arc<T>`][Arc] and [`Weak<T>`][Weak].
///
/// ```
Expand Down
16 changes: 9 additions & 7 deletions library/alloc/src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ use crate::raw_vec::RawVec;
/// assert_eq!(vec, [0, 0, 0, 0, 0]);
///
/// // The following is equivalent, but potentially slower:
/// let mut vec1 = Vec::with_capacity(5);
/// vec1.resize(5, 0);
/// let mut vec = Vec::with_capacity(5);
/// vec.resize(5, 0);
/// assert_eq!(vec, [0, 0, 0, 0, 0]);
/// ```
///
/// Use a `Vec<T>` as an efficient stack:
Expand Down Expand Up @@ -1565,7 +1566,7 @@ impl<T: Clone> Vec<T> {
/// This method requires `T` to implement [`Clone`],
/// in order to be able to clone the passed value.
/// If you need more flexibility (or want to rely on [`Default`] instead of
/// [`Clone`]), use [`resize_with`].
/// [`Clone`]), use [`Vec::resize_with`].
///
/// # Examples
///
Expand All @@ -1578,8 +1579,6 @@ impl<T: Clone> Vec<T> {
/// vec.resize(2, 0);
/// assert_eq!(vec, [1, 2]);
/// ```
///
/// [`resize_with`]: Vec::resize_with
#[stable(feature = "vec_resize", since = "1.5.0")]
pub fn resize(&mut self, new_len: usize, value: T) {
let len = self.len();
Expand Down Expand Up @@ -1609,7 +1608,7 @@ impl<T: Clone> Vec<T> {
/// assert_eq!(vec, [1, 2, 3, 4]);
/// ```
///
/// [`extend`]: #method.extend
/// [`extend`]: Vec::extend
#[stable(feature = "vec_extend_from_slice", since = "1.6.0")]
pub fn extend_from_slice(&mut self, other: &[T]) {
self.spec_extend(other.iter())
Expand Down Expand Up @@ -3024,7 +3023,10 @@ impl<T> Drain<'_, T> {
}
}

/// An iterator produced by calling `drain_filter` on Vec.
/// An iterator which uses a closure to determine if an element should be removed.
///
/// This struct is created by [`Vec::drain_filter`].
/// See its documentation for more.
#[unstable(feature = "drain_filter", reason = "recently added", issue = "43244")]
#[derive(Debug)]
pub struct DrainFilter<'a, T, F>
Expand Down
52 changes: 14 additions & 38 deletions library/core/src/convert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@
//! `into` themselves and `from` themselves
//!
//! See each trait for usage examples.
//!
//! [`Into`]: trait.Into.html
//! [`From`]: trait.From.html
//! [`TryFrom`]: trait.TryFrom.html
//! [`TryInto`]: trait.TryInto.html
//! [`AsRef`]: trait.AsRef.html
//! [`AsMut`]: trait.AsMut.html

#![stable(feature = "rust1", since = "1.0.0")]

Expand Down Expand Up @@ -141,13 +134,11 @@ pub const fn identity<T>(x: T) -> T {
/// want to accept all references that can be converted to [`&str`] as an argument.
/// Since both [`String`] and [`&str`] implement `AsRef<str>` we can accept both as input argument.
///
/// [`Option<T>`]: ../../std/option/enum.Option.html
/// [`Result<T, E>`]: ../../std/result/enum.Result.html
/// [`Borrow`]: ../../std/borrow/trait.Borrow.html
/// [`Hash`]: ../../std/hash/trait.Hash.html
/// [`Eq`]: ../../std/cmp/trait.Eq.html
/// [`Ord`]: ../../std/cmp/trait.Ord.html
/// [`&str`]: ../../std/primitive.str.html
/// [`Option<T>`]: Option
/// [`Result<T, E>`]: Result
/// [`Borrow`]: crate::borrow::Borrow
/// [`Eq`]: crate::cmp::Eq
/// [`Ord`]: crate::cmp::Ord
/// [`String`]: ../../std/string/struct.String.html
///
/// ```
Expand Down Expand Up @@ -177,8 +168,8 @@ pub trait AsRef<T: ?Sized> {
/// **Note: This trait must not fail**. If the conversion can fail, use a
/// dedicated method which returns an [`Option<T>`] or a [`Result<T, E>`].
///
/// [`Option<T>`]: ../../std/option/enum.Option.html
/// [`Result<T, E>`]: ../../std/result/enum.Result.html
/// [`Option<T>`]: Option
/// [`Result<T, E>`]: Result
///
/// # Generic Implementations
///
Expand Down Expand Up @@ -278,12 +269,9 @@ pub trait AsMut<T: ?Sized> {
/// is_hello(s);
/// ```
///
/// [`TryInto`]: trait.TryInto.html
/// [`Option<T>`]: ../../std/option/enum.Option.html
/// [`Result<T, E>`]: ../../std/result/enum.Result.html
/// [`Option<T>`]: Option
/// [`Result<T, E>`]: Result
/// [`String`]: ../../std/string/struct.String.html
/// [`From`]: trait.From.html
/// [`Into`]: trait.Into.html
/// [`Vec`]: ../../std/vec/struct.Vec.html
#[stable(feature = "rust1", since = "1.0.0")]
pub trait Into<T>: Sized {
Expand Down Expand Up @@ -370,12 +358,10 @@ pub trait Into<T>: Sized {
/// }
/// ```
///
/// [`TryFrom`]: trait.TryFrom.html
/// [`Option<T>`]: ../../std/option/enum.Option.html
/// [`Result<T, E>`]: ../../std/result/enum.Result.html
/// [`Option<T>`]: Option
/// [`Result<T, E>`]: Result
/// [`String`]: ../../std/string/struct.String.html
/// [`Into`]: trait.Into.html
/// [`from`]: trait.From.html#tymethod.from
/// [`from`]: From::from
/// [book]: ../../book/ch09-00-error-handling.html
#[rustc_diagnostic_item = "from_trait"]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -404,9 +390,6 @@ pub trait From<T>: Sized {
///
/// This suffers the same restrictions and reasoning as implementing
/// [`Into`], see there for details.
///
/// [`TryFrom`]: trait.TryFrom.html
/// [`Into`]: trait.Into.html
#[stable(feature = "try_from", since = "1.34.0")]
pub trait TryInto<T>: Sized {
/// The type returned in the event of a conversion error.
Expand Down Expand Up @@ -485,11 +468,9 @@ pub trait TryInto<T>: Sized {
/// assert!(try_successful_smaller_number.is_ok());
/// ```
///
/// [`try_from`]: trait.TryFrom.html#tymethod.try_from
/// [`TryInto`]: trait.TryInto.html
/// [`i32::MAX`]: ../../std/i32/constant.MAX.html
/// [`i32::MAX`]: crate::i32::MAX
/// [`try_from`]: TryFrom::try_from
/// [`!`]: ../../std/primitive.never.html
/// [`Infallible`]: enum.Infallible.html
#[stable(feature = "try_from", since = "1.34.0")]
pub trait TryFrom<T>: Sized {
/// The type returned in the event of a conversion error.
Expand Down Expand Up @@ -676,7 +657,6 @@ impl AsRef<str> for str {
///
/// … and eventually deprecate `Infallible`.
///
///
/// However there is one case where `!` syntax can be used
/// before `!` is stabilized as a full-fledged type: in the position of a function’s return type.
/// Specifically, it is possible implementations for two different function pointer types:
Expand All @@ -692,10 +672,6 @@ impl AsRef<str> for str {
/// the two `impl`s will start to overlap
/// and therefore will be disallowed by the language’s trait coherence rules.
///
/// [`Ok`]: ../result/enum.Result.html#variant.Ok
/// [`Result`]: ../result/enum.Result.html
/// [`TryFrom`]: trait.TryFrom.html
/// [`Into`]: trait.Into.html
/// [never]: ../../std/primitive.never.html
#[stable(feature = "convert_infallible", since = "1.34.0")]
#[derive(Copy)]
Expand Down
22 changes: 10 additions & 12 deletions library/core/src/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@
//! below for more details.
//!
//! [`Some(Item)`]: Some
//! [`Iterator`]: trait.Iterator.html
//! [`next`]: trait.Iterator.html#tymethod.next
//! [`next`]: Iterator::next
//! [`TryIter`]: ../../std/sync/mpsc/struct.TryIter.html
//!
//! # The three forms of iteration
Expand Down Expand Up @@ -159,8 +158,7 @@
//! Let's take a look at that `for` loop again, and what the compiler converts
//! it into:
//!
//! [`IntoIterator`]: trait.IntoIterator.html
//! [`into_iter`]: trait.IntoIterator.html#tymethod.into_iter
//! [`into_iter`]: IntoIterator::into_iter
//!
//! ```
//! let values = vec![1, 2, 3, 4, 5];
Expand Down Expand Up @@ -222,9 +220,9 @@
//! across versions of Rust, so you should avoid relying on the exact values
//! returned by an iterator which panicked.
//!
//! [`map`]: trait.Iterator.html#method.map
//! [`take`]: trait.Iterator.html#method.take
//! [`filter`]: trait.Iterator.html#method.filter
//! [`map`]: Iterator::map
//! [`take`]: Iterator::take
//! [`filter`]: Iterator::filter
//!
//! # Laziness
//!
Expand Down Expand Up @@ -261,13 +259,13 @@
//! }
//! ```
//!
//! [`map`]: trait.Iterator.html#method.map
//! [`for_each`]: trait.Iterator.html#method.for_each
//! [`map`]: Iterator::map
//! [`for_each`]: Iterator::for_each
//!
//! Another common way to evaluate an iterator is to use the [`collect`]
//! method to produce a new collection.
//!
//! [`collect`]: trait.Iterator.html#method.collect
//! [`collect`]: Iterator::collect
//!
//! # Infinity
//!
Expand Down Expand Up @@ -305,8 +303,8 @@
//! println!("The smallest number one is {}.", least);
//! ```
//!
//! [`take`]: trait.Iterator.html#method.take
//! [`min`]: trait.Iterator.html#method.min
//! [`take`]: Iterator::take
//! [`min`]: Iterator::min

#![stable(feature = "rust1", since = "1.0.0")]

Expand Down
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This directory contains the source code of the rust project, including:
- `rustc` and its tests
- The test suite
- The bootstrapping build system
- Various submodules for tools, like rustdoc, rls, etc.

Expand Down
12 changes: 8 additions & 4 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2740,10 +2740,17 @@ function defocusSearchBar() {
});
}

function enableSearchInput() {
if (search_input) {
search_input.removeAttribute('disabled');
}
}

window.addSearchOptions = function(crates) {
var elem = document.getElementById("crate-search");

if (!elem) {
enableSearchInput();
return;
}
var crates_text = [];
Expand Down Expand Up @@ -2781,10 +2788,7 @@ function defocusSearchBar() {
elem.value = savedCrate;
}
}

if (search_input) {
search_input.removeAttribute('disabled');
}
enableSearchInput();
};

function buildHelperPopup() {
Expand Down