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
You can configure how your crate is built by adding <ahref="metadata">package metadata</a> to your <code>Cargo.toml</code>, e.g.:
53
51
{% filter dedent -%}
54
-
<pre>
55
-
<code>
56
-
[package.metadata.docs.rs]
57
-
rustc-args = ["--cfg", "docsrs"]
58
-
</code>
59
-
</pre>
52
+
<pre><codeclass="lang-toml">
53
+
[package.metadata.docs.rs]
54
+
rustc-args = ["--cfg", "docsrs"]
55
+
</code></pre>
60
56
{%- endfilter %}
61
57
Here, the compiler arguments are set so that <code>#[cfg(docsrs)]</code> (not to be confused with <code>#[cfg(doc)]</code>) can be used for conditional compilation.
62
58
This approach is also useful for setting <ahref="https://doc.rust-lang.org/cargo/reference/features.html">cargo features</a>.
0 commit comments