Skip to content

Revise graphviz doc-comments to avoid generating files from rustdoc runs. #13976

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 1 commit into from
May 8, 2014

Conversation

pnkfelix
Copy link
Member

@pnkfelix pnkfelix commented May 6, 2014

Fix #13965.

This commit adopts the second strategy I outlined in #13965, where the bulk of the code is still "smoke tested" (in the sense that rustdoc attempts to run it, sending all of the generated output into a locally allocated MemWriter). The part of the code that is ignored (but included in the presentation) is isolated to a three-line main function that invokes the core rendering routine.

In the generated rustdoc output, this leads to a small break between the two code blocks, but I do not think this is a large issue.

# pub fn main() { use std::io::MemWriter; render_to(&mut MemWriter::new()) }
```

```ignore
Copy link
Member

Choose a reason for hiding this comment

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

This could be weakened to no_run (IIRC) so that it's still compiled.

Copy link
Member Author

Choose a reason for hiding this comment

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

true; I'll do that. (And in fact, I think doing this caught a bug...)

@alexcrichton
Copy link
Member

r=me with a squash

…oc runs.

Fix rust-lang#13965.

There is a dance here between the `main` that actually runs versus the
`main` that is printed in the output documentation.  We don't run the
latter `main`, but we do at least compile (and thus type-check) it.
It is still the responsibility of the documenter to ensure that the
signatures of `fn render` are kept in sync across the blocks.
bors added a commit that referenced this pull request May 8, 2014
Fix #13965.

This commit adopts the second strategy I outlined in #13965, where the bulk of the code is still "smoke tested" (in the sense that rustdoc attempts to run it, sending all of the generated output into a locally allocated `MemWriter`).  The part of the code that is ignored (but included in the presentation) is isolated to a three-line `main` function that invokes the core rendering routine.

In the generated rustdoc output, this leads to a small break between the two code blocks, but I do not think this is a large issue.
@bors bors closed this May 8, 2014
@bors bors merged commit a22413b into rust-lang:master May 8, 2014
bors pushed a commit to rust-lang-ci/rust that referenced this pull request Jan 28, 2025
…ust-lang#13976)

Checking it only in the merge queue leads to deferred failures once the
decision to merge has been taken already.

- [X] Testing first without changelog line
- [x] Now that that has failed, adding the changelog line and
force-pushing

changelog: none
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.

make check creates files example{1,2,3}.dot
4 participants