Skip to content

Commit ab20265

Browse files
committed
Auto merge of #8227 - ehuss:doc-bench-unstable, r=alexcrichton
Document that bench is unstable in the man page. This copies the unstable notice from https://doc.rust-lang.org/cargo/reference/cargo-targets.html#benchmarks. cc rust-lang/rust#38998 (comment)
2 parents b8e5255 + ee648ea commit ab20265

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

src/doc/man/cargo-bench.adoc

+10
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ The libtest harness may be disabled by setting `harness = false` in the target
3636
manifest settings, in which case your code will need to provide its own `main`
3737
function to handle running benchmarks.
3838

39+
40+
> **Note**: The
41+
> link:https://doc.rust-lang.org/nightly/unstable-book/library-features/test.html[`#[bench\]` attribute]
42+
> is currently unstable and only available on the
43+
> link:https://doc.rust-lang.org/book/appendix-07-nightly-rust.html[nightly channel].
44+
> There are some packages available on
45+
> link:https://crates.io/keywords/benchmark[crates.io] that may help with
46+
> running benchmarks on the stable channel, such as
47+
> link:https://crates.io/crates/criterion[Criterion].
48+
3949
== OPTIONS
4050

4151
=== Benchmark Options

src/doc/man/generated/cargo-bench.html

+14
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ <h2 id="cargo_bench_description">DESCRIPTION</h2>
4242
manifest settings, in which case your code will need to provide its own <code>main</code>
4343
function to handle running benchmarks.</p>
4444
</div>
45+
<div class="quoteblock">
46+
<blockquote>
47+
<div class="paragraph">
48+
<p><strong>Note</strong>: The
49+
<a href="https://doc.rust-lang.org/nightly/unstable-book/library-features/test.html"><code>#[bench]</code> attribute</a>
50+
is currently unstable and only available on the
51+
<a href="https://doc.rust-lang.org/book/appendix-07-nightly-rust.html">nightly channel</a>.
52+
There are some packages available on
53+
<a href="https://crates.io/keywords/benchmark">crates.io</a> that may help with
54+
running benchmarks on the stable channel, such as
55+
<a href="https://crates.io/crates/criterion">Criterion</a>.</p>
56+
</div>
57+
</blockquote>
58+
</div>
4559
</div>
4660
</div>
4761
<div class="sect1">

src/etc/man/cargo-bench.1

+18-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
.\" Title: cargo-bench
33
.\" Author: [see the "AUTHOR(S)" section]
44
.\" Generator: Asciidoctor 2.0.10
5-
.\" Date: 2020-02-06
5+
.\" Date: 2020-05-08
66
.\" Manual: \ \&
77
.\" Source: \ \&
88
.\" Language: English
99
.\"
10-
.TH "CARGO\-BENCH" "1" "2020-02-06" "\ \&" "\ \&"
10+
.TH "CARGO\-BENCH" "1" "2020-05-08" "\ \&" "\ \&"
1111
.ie \n(.g .ds Aq \(aq
1212
.el .ds Aq '
1313
.ss \n[.ss] 0
@@ -59,6 +59,22 @@ the test harness to tell it to run only benchmarks.
5959
The libtest harness may be disabled by setting \fBharness = false\fP in the target
6060
manifest settings, in which case your code will need to provide its own \fBmain\fP
6161
function to handle running benchmarks.
62+
.RS 3
63+
.ll -.6i
64+
.sp
65+
\fBNote\fP: The
66+
\c
67+
.URL "https://doc.rust\-lang.org/nightly/unstable\-book/library\-features/test.html" "\fB#[bench]\fP attribute"
68+
is currently unstable and only available on the
69+
.URL "https://doc.rust\-lang.org/book/appendix\-07\-nightly\-rust.html" "nightly channel" "."
70+
There are some packages available on
71+
.URL "https://crates.io/keywords/benchmark" "crates.io" " "
72+
that may help with
73+
running benchmarks on the stable channel, such as
74+
.URL "https://crates.io/crates/criterion" "Criterion" "."
75+
.br
76+
.RE
77+
.ll
6278
.SH "OPTIONS"
6379
.SS "Benchmark Options"
6480
.sp

0 commit comments

Comments
 (0)