Skip to content

Consolidating looping documentation #27305

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

Merged
merged 4 commits into from
Aug 2, 2015
Merged

Consolidating looping documentation #27305

merged 4 commits into from
Aug 2, 2015

Conversation

KieranHunt
Copy link
Contributor

I found that the book had little information for loops and loop label so I've added some.

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@alexcrichton
Copy link
Member

r? @steveklabnik

@KieranHunt
Copy link
Contributor Author

I see that loops are alluded to here. I'm not sure if it would be better to merge what I've done with that page or move that information into this new page.

Another idea is to put all of the looping (loop, while, and for) information onto a single page.

@steveklabnik
Copy link
Member

Another idea is to put all of the looping (loop, while, and for) information onto a single page.

I like this idea a lot. Would you mind updating this PR to do that?

@KieranHunt KieranHunt changed the title Adding docs for loops and loop labels. Consolidating looping documentation Jul 29, 2015
@KieranHunt
Copy link
Contributor Author

I've moved all of the looping information to a single page and removed the individual pages for while and for loops. I didn't really change the content much apart from making sure that it flows nicely and adding a brief introduction.

@steveklabnik
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 31, 2015

📌 Commit 4a5194a has been approved by steveklabnik

@steveklabnik
Copy link
Member

Thanks so much!

@KieranHunt
Copy link
Contributor Author

Thank you, it was my pleasure.

@Manishearth
Copy link
Member

@bors r-

This causes tests to fail, http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/5983/steps/test/logs/stdio

(try it with make tmp/check-stage2-T-i686-apple-darwin-H-i686-apple-darwin-doc-trpl-loops.ok)

bors added a commit that referenced this pull request Aug 1, 2015
@KieranHunt
Copy link
Contributor Author

I'm a bit confused. I see from the link that a test failed. But after that it seemed that the merge went through? I'm not sure how to replicate those tests. Looking at the log file I'm not even sure what test failed.

Can someone fill me in?

@Manishearth
Copy link
Member

It didn't merge, the line above is the commit message for the rollup merge being linked to this pull request for mentioning its id (#27305). If it merged this PR would automatically get marked as such 😄

Thsoe are the doctests -- all rust code (except the bits annotated with ignore) in documentation is compiled and run. Something went wrong there. make tmp/check-stage2-T-i686-apple-darwin-H-i686-apple-darwin-doc-trpl-loops.ok or even make check-stage1-doc-trpl-loops should work (not sure about the latter).

rustdoc --test loops.md might also work.

It's quite possible that this was a freak error on the buildbot side, in which case we can just retry your pull request.

@Manishearth
Copy link
Member

(for me when I try rustdoc --test loops.md it hangs)

@KieranHunt
Copy link
Contributor Author

The hanging is intended. There is an example of an infinite loop:

loop {
    println!("Loop forever!");
}

Shall I annotate it to be ignored?

@alexcrichton
Copy link
Member

@bors: r=steveklabnik a989ed8

@bors
Copy link
Collaborator

bors commented Aug 1, 2015

⌛ Testing commit a989ed8 with merge 3b1b3f8...

@bors
Copy link
Collaborator

bors commented Aug 1, 2015

💔 Test failed - auto-linux-64-nopt-t

@KieranHunt
Copy link
Contributor Author

So that failure is reported as:

thread '<unnamed>' panicked at 'Some tests failed', ../src/libtest/lib.rs:253
make: *** [tmp/check-stage2-T-x86_64-unknown-linux-gnu-H-x86_64-unknown-linux-gnu-doc-trpl-functions.ok] Error 101

That seems to relate to the functions.md chapter of the book. My PR doesn't relate to, or touch, that at all.

@killercup
Copy link
Member

@KieranHunt, just FYI, you could use no_run instead of ignore to have rustdoc check for syntax errors :)

(See https://doc.rust-lang.org/book/documentation.html#running-documentation-tests for all the information.)

@Gankra
Copy link
Contributor

Gankra commented Aug 2, 2015

Looks like a spurious error -- stdio disappeared.

@bors retry

@bors
Copy link
Collaborator

bors commented Aug 2, 2015

⌛ Testing commit a989ed8 with merge 504eaa5...

bors added a commit that referenced this pull request Aug 2, 2015
I found that the book had little information for `loop`s and `loop` label so I've added some.
@bors bors merged commit a989ed8 into rust-lang:master Aug 2, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Nov 10, 2015
steveklabnik added a commit to steveklabnik/rust that referenced this pull request Nov 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants