Skip to content

Commit b29b82e

Browse files
committed
docs(build-rs): inline -C link-arg and remove broken intra-doc refs
1 parent 13f3b44 commit b29b82e

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

crates/build-rs/src/output.rs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,11 @@ pub fn rerun_if_env_changed(key: impl AsRef<OsStr>) {
6666
}
6767

6868
/// The `rustc-link-arg` instruction tells Cargo to pass the
69-
/// [`-C link-arg=FLAG` option][link-arg] to the compiler, but only when building
69+
/// [`-C link-arg=FLAG` option](https://doc.rust-lang.org/rustc/codegen-options/index.html#link-arg) to the compiler, but only when building
7070
/// supported targets (benchmarks, binaries, cdylib crates, examples, and tests).
7171
///
7272
/// Its usage is highly platform specific. It is useful to set the shared library
7373
/// version or linker script.
74-
///
75-
/// [link-arg]: https://doc.rust-lang.org/rustc/codegen-options/index.html#link-arg
7674
#[track_caller]
7775
pub fn rustc_link_arg(flag: &str) {
7876
if flag.contains([' ', '\n']) {
@@ -82,13 +80,11 @@ pub fn rustc_link_arg(flag: &str) {
8280
}
8381

8482
/// The `rustc-link-arg-bin` instruction tells Cargo to pass the
85-
/// [`-C link-arg=FLAG` option][link-arg] to the compiler, but only when building
83+
/// [`-C link-arg=FLAG` option](https://doc.rust-lang.org/rustc/codegen-options/index.html#link-arg) to the compiler, but only when building
8684
/// the binary target with name `BIN`. Its usage is highly platform specific.
8785
///
8886
/// It
8987
/// is useful to set a linker script or other linker options.
90-
///
91-
/// [link-arg]: https://doc.rust-lang.org/rustc/codegen-options/index.html#link-arg
9288
#[track_caller]
9389
pub fn rustc_link_arg_bin(bin: &str, flag: &str) {
9490
if !is_ident(bin) {
@@ -101,13 +97,11 @@ pub fn rustc_link_arg_bin(bin: &str, flag: &str) {
10197
}
10298

10399
/// The `rustc-link-arg-bins` instruction tells Cargo to pass the
104-
/// [`-C link-arg=FLAG` option][link-arg] to the compiler, but only when building
100+
/// [`-C link-arg=FLAG` option](https://doc.rust-lang.org/rustc/codegen-options/index.html#link-arg) to the compiler, but only when building
105101
/// the binary target.
106102
///
107103
/// Its usage is highly platform specific. It is useful to set
108104
/// a linker script or other linker options.
109-
///
110-
/// [link-arg]: https://doc.rust-lang.org/rustc/codegen-options/index.html#link-arg
111105
#[track_caller]
112106
pub fn rustc_link_arg_bins(flag: &str) {
113107
if flag.contains([' ', '\n']) {
@@ -117,7 +111,7 @@ pub fn rustc_link_arg_bins(flag: &str) {
117111
}
118112

119113
/// The `rustc-link-arg-tests` instruction tells Cargo to pass the
120-
/// [`-C link-arg=FLAG` option][link-arg] to the compiler, but only when building
114+
/// [`-C link-arg=FLAG` option](https://doc.rust-lang.org/rustc/codegen-options/index.html#link-arg) to the compiler, but only when building
121115
/// a tests target.
122116
#[track_caller]
123117
pub fn rustc_link_arg_tests(flag: &str) {
@@ -128,7 +122,7 @@ pub fn rustc_link_arg_tests(flag: &str) {
128122
}
129123

130124
/// The `rustc-link-arg-examples` instruction tells Cargo to pass the
131-
/// [`-C link-arg=FLAG` option][link-arg] to the compiler, but only when building
125+
/// [`-C link-arg=FLAG` option](https://doc.rust-lang.org/rustc/codegen-options/index.html#link-arg) to the compiler, but only when building
132126
/// an examples target.
133127
#[track_caller]
134128
pub fn rustc_link_arg_examples(flag: &str) {
@@ -139,7 +133,7 @@ pub fn rustc_link_arg_examples(flag: &str) {
139133
}
140134

141135
/// The `rustc-link-arg-benches` instruction tells Cargo to pass the
142-
/// [`-C link-arg=FLAG` option][link-arg] to the compiler, but only when building
136+
/// [`-C link-arg=FLAG` option](https://doc.rust-lang.org/rustc/codegen-options/index.html#link-arg) to the compiler, but only when building
143137
/// a benchmark target.
144138
#[track_caller]
145139
pub fn rustc_link_arg_benches(flag: &str) {
@@ -371,13 +365,11 @@ pub fn rustc_env(key: &str, value: &str) {
371365
}
372366

373367
/// The `rustc-cdylib-link-arg` instruction tells Cargo to pass the
374-
/// [`-C link-arg=FLAG` option][link-arg] to the compiler, but only when building
368+
/// [`-C link-arg=FLAG` option](https://doc.rust-lang.org/rustc/codegen-options/index.html#link-arg) to the compiler, but only when building
375369
/// a `cdylib` library target.
376370
///
377371
/// Its usage is highly platform specific. It is useful
378372
/// to set the shared library version or the runtime-path.
379-
///
380-
/// [link-arg]: https://doc.rust-lang.org/rustc/codegen-options/index.html#link-arg
381373
#[track_caller]
382374
pub fn rustc_cdylib_link_arg(flag: &str) {
383375
if flag.contains('\n') {

0 commit comments

Comments
 (0)