Skip to content

Rollup of 10 pull requests #84679

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

Closed
wants to merge 24 commits into from
Closed
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e8a143a
Ignore commented out lines when finding features
syvb Apr 24, 2021
43309f9
Build sanitizers for x86_64-unknown-linux-musl
12101111 Apr 25, 2021
9e722f7
Set `backtrace-on-ice` by default for compiler and codegen profiles
jyn514 Apr 25, 2021
a7e23f4
Add starting anchor
syvb Apr 25, 2021
5bd3187
Point out that behavior might be switched on 2015 and 2018 editions t…
est31 Apr 26, 2021
12642d9
Add a paragraph with possible alternatives on older editions
est31 Apr 27, 2021
eb753e8
Add a regression test for #75883
JohnTitor Apr 28, 2021
de92dfb
Add a regression test for #80779
JohnTitor Apr 28, 2021
8b806bc
Remove extra word in `rustc_mir` docs
pierwill Apr 28, 2021
1ac6326
Remove `DropGuard` in `sys::windows::process` and use `StaticMutex` i…
CDirkx Apr 28, 2021
153eb72
rustdoc: change aliases attribute to data-aliases
notriddle Apr 27, 2021
b57049a
rustdoc: update auto_aliases test case with data-aliases attribute
notriddle Apr 27, 2021
8dc09e1
Update books
ehuss Apr 28, 2021
b28754a
Add `x.py check src/librustdoc` as an alias for `x.py check src/tools…
jyn514 Apr 26, 2021
7c9f535
Rollup merge of #84531 - Smittyvb:foo-not-feature, r=Mark-Simulacrum
jackh726 Apr 28, 2021
e1243b1
Rollup merge of #84540 - 12101111:enable-sanitizers, r=Mark-Simulacrum
jackh726 Apr 28, 2021
9d5bc31
Rollup merge of #84555 - jyn514:ice-backtrace, r=Mark-Simulacrum
jackh726 Apr 28, 2021
1ecc464
Rollup merge of #84585 - jyn514:check-rustdoc, r=Mark-Simulacrum
jackh726 Apr 28, 2021
6ac4698
Rollup merge of #84590 - est31:array_into_iter, r=nikomatsakis
jackh726 Apr 28, 2021
12757c1
Rollup merge of #84636 - notriddle:data-aliases, r=jyn514,GuillaumeGomez
jackh726 Apr 28, 2021
fc081c4
Rollup merge of #84646 - JohnTitor:add-some-bad-placeholder-tests, r=…
jackh726 Apr 28, 2021
8f093ef
Rollup merge of #84661 - pierwill:patch-1, r=jackh726
jackh726 Apr 28, 2021
d16bac5
Rollup merge of #84663 - CDirkx:dropguard, r=Mark-Simulacrum
jackh726 Apr 28, 2021
fff2979
Rollup merge of #84668 - ehuss:update-books, r=ehuss
jackh726 Apr 28, 2021
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
48 changes: 46 additions & 2 deletions library/std/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,10 @@ mod prim_pointer {}
/// # Editions
///
/// Prior to Rust 1.53, arrays did not implement `IntoIterator` by value, so the method call
/// `array.into_iter()` auto-referenced into a slice iterator. That behavior is preserved in the
/// 2015 and 2018 editions of Rust for compatability, ignoring `IntoIterator` by value.
/// `array.into_iter()` auto-referenced into a slice iterator. Right now, the old behavior
/// is preserved in the 2015 and 2018 editions of Rust for compatibility, ignoring
/// `IntoIterator` by value. In the future, the behavior on the 2015 and 2018 edition
/// might be made consistent to the behavior of later editions.
///
#[cfg_attr(bootstrap, doc = "```rust,edition2018,ignore")]
#[cfg_attr(not(bootstrap), doc = "```rust,edition2018")]
Expand Down Expand Up @@ -601,6 +603,48 @@ mod prim_pointer {}
/// }
/// ```
///
/// Future language versions might start treating the `array.into_iter()`
/// syntax on editions 2015 and 2018 the same as on edition 2021. So code using
/// those older editions should still be written with this change in mind, to
/// prevent breakage in the future. The safest way to accomplish this is to
/// avoid the `into_iter` syntax on those editions. If an edition update is not
/// viable/desired, there are multiple alternatives:
/// * use `iter`, equivalent to the old behavior, creating references
/// * use [`array::IntoIter`], equivalent to the post-2021 behavior (Rust 1.51+)
/// * replace `for ... in array.into_iter() {` with `for ... in array {`,
/// equivalent to the post-2021 behavior (Rust 1.53+)
///
/// ```rust,edition2018
/// use std::array::IntoIter;
///
/// let array: [i32; 3] = [0; 3];
///
/// // This iterates by reference:
/// for item in array.iter() {
/// let x: &i32 = item;
/// println!("{}", x);
/// }
///
/// // This iterates by value:
/// for item in IntoIter::new(array) {
/// let x: i32 = item;
/// println!("{}", x);
/// }
///
/// // This iterates by value:
/// for item in array {
/// let x: i32 = item;
/// println!("{}", x);
/// }
///
/// // IntoIter can also start a chain.
/// // This iterates by value:
/// for item in IntoIter::new(array).enumerate() {
/// let (i, x): (usize, i32) = item;
/// println!("array[{}] = {}", i, x);
/// }
/// ```
///
/// [slice]: prim@slice
/// [`Debug`]: fmt::Debug
/// [`Hash`]: hash::Hash
Expand Down