You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/doc/rustdoc/src/unstable-features.md
+12-2
Original file line number
Diff line number
Diff line change
@@ -458,7 +458,13 @@ Calculating code examples follows these rules:
458
458
459
459
### `--with-examples`: include examples of uses of items as documentation
460
460
461
-
This option, combined with `--scrape-examples-target-crate` and `--scrape-examples-output-path`, is used to implement the functionality in [RFC #3123](https://github.com/rust-lang/rfcs/pull/3123). Uses of an item (currently functions / call-sites) are found in a crate and its reverse-dependencies, and then the uses are included as documentation for that item. This feature is intended to be used via `cargo doc --scrape-examples`, but the rustdoc-only workflow looks like:
461
+
This option, combined with `--scrape-examples-target-crate` and
462
+
`--scrape-examples-output-path`, is used to implement the functionality in [RFC
463
+
#3123](https://github.com/rust-lang/rfcs/pull/3123). Uses of an item (currently
464
+
functions / call-sites) are found in a crate and its reverse-dependencies, and
465
+
then the uses are included as documentation for that item. This feature is
466
+
intended to be used via `cargo doc --scrape-examples`, but the rustdoc-only
First, the library must be checked to generate an `rmeta`. Then a reverse-dependency like `examples/ex.rs` is given to rustdoc with the target crate being documented (`foobar`) and a path to output the calls (`output.calls`). Then, the generated calls file can be passed via `--with-examples` to the subsequent documentation of `foobar`.
477
+
First, the library must be checked to generate an `rmeta`. Then a
478
+
reverse-dependency like `examples/ex.rs` is given to rustdoc with the target
479
+
crate being documented (`foobar`) and a path to output the calls
480
+
(`output.calls`). Then, the generated calls file can be passed via
481
+
`--with-examples` to the subsequent documentation of `foobar`.
0 commit comments