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 12 pull requests #79994

Merged
merged 35 commits into from
Dec 13, 2020
Merged

Rollup of 12 pull requests #79994

merged 35 commits into from
Dec 13, 2020

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

wchargin and others added 30 commits November 23, 2020 11:59
A colleague of mine is new to Rust, and mentioned that it was “slightly
confusing” to figure out what `&mut` does in iterating over `&mut foo`:

```rust
for value in &mut self.my_vec {
    // ...
}
```

My colleague had read the `std::iter` docs and not found the answer
there. There is a brief section at the top about “the three forms of
iteration”, which mentions `iter_mut`, but it doesn’t cover the purpose
of `&mut coll` for a collection `coll`. This patch adds an explanatory
section to the docs. I opted to create a new section so that it can
appear after the note that `impl<I: Iterator> IntoIterator for I`, and
it’s nice for the existing “three forms of iteration” to appear near the
top.

Implementation note: I haven’t linkified the references to `HashSet` and
`HashMap`, since those are in `std` and these docs are in `core`;
linkifying them gave an “unresolved link” rustdoc error.

Test Plan:
Ran `./x.py doc library/core`, and the result looked good. Manually
copy-pasted the two doctests into the playground and ran them.

wchargin-branch: doc-iter-by-reference
wchargin-source: 0f35369a8a735868621166608797744e97536792
wchargin-branch: doc-iter-by-reference
wchargin-source: e4069ac9a9d73860467cea74cf3ae1605af37d74
Co-authored-by: Camelid <camelidcamel@gmail.com>
Suggested by withoutboats
bootstrap completely ignores all errors when detecting a rustup version,
so this wasn't noticed before.

Fixes the following error:

```
rustup not detected: a bytes-like object is required, not 'str'
falling back to auto-detect
```

This also takes the opportunity to only call rustup and other external
commands only once during startup.
…ns that return () (clippy::option_map_unit_fn)
Co-authored-by: Rémy Rakic <lqd@users.noreply.github.com>
The background was dark before, which made the text impossible to read.
Now the background is white, which is how selected `div`s are rendered.

As a result, the search results tabs now look identical to how they
used to look (before rust-lang#79896).
In HTML, when a button follows an input, if the enter keep is pressed on the input, instead of sending the submit event to the input, it'll create a click event on the button following it, which in this case made the help popup show up whenever "enter" was pressed.
…ence, r=m-ou-se

std::iter: document iteration over `&T` and `&mut T`

A colleague of mine is new to Rust, and mentioned that it was “slightly
confusing” to figure out what `&mut` does in iterating over `&mut foo`:

```rust
for value in &mut self.my_vec {
    // ...
}
```

My colleague had read the `std::iter` docs and not found the answer
there. There is a brief section at the top about “the three forms of
iteration”, which mentions `iter_mut`, but it doesn’t cover the purpose
of `&mut coll` for a collection `coll`. This patch adds an explanatory
section to the docs. I opted to create a new section so that it can
appear after the note that `impl<I: Iterator> IntoIterator for I`, and
it’s nice for the existing “three forms of iteration” to appear near the
top.

Test Plan:
Ran `./x.py doc library/core`, and the result looked good, including
links. Manually copy-pasted the two doctests into the playground and ran
them.

wchargin-branch: doc-iter-by-reference
Link loop/for keyword

Even though the reference already have all of these, I am just adding related keywords in the see also to let others easily click on the related keyword.
…ark-Simulacrum

Remove deprecated linked_list_extras methods.

rust-lang#27794 (comment):
> I'd say give it about 2 weeks then remove them.

It's been 18 weeks. Time to remove them. :)

Closes rust-lang#27794.
Fix rustup support in default_build_triple for python3

bootstrap completely ignores all errors when detecting a rustup version,
so this wasn't noticed before.

Fixes the following error:

```
rustup not detected: a bytes-like object is required, not 'str'
falling back to auto-detect
```

This also takes the opportunity to only call rustup and other external
commands only once during startup.

Follow-up to rust-lang#78513.
fix more clippy::complexity findings

fix clippy::unnecessary_filter_map
use if let Some(x) = ..  instead of ...map(|x|) to conditionally run fns that return () (clippy::option_map_unit_fn)
fix clippy::{needless_bool, manual_unwrap_or}
don't clone types that are copy (clippy::clone_on_copy)
don't convert types into identical types with .into() (clippy::useless_conversion)
use strip_prefix over slicing (clippy::manual_strip)

r? ``@Dylan-DPC``
Add post-init hook for static memory for miri.

Adds a post-initialization hook to treat memory initialized using the interpreter as if it was initialized in a static context.

See: rust-lang/miri#1644 & rust-lang/miri#1643
…lan-DPC

Fix typo in `DebruijnIndex` documentation

Suggested in rust-lang#79169 (comment).
r? ``@lqd``
…, r=Mark-Simulacrum

Misc rustbuild improvements when the LLVM backend isn't used

* Don't checkout llvm-project
* Don't require cmake and ninja

Fixes rust-lang#78564
…=GuillaumeGomez

rustdoc light theme: Fix CSS for selected buttons

Fixes rust-lang#79961.

The background was dark before, which made the text impossible to read.
Now the button doesn't override the background, and the only thing it
does is add a light-blue top border.

Ultimately, the search results tabs now look very similar to how they
used to look.

r? `@GuillaumeGomez`
Remove an unused dependency that made `rustdoc` crash

Whilst struggling with rust-lang#79980 I discovered that this dependency was unused, and that made rustdoc crash. This PR removes it.
…jyn514

Fixes submit event of the search input

Fixes rust-lang#79960

It's a very funny corner case:

In HTML, when a button follows an input (in a `form`), if the enter keep is pressed on the input, instead of sending the submit event to the input, it'll create a click event on the button following it, which in this case made the help popup show up whenever "enter" was pressed.

cc `@camelid`

r? `@jyn514`
@rustbot rustbot added the rollup A PR which is a rollup label Dec 13, 2020
@JohnTitor
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Dec 13, 2020

📌 Commit 3213089 has been approved by JohnTitor

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 13, 2020
@bors
Copy link
Contributor

bors commented Dec 13, 2020

⌛ Testing commit 3213089 with merge 1281315...

@bors
Copy link
Contributor

bors commented Dec 13, 2020

☀️ Test successful - checks-actions
Approved by: JohnTitor
Pushing 1281315 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 13, 2020
@bors bors merged commit 1281315 into rust-lang:master Dec 13, 2020
@rustbot rustbot added this to the 1.50.0 milestone Dec 13, 2020
@JohnTitor JohnTitor deleted the rollup-43wl2uj branch December 13, 2020 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.