fix(add): Avoid escaping double-quotes by using string literals

Fixes #14002
This commit is contained in:
Ed Page 2024-06-03 11:22:00 -05:00
parent 5c3b534101
commit c00c5cd1cf
5 changed files with 19 additions and 19 deletions

16
Cargo.lock generated
View file

@ -3119,9 +3119,9 @@ dependencies = [
[[package]]
name = "serde_spanned"
version = "0.6.5"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1"
checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0"
dependencies = [
"serde",
]
@ -3444,9 +3444,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "toml"
version = "0.8.12"
version = "0.8.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3"
checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335"
dependencies = [
"serde",
"serde_spanned",
@ -3456,18 +3456,18 @@ dependencies = [
[[package]]
name = "toml_datetime"
version = "0.6.5"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1"
checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf"
dependencies = [
"serde",
]
[[package]]
name = "toml_edit"
version = "0.22.12"
version = "0.22.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef"
checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38"
dependencies = [
"indexmap",
"serde",

View file

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

View file

@ -2922,16 +2922,16 @@ fn bad_target_cfg() {
.with_stderr(
"\
[ERROR] error in [..]/foo/.cargo/config.toml: \
could not load config key `target.\"cfg(not(target_os = \\\"none\\\"))\".runner`
could not load config key `target.'cfg(not(target_os = \"none\"))'.runner`
Caused by:
error in [..]/foo/.cargo/config.toml: \
could not load config key `target.\"cfg(not(target_os = \\\"none\\\"))\".runner`
could not load config key `target.'cfg(not(target_os = \"none\"))'.runner`
Caused by:
invalid configuration for key `target.\"cfg(not(target_os = \\\"none\\\"))\".runner`
invalid configuration for key `target.'cfg(not(target_os = \"none\"))'.runner`
expected a string or array of strings, but found a boolean for \
`target.\"cfg(not(target_os = \\\"none\\\"))\".runner` in [..]/foo/.cargo/config.toml
`target.'cfg(not(target_os = \"none\"))'.runner` in [..]/foo/.cargo/config.toml
",
)
.run();

View file

@ -5,6 +5,6 @@ name = "cargo-list-test-fixture"
version = "0.0.0"
edition = "2015"
[target."cfg(target_os=/"linux/")".dependencies]
[target.'cfg(target_os="linux")'.dependencies]
my-package1 = "99999.0.0"
my-package2 = "99999.0.0"

View file

@ -88,7 +88,7 @@ build.rustflags = [\"--flag-global\", \"--flag-directory\"]
extra-table.somekey = \"somevalue\"
profile.dev.opt-level = 3
profile.dev.package.foo.opt-level = 1
target.\"cfg(target_os = \\\"linux\\\")\".runner = \"runme\"
target.'cfg(target_os = \"linux\")'.runner = \"runme\"
# The following environment variables may affect the loaded values.
# CARGO_ALIAS_BAR=[..]cat dog[..]
# CARGO_BUILD_JOBS=100
@ -265,7 +265,7 @@ build.rustflags = [
extra-table.somekey = \"somevalue\" # [ROOT]/home/.cargo/config.toml
profile.dev.opt-level = 3 # [ROOT]/home/.cargo/config.toml
profile.dev.package.foo.opt-level = 1 # [ROOT]/home/.cargo/config.toml
target.\"cfg(target_os = \\\"linux\\\")\".runner = \"runme\" # [ROOT]/home/.cargo/config.toml
target.'cfg(target_os = \"linux\")'.runner = \"runme\" # [ROOT]/home/.cargo/config.toml
# The following environment variables may affect the loaded values.
# CARGO_HOME=[ROOT]/home/.cargo
",
@ -361,7 +361,7 @@ build.rustflags = [\"--flag-global\"]
extra-table.somekey = \"somevalue\"
profile.dev.opt-level = 3
profile.dev.package.foo.opt-level = 1
target.\"cfg(target_os = \\\"linux\\\")\".runner = \"runme\"
target.'cfg(target_os = \"linux\")'.runner = \"runme\"
",
)
@ -513,7 +513,7 @@ build.rustflags = [\"--flag-global\"]
extra-table.somekey = \"somevalue\"
profile.dev.opt-level = 3
profile.dev.package.foo.opt-level = 1
target.\"cfg(target_os = \\\"linux\\\")\".runner = \"runme\"
target.'cfg(target_os = \"linux\")'.runner = \"runme\"
",
)