Skip to content

Commit

Permalink
Rollup merge of #83680 - ibraheemdev:patch-2, r=Dylan-DPC
Browse files Browse the repository at this point in the history
Update for loop desugaring docs

It looks like the documentation for `for` loops was not updated to match the new de-sugaring process.
  • Loading branch information
Dylan-DPC committed Mar 30, 2021
2 parents d51fc97 + 29fe593 commit 2aa1bf8
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions library/std/src/keyword_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,15 +547,18 @@ mod fn_keyword {}
/// # fn code() { }
/// # let iterator = 0..2;
/// {
/// let mut _iter = std::iter::IntoIterator::into_iter(iterator);
/// loop {
/// match _iter.next() {
/// Some(loop_variable) => {
/// code()
/// },
/// None => break,
/// }
/// }
/// let result = match IntoIterator::into_iter(iterator) {
/// mut iter => loop {
/// let next;
/// match iter.next() {
/// Some(val) => next = val,
/// None => break,
/// };
/// let loop_variable = next;
/// let () = { code(); };
/// },
/// };
/// result
/// }
/// ```
///
Expand Down

0 comments on commit 2aa1bf8

Please sign in to comment.