Skip to content

Commit eac79ec

Browse files
committed
Update other docs to use cargo:: syntax
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
1 parent ed9dc44 commit eac79ec

File tree

5 files changed

+39
-39
lines changed

5 files changed

+39
-39
lines changed

src/cargo/core/compiler/custom_build.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ pub struct BuildDeps {
150150
pub rerun_if_env_changed: Vec<String>,
151151
}
152152

153-
/// Represents one of the instructions from `cargo:rustc-link-arg-*` build
153+
/// Represents one of the instructions from `cargo::rustc-link-arg-*` build
154154
/// script instruction family.
155155
///
156156
/// In other words, indicates targets that custom linker arguments applies to.
@@ -160,19 +160,19 @@ pub struct BuildDeps {
160160
/// [1]: https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#cargorustc-link-argflag
161161
#[derive(Clone, Hash, Debug, PartialEq, Eq)]
162162
pub enum LinkArgTarget {
163-
/// Represents `cargo:rustc-link-arg=FLAG`.
163+
/// Represents `cargo::rustc-link-arg=FLAG`.
164164
All,
165-
/// Represents `cargo:rustc-cdylib-link-arg=FLAG`.
165+
/// Represents `cargo::rustc-cdylib-link-arg=FLAG`.
166166
Cdylib,
167-
/// Represents `cargo:rustc-link-arg-bins=FLAG`.
167+
/// Represents `cargo::rustc-link-arg-bins=FLAG`.
168168
Bin,
169-
/// Represents `cargo:rustc-link-arg-bin=BIN=FLAG`.
169+
/// Represents `cargo::rustc-link-arg-bin=BIN=FLAG`.
170170
SingleBin(String),
171-
/// Represents `cargo:rustc-link-arg-tests=FLAG`.
171+
/// Represents `cargo::rustc-link-arg-tests=FLAG`.
172172
Test,
173-
/// Represents `cargo:rustc-link-arg-benches=FLAG`.
173+
/// Represents `cargo::rustc-link-arg-benches=FLAG`.
174174
Bench,
175-
/// Represents `cargo:rustc-link-arg-examples=FLAG`.
175+
/// Represents `cargo::rustc-link-arg-examples=FLAG`.
176176
Example,
177177
}
178178

src/doc/src/faq.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ Cargo has no way right now of after-the-fact debugging "why was that rebuilt?"
242242

243243
Some issues we've seen historically which can cause crates to get rebuilt are:
244244

245-
* A build script prints `cargo:rerun-if-changed=foo` where `foo` is a file that
245+
* A build script prints `cargo::rerun-if-changed=foo` where `foo` is a file that
246246
doesn't exist and nothing generates it. In this case Cargo will keep running
247247
the build script thinking it will generate the file but nothing ever does. The
248248
fix is to avoid printing `rerun-if-changed` in this scenario.
@@ -280,38 +280,38 @@ issue](https://github.com/rust-lang/cargo/issues/new)!
280280
281281
Have you seen the error message above?
282282

283-
This is one of the most annoying error message for Cargo users. There are several
284-
situations may lead us to a version conflict. Below we'll walk through possible
283+
This is one of the most annoying error message for Cargo users. There are several
284+
situations may lead us to a version conflict. Below we'll walk through possible
285285
causes and provide diagnostic techniques to help you out there:
286286

287-
- The project and its dependencies use [links] to repeatedly link the local
288-
library. Cargo forbids linking two packages with the same native library, so
289-
even with multiple layers of dependencies it is not allowed. In this case, the
290-
error message will prompt: `Only one package in the dependency graph may specify
291-
the same links value`, you may need to manually check and delete duplicate link
287+
- The project and its dependencies use [links] to repeatedly link the local
288+
library. Cargo forbids linking two packages with the same native library, so
289+
even with multiple layers of dependencies it is not allowed. In this case, the
290+
error message will prompt: `Only one package in the dependency graph may specify
291+
the same links value`, you may need to manually check and delete duplicate link
292292
values. The community also have [conventions in place] to alleviate this.
293293

294-
- When depending on different crates in the project, if these crates use the same
295-
dependent library, but the version used is restricted, making it impossible to
296-
determine the correct version, it will also cause conflicts. The error message
297-
will prompt: `all possible versions conflict with previously selected packages`.
294+
- When depending on different crates in the project, if these crates use the same
295+
dependent library, but the version used is restricted, making it impossible to
296+
determine the correct version, it will also cause conflicts. The error message
297+
will prompt: `all possible versions conflict with previously selected packages`.
298298
You may need to modify the version requirements to make them consistent.
299299

300-
- If there are multiple versions of dependencies in the project, when using
301-
[`direct-minimal-versions`], the minimum version requirements cannot be met,
300+
- If there are multiple versions of dependencies in the project, when using
301+
[`direct-minimal-versions`], the minimum version requirements cannot be met,
302302
which will cause conflicts. You may need to modify version requirements of your
303303
direct dependencies to meet the minimum SemVer version accordingly.
304304

305-
- If the dependent crate does not have the features you choose, it will also
306-
cause conflicts. At this time, you need to check the dependent version and its
305+
- If the dependent crate does not have the features you choose, it will also
306+
cause conflicts. At this time, you need to check the dependent version and its
307307
features.
308308

309-
- Conflicts may occur when merging branches or PRs, if there are non-trivial
310-
conflicts, you can reset all "yours" changes, fix all other conflicts in the
311-
branch, and then run some cargo command (like `cargo tree` or `cargo check`),
312-
which should re-update the lockfile with your own local changes. If you previously
313-
ran some `cargo update` commands in your branch, you can re-run them that this
314-
time. The community has been looking to resolve merge conflicts with `Cargo.lock`
309+
- Conflicts may occur when merging branches or PRs, if there are non-trivial
310+
conflicts, you can reset all "yours" changes, fix all other conflicts in the
311+
branch, and then run some cargo command (like `cargo tree` or `cargo check`),
312+
which should re-update the lockfile with your own local changes. If you previously
313+
ran some `cargo update` commands in your branch, you can re-run them that this
314+
time. The community has been looking to resolve merge conflicts with `Cargo.lock`
315315
and `Cargo.toml` using a [custom merge tool].
316316

317317

src/doc/src/reference/external-tools.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,22 +205,22 @@ may be found in [the chapter on build scripts](build-scripts.md).
205205
"reason": "build-script-executed",
206206
/* The Package ID, a unique identifier for referring to the package. */
207207
"package_id": "my-package 0.1.0 (path+file:///path/to/my-package)",
208-
/* Array of libraries to link, as indicated by the `cargo:rustc-link-lib`
208+
/* Array of libraries to link, as indicated by the `cargo::rustc-link-lib`
209209
instruction. Note that this may include a "KIND=" prefix in the string
210210
where KIND is the library kind.
211211
*/
212212
"linked_libs": ["foo", "static=bar"],
213213
/* Array of paths to include in the library search path, as indicated by
214-
the `cargo:rustc-link-search` instruction. Note that this may include a
214+
the `cargo::rustc-link-search` instruction. Note that this may include a
215215
"KIND=" prefix in the string where KIND is the library kind.
216216
*/
217217
"linked_paths": ["/some/path", "native=/another/path"],
218-
/* Array of cfg values to enable, as indicated by the `cargo:rustc-cfg`
218+
/* Array of cfg values to enable, as indicated by the `cargo::rustc-cfg`
219219
instruction.
220220
*/
221221
"cfgs": ["cfg1", "cfg2=\"string\""],
222222
/* Array of [KEY, VALUE] arrays of environment variables to set, as
223-
indicated by the `cargo:rustc-env` instruction.
223+
indicated by the `cargo::rustc-env` instruction.
224224
*/
225225
"env": [
226226
["SOME_KEY", "some value"],

src/doc/src/reference/unstable.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ You can use the flag like this:
10951095
cargo check -Z unstable-options -Z check-cfg
10961096
```
10971097

1098-
### `cargo:rustc-check-cfg=CHECK_CFG`
1098+
### `cargo::rustc-check-cfg=CHECK_CFG`
10991099

11001100
The `rustc-check-cfg` instruction tells Cargo to pass the given value to the
11011101
`--check-cfg` flag to the compiler. This may be used for compile-time
@@ -1111,7 +1111,7 @@ You can use the instruction like this:
11111111

11121112
```rust,no_run
11131113
// build.rs
1114-
println!("cargo:rustc-check-cfg=cfg(foo, bar)");
1114+
println!("cargo::rustc-check-cfg=cfg(foo, bar)");
11151115
```
11161116

11171117
```

tests/testsuite/check_cfg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -532,15 +532,15 @@ fn build_script_feature_gate() {
532532
.file(
533533
"build.rs",
534534
r#"fn main() {
535-
println!("cargo:rustc-check-cfg=cfg(foo)");
536-
println!("cargo:rustc-cfg=foo");
535+
println!("cargo::rustc-check-cfg=cfg(foo)");
536+
println!("cargo::rustc-cfg=foo");
537537
}"#,
538538
)
539539
.file("src/main.rs", "fn main() {}")
540540
.build();
541541

542542
p.cargo("check")
543-
.with_stderr_contains("warning[..]cargo:rustc-check-cfg requires -Zcheck-cfg flag")
543+
.with_stderr_contains("warning[..]cargo::rustc-check-cfg requires -Zcheck-cfg flag")
544544
.with_status(0)
545545
.run();
546546
}

0 commit comments

Comments
 (0)