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

Monday's round of rustdoc improvements #9636

Merged
merged 7 commits into from
Oct 1, 2013
Merged

Conversation

alexcrichton
Copy link
Member

Commits have all the juicy details.

Import thing to note in this pull request is that rustdoc html crate.rs becomes rustdoc crate.rs

if !self.seen.contains(&item.source.filename) {
self.emit_source(item.source.filename);
if self.cx.include_sources && !self.seen.contains(&item.source.filename) {
// If it turns out that we couldn't read this file, then we probably
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this print a warning to the user? (i.e. if they're expecting sources, silently not getting them without an indication of why is unfortunate.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily, if I'm distributing a doc.json file I don't expect you to have the source.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a warning would be good too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to print one warning after giving up.

@alexcrichton
Copy link
Member Author

Pushed with comments addressed, plus some bonus extra fixes.

@@ -15,19 +15,21 @@

#[desc = "rustdoc, the Rust documentation extractor"];
#[license = "MIT/ASL2"];
#[crate_type = "lib"];
//#[crate_type = "lib"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm no, although it makes it super nice for compiling by hand!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-pushed.

This modifies the command-line usage of rustdoc to intake its own JSON output as
well as a rust source file. This also alters the command line from
`rustdoc input file`  to `rustdoc file` with the input/output formats specified
as -r and -w, respectively.

When using a JSON input, no passes or plugins are re-run over the json, instead
the output is generated directly from the JSON that was provided. Passes and
plugins are still run on rust source input, however.
When a key is pressed and held, this now does the OS-style repeating after a bit
of a pause. Also fixes the width of search results to be correct (was changed
beforehand and didn't catch this).
This takes the rendering time of source files for libstd from 12.5s to 0.1s,
turns out write! calls the write function *a lot*
self.seen.insert(item.source.filename.clone());

if !self.cx.include_sources {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is backwards, right? Since we're in an if self.cx.include_sources && ... { ... } block, it will never fire, and when you flip it, it will always fire.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is reset from the return value of emit_source and as soon as cx.include_sources is false it will remain false (the branch is never taken again).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, obviously. I'm bad at looking 2 lines up.

bors added a commit that referenced this pull request Oct 1, 2013
Commits have all the juicy details.

Import thing to note in this pull request is that `rustdoc html crate.rs` becomes `rustdoc crate.rs`
@bors bors closed this Oct 1, 2013
@bors bors merged commit 56da32c into rust-lang:master Oct 1, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 20, 2022
[`default_numeric_fallback`] do not lint on constants

fix rust-lang/rust-clippy#9632

changelog:[`default_numeric_fallback`] do not lint on constants
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.

4 participants