Skip to content

Commit 8114c9a

Browse files
committed
Auto merge of #14006 - epage:add-quotes, r=weihanglo
fix(add): Avoid escaping double-quotes by using string literals ### What does this PR try to resolve? Fixes #14002 ### How should we test and review this PR? ### Additional information
2 parents 1f020f0 + c00c5cd commit 8114c9a

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

Cargo.lock

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ tar = { version = "0.4.40", default-features = false }
9696
tempfile = "3.10.1"
9797
thiserror = "1.0.59"
9898
time = { version = "0.3.36", features = ["parsing", "formatting", "serde"] }
99-
toml = "0.8.12"
100-
toml_edit = { version = "0.22.12", features = ["serde"] }
99+
toml = "0.8.14"
100+
toml_edit = { version = "0.22.14", features = ["serde"] }
101101
tracing = "0.1.40" # be compatible with rustc_log: https://github.com/rust-lang/rust/blob/e51e98dde6a/compiler/rustc_log/Cargo.toml#L9
102102
tracing-chrome = "0.7.2"
103103
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }

tests/testsuite/bad_config.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2922,16 +2922,16 @@ fn bad_target_cfg() {
29222922
.with_stderr(
29232923
"\
29242924
[ERROR] error in [..]/foo/.cargo/config.toml: \
2925-
could not load config key `target.\"cfg(not(target_os = \\\"none\\\"))\".runner`
2925+
could not load config key `target.'cfg(not(target_os = \"none\"))'.runner`
29262926
29272927
Caused by:
29282928
error in [..]/foo/.cargo/config.toml: \
2929-
could not load config key `target.\"cfg(not(target_os = \\\"none\\\"))\".runner`
2929+
could not load config key `target.'cfg(not(target_os = \"none\"))'.runner`
29302930
29312931
Caused by:
2932-
invalid configuration for key `target.\"cfg(not(target_os = \\\"none\\\"))\".runner`
2932+
invalid configuration for key `target.'cfg(not(target_os = \"none\"))'.runner`
29332933
expected a string or array of strings, but found a boolean for \
2934-
`target.\"cfg(not(target_os = \\\"none\\\"))\".runner` in [..]/foo/.cargo/config.toml
2934+
`target.'cfg(not(target_os = \"none\"))'.runner` in [..]/foo/.cargo/config.toml
29352935
",
29362936
)
29372937
.run();

tests/testsuite/cargo_add/target_cfg/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn case() {
2828

2929
snapbox::cmd::Command::cargo_ui()
3030
.arg("add")
31-
.arg_line("my-package1 my-package2 --target cfg(unix)")
31+
.arg_line("my-package1 my-package2 --target 'cfg(target_os=\"linux\")'")
3232
.current_dir(cwd)
3333
.assert()
3434
.success()

tests/testsuite/cargo_add/target_cfg/out/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ name = "cargo-list-test-fixture"
55
version = "0.0.0"
66
edition = "2015"
77

8-
[target."cfg(unix)".dependencies]
8+
[target.'cfg(target_os="linux")'.dependencies]
99
my-package1 = "99999.0.0"
1010
my-package2 = "99999.0.0"

tests/testsuite/cargo_add/target_cfg/stderr.term.svg

+3-3
Loading

tests/testsuite/cargo_config/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ build.rustflags = [\"--flag-global\", \"--flag-directory\"]
8888
extra-table.somekey = \"somevalue\"
8989
profile.dev.opt-level = 3
9090
profile.dev.package.foo.opt-level = 1
91-
target.\"cfg(target_os = \\\"linux\\\")\".runner = \"runme\"
91+
target.'cfg(target_os = \"linux\")'.runner = \"runme\"
9292
# The following environment variables may affect the loaded values.
9393
# CARGO_ALIAS_BAR=[..]cat dog[..]
9494
# CARGO_BUILD_JOBS=100
@@ -265,7 +265,7 @@ build.rustflags = [
265265
extra-table.somekey = \"somevalue\" # [ROOT]/home/.cargo/config.toml
266266
profile.dev.opt-level = 3 # [ROOT]/home/.cargo/config.toml
267267
profile.dev.package.foo.opt-level = 1 # [ROOT]/home/.cargo/config.toml
268-
target.\"cfg(target_os = \\\"linux\\\")\".runner = \"runme\" # [ROOT]/home/.cargo/config.toml
268+
target.'cfg(target_os = \"linux\")'.runner = \"runme\" # [ROOT]/home/.cargo/config.toml
269269
# The following environment variables may affect the loaded values.
270270
# CARGO_HOME=[ROOT]/home/.cargo
271271
",
@@ -361,7 +361,7 @@ build.rustflags = [\"--flag-global\"]
361361
extra-table.somekey = \"somevalue\"
362362
profile.dev.opt-level = 3
363363
profile.dev.package.foo.opt-level = 1
364-
target.\"cfg(target_os = \\\"linux\\\")\".runner = \"runme\"
364+
target.'cfg(target_os = \"linux\")'.runner = \"runme\"
365365
366366
",
367367
)
@@ -513,7 +513,7 @@ build.rustflags = [\"--flag-global\"]
513513
extra-table.somekey = \"somevalue\"
514514
profile.dev.opt-level = 3
515515
profile.dev.package.foo.opt-level = 1
516-
target.\"cfg(target_os = \\\"linux\\\")\".runner = \"runme\"
516+
target.'cfg(target_os = \"linux\")'.runner = \"runme\"
517517
518518
",
519519
)

0 commit comments

Comments
 (0)