perf: Speed up TOML parsing by upgrading toml (#15736)

### What does this PR try to resolve?

For numbers, see https://epage.github.io/blog/2025/07/toml-09/

Further areas for improvement:
- Enable `fast_hash` (see #15649)
- Only track spans for local manifests, allowing us to skip the
`make_owned` call for most packages

### How to test and review this PR?
This commit is contained in:
Weihang Lo 2025-07-09 16:18:12 +00:00 committed by GitHub
commit f9ee73d6b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 175 additions and 126 deletions

87
Cargo.lock generated
View File

@ -295,7 +295,7 @@ dependencies = [
"cargo_metadata",
"flate2",
"tar",
"toml",
"toml 0.9.0",
]
[[package]]
@ -369,8 +369,8 @@ dependencies = [
"tempfile",
"thiserror 2.0.12",
"time",
"toml",
"toml_edit",
"toml 0.9.0",
"toml_edit 0.23.0",
"tracing",
"tracing-chrome",
"tracing-subscriber",
@ -472,7 +472,7 @@ dependencies = [
"snapbox",
"tar",
"time",
"toml",
"toml 0.9.0",
"url",
"walkdir",
"windows-sys 0.60.2",
@ -510,7 +510,7 @@ dependencies = [
"serde-untagged",
"serde-value",
"thiserror 1.0.69",
"toml",
"toml 0.8.23",
"unicode-xid",
"url",
]
@ -527,7 +527,7 @@ dependencies = [
"serde_json",
"snapbox",
"thiserror 2.0.12",
"toml",
"toml 0.9.0",
"unicode-xid",
"url",
]
@ -3659,6 +3659,15 @@ dependencies = [
"serde",
]
[[package]]
name = "serde_spanned"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83"
dependencies = [
"serde",
]
[[package]]
name = "sha1"
version = "0.10.6"
@ -4039,9 +4048,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362"
dependencies = [
"serde",
"serde_spanned",
"toml_datetime",
"toml_edit",
"serde_spanned 0.6.9",
"toml_datetime 0.6.11",
"toml_edit 0.22.27",
]
[[package]]
name = "toml"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f271e09bde39ab52250160a67e88577e0559ad77e9085de6e9051a2c4353f8f8"
dependencies = [
"indexmap",
"serde",
"serde_spanned 1.0.0",
"toml_datetime 0.7.0",
"toml_parser",
"toml_writer",
"winnow",
]
[[package]]
@ -4053,6 +4077,15 @@ dependencies = [
"serde",
]
[[package]]
name = "toml_datetime"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3"
dependencies = [
"serde",
]
[[package]]
name = "toml_edit"
version = "0.22.27"
@ -4061,18 +4094,48 @@ checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
dependencies = [
"indexmap",
"serde",
"serde_spanned",
"toml_datetime",
"serde_spanned 0.6.9",
"toml_datetime 0.6.11",
"toml_write",
"winnow",
]
[[package]]
name = "toml_edit"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54449f7f7569ce6f57cda7812361961c0f6a77f720802537b5618585b4a7ff4c"
dependencies = [
"indexmap",
"serde",
"serde_spanned 1.0.0",
"toml_datetime 0.7.0",
"toml_parser",
"toml_writer",
"winnow",
]
[[package]]
name = "toml_parser"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5c1c469eda89749d2230d8156a5969a69ffe0d6d01200581cdc6110674d293e"
dependencies = [
"winnow",
]
[[package]]
name = "toml_write"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
[[package]]
name = "toml_writer"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b679217f2848de74cabd3e8fc5e6d66f40b7da40f8e1954d92054d9010690fd5"
[[package]]
name = "tracing"
version = "0.1.41"
@ -4752,7 +4815,7 @@ dependencies = [
name = "xtask-stale-label"
version = "0.0.0"
dependencies = [
"toml_edit",
"toml_edit 0.23.0",
]
[[package]]

View File

@ -105,8 +105,8 @@ tar = { version = "0.4.44", default-features = false }
tempfile = "3.20.0"
thiserror = "2.0.12"
time = { version = "0.3.41", features = ["parsing", "formatting", "serde"] }
toml = { version = "0.8.23", default-features = false }
toml_edit = { version = "0.22.27", features = ["serde"] }
toml = { version = "0.9.0", default-features = false }
toml_edit = { version = "0.23.0", features = ["serde"] }
tracing = { version = "0.1.41", default-features = false, features = ["std"] } # 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.19", features = ["env-filter"] }
@ -211,7 +211,7 @@ tar.workspace = true
tempfile.workspace = true
thiserror.workspace = true
time.workspace = true
toml = { workspace = true, features = ["display", "parse"] }
toml = { workspace = true, features = ["std", "serde", "parse", "display", "preserve_order"] }
toml_edit.workspace = true
tracing = { workspace = true, features = ["attributes"] }
tracing-subscriber.workspace = true

View File

@ -10,7 +10,7 @@ publish = false
cargo_metadata.workspace = true
flate2.workspace = true
tar.workspace = true
toml = { workspace = true, features = ["display", "parse"] }
toml = { workspace = true, features = ["display", "parse", "serde"] }
[lints]
workspace = true

View File

@ -27,7 +27,7 @@ serde_json.workspace = true
snapbox.workspace = true
tar.workspace = true
time.workspace = true
toml = { workspace = true, features = ["display"] }
toml = { workspace = true, features = ["display", "serde"] }
url.workspace = true
walkdir.workspace = true

View File

@ -16,7 +16,7 @@ serde_json = { workspace = true, optional = true }
serde-untagged.workspace = true
serde-value.workspace = true
thiserror.workspace = true
toml.workspace = true
toml = { workspace = true, features = ["serde"] }
unicode-xid.workspace = true
url.workspace = true

View File

@ -63,7 +63,7 @@ impl EitherManifest {
pub struct Manifest {
// alternate forms of manifests:
contents: Rc<String>,
document: Rc<toml_edit::ImDocument<String>>,
document: Rc<toml::Spanned<toml::de::DeTable<'static>>>,
original_toml: Rc<TomlManifest>,
normalized_toml: Rc<TomlManifest>,
summary: Summary,
@ -109,7 +109,7 @@ pub struct Warnings(Vec<DelayedWarning>);
pub struct VirtualManifest {
// alternate forms of manifests:
contents: Rc<String>,
document: Rc<toml_edit::ImDocument<String>>,
document: Rc<toml::Spanned<toml::de::DeTable<'static>>>,
original_toml: Rc<TomlManifest>,
normalized_toml: Rc<TomlManifest>,
@ -496,7 +496,7 @@ compact_debug! {
impl Manifest {
pub fn new(
contents: Rc<String>,
document: Rc<toml_edit::ImDocument<String>>,
document: Rc<toml::Spanned<toml::de::DeTable<'static>>>,
original_toml: Rc<TomlManifest>,
normalized_toml: Rc<TomlManifest>,
summary: Summary,
@ -565,7 +565,7 @@ impl Manifest {
Ok(format!("{}\n{}", MANIFEST_PREAMBLE, toml))
}
/// Collection of spans for the original TOML
pub fn document(&self) -> &toml_edit::ImDocument<String> {
pub fn document(&self) -> &toml::Spanned<toml::de::DeTable<'static>> {
&self.document
}
/// The [`TomlManifest`] as parsed from [`Manifest::document`]
@ -738,7 +738,7 @@ impl Manifest {
impl VirtualManifest {
pub fn new(
contents: Rc<String>,
document: Rc<toml_edit::ImDocument<String>>,
document: Rc<toml::Spanned<toml::de::DeTable<'static>>>,
original_toml: Rc<TomlManifest>,
normalized_toml: Rc<TomlManifest>,
replace: Vec<(PackageIdSpec, Dependency)>,
@ -766,7 +766,7 @@ impl VirtualManifest {
self.contents.as_str()
}
/// Collection of spans for the original TOML
pub fn document(&self) -> &toml_edit::ImDocument<String> {
pub fn document(&self) -> &toml::Spanned<toml::de::DeTable<'static>> {
&self.document
}
/// The [`TomlManifest`] as parsed from [`VirtualManifest::document`]

View File

@ -1043,10 +1043,9 @@ impl GlobalContext {
let def = Definition::Environment(key.as_env_key().to_string());
if self.cli_unstable().advanced_env && env_val.starts_with('[') && env_val.ends_with(']') {
// Parse an environment string as a TOML array.
let toml_v = toml::Value::deserialize(toml::de::ValueDeserializer::new(&env_val))
.map_err(|e| {
ConfigError::new(format!("could not parse TOML list: {}", e), def.clone())
})?;
let toml_v = env_val.parse::<toml::Value>().map_err(|e| {
ConfigError::new(format!("could not parse TOML list: {}", e), def.clone())
})?;
let values = toml_v.as_array().expect("env var was not array");
for value in values {
// TODO: support other types.

View File

@ -6,7 +6,6 @@ use pathdiff::diff_paths;
use std::fmt::Display;
use std::ops::Range;
use std::path::Path;
use toml_edit::ImDocument;
const LINT_GROUPS: &[LintGroup] = &[TEST_DUMMY_UNSTABLE];
pub const LINTS: &[Lint] = &[IM_A_TEAPOT, UNKNOWN_LINTS];
@ -16,7 +15,7 @@ pub fn analyze_cargo_lints_table(
path: &Path,
pkg_lints: &TomlToolLints,
ws_contents: &str,
ws_document: &ImDocument<String>,
ws_document: &toml::Spanned<toml::de::DeTable<'static>>,
ws_path: &Path,
gctx: &GlobalContext,
) -> CargoResult<()> {
@ -116,7 +115,7 @@ fn verify_feature_enabled(
manifest: &Manifest,
manifest_path: &str,
ws_contents: &str,
ws_document: &ImDocument<String>,
ws_document: &toml::Spanned<toml::de::DeTable<'static>>,
ws_path: &str,
error_count: &mut usize,
gctx: &GlobalContext,
@ -191,43 +190,33 @@ fn verify_feature_enabled(
}
pub fn get_span(
document: &ImDocument<String>,
document: &toml::Spanned<toml::de::DeTable<'static>>,
path: &[&str],
get_value: bool,
) -> Option<Range<usize>> {
let mut table = document.as_item().as_table_like()?;
let mut table = document.get_ref();
let mut iter = path.into_iter().peekable();
while let Some(key) = iter.next() {
let (key, item) = table.get_key_value(key)?;
let key_s: &str = key.as_ref();
let (key, item) = table.get_key_value(key_s)?;
if iter.peek().is_none() {
return if get_value {
item.span()
Some(item.span())
} else {
let leaf_decor = key.dotted_decor();
let leaf_prefix_span = leaf_decor.prefix().and_then(|p| p.span());
let leaf_suffix_span = leaf_decor.suffix().and_then(|s| s.span());
if let (Some(leaf_prefix_span), Some(leaf_suffix_span)) =
(leaf_prefix_span, leaf_suffix_span)
{
Some(leaf_prefix_span.start..leaf_suffix_span.end)
} else {
key.span()
}
Some(key.span())
};
}
if item.is_table_like() {
table = item.as_table_like().unwrap();
if let Some(next_table) = item.get_ref().as_table() {
table = next_table;
}
if item.is_array() && iter.peek().is_some() {
let array = item.as_array().unwrap();
let next = iter.next().unwrap();
return array.iter().find_map(|item| {
if next == &item.to_string() {
item.span()
} else {
None
}
});
if iter.peek().is_some() {
if let Some(array) = item.get_ref().as_array() {
let next = iter.next().unwrap();
return array.iter().find_map(|item| match item.get_ref() {
toml::de::DeValue::String(s) if s == next => Some(item.span()),
_ => None,
});
}
}
}
None
@ -511,7 +500,7 @@ fn output_unknown_lints(
manifest_path: &str,
pkg_lints: &TomlToolLints,
ws_contents: &str,
ws_document: &ImDocument<String>,
ws_document: &toml::Spanned<toml::de::DeTable<'static>>,
ws_path: &str,
error_count: &mut usize,
gctx: &GlobalContext,

View File

@ -19,7 +19,6 @@ use cargo_util_schemas::manifest::{RustVersion, StringOrBool};
use itertools::Itertools;
use lazycell::LazyCell;
use pathdiff::diff_paths;
use toml_edit::ImDocument;
use url::Url;
use crate::core::compiler::{CompileKind, CompileTarget};
@ -166,16 +165,28 @@ fn read_toml_string(path: &Path, is_embedded: bool, gctx: &GlobalContext) -> Car
}
#[tracing::instrument(skip_all)]
fn parse_document(contents: &str) -> Result<toml_edit::ImDocument<String>, toml_edit::de::Error> {
toml_edit::ImDocument::parse(contents.to_owned()).map_err(Into::into)
fn parse_document(
contents: &str,
) -> Result<toml::Spanned<toml::de::DeTable<'static>>, toml::de::Error> {
let mut table = toml::de::DeTable::parse(contents)?;
table.get_mut().make_owned();
// SAFETY: `DeTable::make_owned` ensures no borrows remain and the lifetime does not affect
// layout
let table = unsafe {
std::mem::transmute::<
toml::Spanned<toml::de::DeTable<'_>>,
toml::Spanned<toml::de::DeTable<'static>>,
>(table)
};
Ok(table)
}
#[tracing::instrument(skip_all)]
fn deserialize_toml(
document: &toml_edit::ImDocument<String>,
) -> Result<manifest::TomlManifest, toml_edit::de::Error> {
document: &toml::Spanned<toml::de::DeTable<'static>>,
) -> Result<manifest::TomlManifest, toml::de::Error> {
let mut unused = BTreeSet::new();
let deserializer = toml_edit::de::Deserializer::from(document.clone());
let deserializer = toml::de::Deserializer::from(document.clone());
let mut document: manifest::TomlManifest = serde_ignored::deserialize(deserializer, |path| {
let mut key = String::new();
stringify(&mut key, &path);
@ -1256,7 +1267,7 @@ fn deprecated_ws_default_features(
#[tracing::instrument(skip_all)]
pub fn to_real_manifest(
contents: String,
document: toml_edit::ImDocument<String>,
document: toml::Spanned<toml::de::DeTable<'static>>,
original_toml: manifest::TomlManifest,
normalized_toml: manifest::TomlManifest,
features: Features,
@ -1843,7 +1854,7 @@ pub fn to_real_manifest(
fn missing_dep_diagnostic(
missing_dep: &MissingDependencyError,
orig_toml: &TomlManifest,
document: &ImDocument<String>,
document: &toml::Spanned<toml::de::DeTable<'static>>,
contents: &str,
manifest_file: &Path,
gctx: &GlobalContext,
@ -1921,7 +1932,7 @@ fn missing_dep_diagnostic(
fn to_virtual_manifest(
contents: String,
document: toml_edit::ImDocument<String>,
document: toml::Spanned<toml::de::DeTable<'static>>,
original_toml: manifest::TomlManifest,
normalized_toml: manifest::TomlManifest,
features: Features,
@ -2761,7 +2772,7 @@ fn lints_to_rustflags(lints: &manifest::TomlLints) -> CargoResult<Vec<String>> {
}
fn emit_diagnostic(
e: toml_edit::de::Error,
e: toml::de::Error,
contents: &str,
manifest_file: &Path,
gctx: &GlobalContext,

View File

@ -751,13 +751,11 @@ fn bad_registry_name() {
[ERROR] invalid character ` ` in registry name: `bad name`, characters must be Unicode XID characters (numbers, `-`, `_`, or most letters)
--> Cargo.toml:8:17
|
8 | / [dependencies.bar]
9 | | version = "0.0.1"
10 | | registry = "bad name"
| |_____________________________________^
|
--> Cargo.toml:8:17
|
8 | [dependencies.bar]
| ^^^^^^^^^^^^^^^^^^
|
"#]])
.run();

View File

@ -172,7 +172,7 @@ Caused by:
|
1 | 4
| ^
expected `.`, `=`
key with no value, expected `=`
"#]])
.run();
@ -454,8 +454,7 @@ fn malformed_override() {
p.cargo("check")
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] invalid inline table
expected `}`
[ERROR] newlines are unsupported in inline tables, expected nothing
--> Cargo.toml:9:27
|
9 | native = {
@ -2130,8 +2129,7 @@ Caused by:
|
1 | [bar] baz = 2
| ^
invalid table header
expected newline, `#`
unexpected key or value, expected newline, `#`
"#]])
.run();

View File

@ -377,11 +377,11 @@ Caused by:
could not parse TOML configuration in `[ROOT]/foo/.cargo/config.toml`
Caused by:
TOML parse error at line 1, column 1
TOML parse error at line 1, column 2
|
1 | !
| ^
invalid key
| ^
key with no value, expected `=`
"#]])
.run();
@ -418,12 +418,11 @@ fn cargo_compile_with_invalid_manifest2() {
p.cargo("build")
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] invalid string
expected `"`, `'`
[ERROR] string values must be quoted, expected literal string
--> Cargo.toml:3:23
|
3 | foo = bar
| ^
| ^^^
|
"#]])
@ -437,12 +436,11 @@ fn cargo_compile_with_invalid_manifest3() {
p.cargo("build --manifest-path src/Cargo.toml")
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] invalid string
expected `"`, `'`
[ERROR] string values must be quoted, expected literal string
--> src/Cargo.toml:1:5
|
1 | a = bar
| ^
| ^^^
|
"#]])
@ -2740,7 +2738,7 @@ Caused by:
|
1 | this is not valid toml
| ^
expected `.`, `=`
key with no value, expected `=`
"#]])
.run();

View File

@ -1,4 +1,4 @@
<svg width="740px" height="164px" xmlns="http://www.w3.org/2000/svg">
<svg width="740px" height="146px" xmlns="http://www.w3.org/2000/svg">
<style>
.fg { fill: #AAAAAA }
.bg { background: #000000 }
@ -19,21 +19,19 @@
<rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
<text xml:space="preserve" class="container fg">
<tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error</tspan><tspan>: </tspan><tspan class="bold">invalid string</tspan>
<tspan x="10px" y="28px"><tspan class="fg-bright-red bold">error</tspan><tspan>: </tspan><tspan class="bold">invalid float, expected `inf`</tspan>
</tspan>
<tspan x="10px" y="46px"><tspan class="bold">expected `"`, `'`</tspan>
<tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> Cargo.toml:9:7</tspan>
</tspan>
<tspan x="10px" y="64px"><tspan> </tspan><tspan class="fg-bright-blue bold">--&gt;</tspan><tspan> Cargo.toml:9:7</tspan>
<tspan x="10px" y="64px"><tspan> </tspan><tspan class="fg-bright-blue bold">|</tspan>
</tspan>
<tspan x="10px" y="82px"><tspan> </tspan><tspan class="fg-bright-blue bold">|</tspan>
<tspan x="10px" y="82px"><tspan class="fg-bright-blue bold">9 |</tspan><tspan> key = invalid-value</tspan>
</tspan>
<tspan x="10px" y="100px"><tspan class="fg-bright-blue bold">9 |</tspan><tspan> key = invalid-value</tspan>
<tspan x="10px" y="100px"><tspan> </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan> </tspan><tspan class="fg-bright-red bold">^^^^^^^^^^^^^</tspan>
</tspan>
<tspan x="10px" y="118px"><tspan> </tspan><tspan class="fg-bright-blue bold">|</tspan><tspan> </tspan><tspan class="fg-bright-red bold">^</tspan>
<tspan x="10px" y="118px"><tspan> </tspan><tspan class="fg-bright-blue bold">|</tspan>
</tspan>
<tspan x="10px" y="136px"><tspan> </tspan><tspan class="fg-bright-blue bold">|</tspan>
</tspan>
<tspan x="10px" y="154px">
<tspan x="10px" y="136px">
</tspan>
</text>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -58,8 +58,7 @@ Caused by:
|
3 | b-cargo-test = `
| ^
invalid string
expected `"`, `'`
string values must be quoted, expected literal string
"#]])
.run();

View File

@ -859,7 +859,7 @@ Caused by:
|
1 | asdf
| ^
expected `.`, `=`
key with no value, expected `=`
"#]],
);
@ -931,9 +931,8 @@ expected a list, but found a integer for `l3` in [ROOT]/.cargo/config.toml
error in environment variable `CARGO_BAD_ENV`: could not parse TOML list: TOML parse error at line 1, column 2
|
1 | [zzz]
| ^
invalid array
expected `]`
| ^^^
string values must be quoted, expected literal string
"#]],
);
@ -1221,8 +1220,8 @@ Caused by:
TOML parse error at line 3, column 1
|
3 | ssl-version.min = 'tlsv1.2'
| ^
dotted key `ssl-version` attempted to extend non-table type (string)
| ^^^^^^^^^^^
cannot extend value of type string with a dotted key
"#]],
);

View File

@ -402,7 +402,7 @@ Caused by:
|
1 | abc
| ^
expected `.`, `=`
key with no value, expected `=`
"#]],
);
@ -580,7 +580,7 @@ Caused by:
|
1 | missing.toml
| ^
expected `.`, `=`
key with no value, expected `=`
"#]],
);

View File

@ -1277,8 +1277,7 @@ fn unused_ambiguous_published_deps() {
p.cargo("build").run();
p.cargo("run")
.with_stderr_data(str![[r#"
[ERROR] invalid table header
expected `.`, `]`
[ERROR] unclosed table, expected `]`
--> ../home/.cargo/git/checkouts/dep-[HASH]/[..]/invalid/Cargo.toml:2:29
|
2 | [package
@ -2809,11 +2808,11 @@ fn invalid_git_dependency_manifest() {
.with_status(101)
.with_stderr_data(str![[r#"
[UPDATING] git repository `[ROOTURL]/dep1`
[ERROR] duplicate key `categories` in table `package`
[ERROR] duplicate key
--> ../home/.cargo/git/checkouts/dep1-[HASH]/[..]/Cargo.toml:9:21
|
9 | categories = ["algorithms"]
| ^
| ^^^^^^^^^^
|
[ERROR] failed to get `dep1` as a dependency of package `foo v0.5.0 ([ROOT]/foo)`

View File

@ -1407,12 +1407,11 @@ fn error_malformed_workspace_root() {
.cwd("bar")
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] invalid array
expected `]`
--> ../Cargo.toml:3:24
[ERROR] unclosed array, expected `]`
--> ../Cargo.toml:4:13
|
3 | members = [invalid toml
| ^
4 | ...
| ^
|
"#]])

View File

@ -1120,11 +1120,11 @@ Caused by:
invalid TOML found for metadata
Caused by:
TOML parse error at line 1, column 1
TOML parse error at line 1, column 4
|
1 | v1]
| ^
invalid key
| ^
key with no value, expected `=`
"#]])
.run();

View File

@ -50,8 +50,7 @@ fn toml_deserialize_manifest_error() {
p.cargo("check")
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] invalid string
expected `"`, `'`
[ERROR] extra `=`, expected nothing
--> bar/Cargo.toml:8:25
|
8 | foobar == "0.55"

View File

@ -1114,7 +1114,7 @@ fn new_warning_with_corrupt_ws() {
let p = project().file("Cargo.toml", "asdf").build();
p.cargo("new bar").with_stderr_data(str![[r#"
[CREATING] binary (application) `bar` package
[ERROR] expected `.`, `=`
[ERROR] key with no value, expected `=`
--> Cargo.toml:1:5
|
1 | asdf
@ -1395,7 +1395,7 @@ fn error_if_parent_cargo_toml_is_invalid() {
.cwd("bar")
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] expected `.`, `=`
[ERROR] key with no value, expected `=`
--> ../Cargo.toml:1:9
|
1 | Totally not a TOML file