Skip to content

Commit 0b2e293

Browse files
committed
Add tracking issue and unstable documentation
1 parent 0c8e1f8 commit 0b2e293

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

src/bin/cargo/commands/doc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
8484
};
8585

8686
if compile_opts.rustdoc_scrape_examples.is_some() {
87-
// FIXME(wcrichto): add a tracking issue once this gets merged and add issue number below
8887
config
8988
.cli_unstable()
90-
.fail_if_stable_opt("--scrape-examples", 0)?;
89+
.fail_if_stable_opt("--scrape-examples", 9910)?;
9190
}
9291

9392
let doc_opts = DocOptions {

src/doc/src/reference/unstable.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ for the appropriate target and influenced by any other RUSTFLAGS.
12071207
* Tracking Issue: [#9778](https://github.com/rust-lang/cargo/issues/9778)
12081208
* PR: [#9627](https://github.com/rust-lang/cargo/pull/9627)
12091209

1210-
The `different-binary-name` feature allows setting the filename of the binary without having to obey the
1210+
The `different-binary-name` feature allows setting the filename of the binary without having to obey the
12111211
restrictions placed on crate names. For example, the crate name must use only `alphanumeric` characters
12121212
or `-` or `_`, and cannot be empty.
12131213

@@ -1378,7 +1378,23 @@ The 2021 edition has been stabilized in the 1.56 release.
13781378
See the [`edition` field](manifest.md#the-edition-field) for more information on setting the edition.
13791379
See [`cargo fix --edition`](../commands/cargo-fix.md) and [The Edition Guide](../../edition-guide/index.html) for more information on migrating existing projects.
13801380

1381+
13811382
### Custom named profiles
13821383

13831384
Custom named profiles have been stabilized in the 1.57 release. See the
13841385
[profiles chapter](profiles.md#custom-profiles) for more information.
1386+
1387+
1388+
### scrape-examples
1389+
1390+
* RFC: [#3123](https://github.com/rust-lang/rfcs/pull/3123)
1391+
* Tracking Issue: [#9910](https://github.com/rust-lang/cargo/issues/9910)
1392+
1393+
The `--scrape-examples` argument to the `doc` command tells Rustdoc to search
1394+
crates in the current workspace for calls to functions. Those call-sites are then
1395+
included as documentation. The flag can take an argument of `all`, `lib`, or `examples`
1396+
which configures which crate in the workspace to analyze for examples. For instance:
1397+
1398+
```
1399+
cargo doc --scrape-examples examples -Z unstable-options
1400+
```

0 commit comments

Comments
 (0)