Skip to content

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

wchargin and others added 27 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
Suggested by withoutboats
…ns that return () (clippy::option_map_unit_fn)
…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.
Update `compiler_builtins` to 0.1.38

This version contains the fixes of rust-lang/compiler-builtins#390 and rust-lang/compiler-builtins#391.
Also, rename features following rust-lang/compiler-builtins#386.
Update stdarch submodule

Changes included:

* Use a bootstrap guard for modules with new target features
* Avoid calling intrinsics with invalid const arguments
* Avx512bw
* Avx512cd
* Add AVX512BITALG
* Add GFNI Intrinsics
* Add AVX512VPOPCNTDQ Intrinsics
* Add VPCLMULQDQ Intrinsics
* Avx512bw
* Reimplement `_xgetbv` with LLVM intrinsics
* Avx512bw
* Add reamained vmax and vmin via auto-generated code
* Add VAES intrinsics

Fixes rust-lang#56483.
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
@rustbot rustbot added the rollup A PR which is a rollup label Dec 12, 2020
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Dec 12, 2020

📌 Commit e08bda9 has been approved by Dylan-DPC

@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 12, 2020
@bors
Copy link
Collaborator

bors commented Dec 12, 2020

⌛ Testing commit e08bda9 with merge f01c4d1237f7d4bb71affeb23640b917f71aae44...

@bors
Copy link
Collaborator

bors commented Dec 12, 2020

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 12, 2020
@JohnTitor
Copy link
Member

The failure is caused by #79863, closing.

@JohnTitor JohnTitor closed this Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.