Skip to content

Commit 16d979f

Browse files
committed
fix(manifest): Be more direct in infostring errors
1 parent fbe6193 commit 16d979f

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed

src/cargo/util/toml/embedded.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ pub(super) fn expand_manifest(content: &str) -> Result<String, FrontmatterError>
1212
Some(other) => {
1313
if let Some(remainder) = other.strip_prefix("cargo,") {
1414
return Err(FrontmatterError::new(
15-
format!(
16-
"cargo does not support frontmatter infostring attributes like `{remainder}` at this time"
17-
),
15+
format!("unsupported frontmatter infostring attributes: `{remainder}`"),
1816
source.info_span().unwrap(),
1917
));
2018
} else {
2119
return Err(FrontmatterError::new(
2220
format!(
23-
"frontmatter infostring `{other}` is unsupported by cargo; specify `cargo` for embedding a manifest"
21+
"unsupported frontmatter infostring `{other}`; specify `cargo` for embedding a manifest"
2422
),
2523
source.info_span().unwrap(),
2624
));

tests/testsuite/script/rustc_fixtures/dot-in-infostring-leading.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[ERROR] frontmatter infostring `.toml` is unsupported by cargo; specify `cargo` for embedding a manifest
1+
[ERROR] unsupported frontmatter infostring `.toml`; specify `cargo` for embedding a manifest
22
--> script:1:4
33
|
44
1 | ---.toml

tests/testsuite/script/rustc_fixtures/dot-in-infostring-non-leading.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[ERROR] frontmatter infostring `Cargo.toml` is unsupported by cargo; specify `cargo` for embedding a manifest
1+
[ERROR] unsupported frontmatter infostring `Cargo.toml`; specify `cargo` for embedding a manifest
22
--> script:1:4
33
|
44
1 | ---Cargo.toml

tests/testsuite/script/rustc_fixtures/hyphen-in-infostring-leading.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[ERROR] frontmatter infostring `-toml` is unsupported by cargo; specify `cargo` for embedding a manifest
1+
[ERROR] unsupported frontmatter infostring `-toml`; specify `cargo` for embedding a manifest
22
--> script:1:5
33
|
44
1 | --- -toml

tests/testsuite/script/rustc_fixtures/hyphen-in-infostring-non-leading.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[ERROR] frontmatter infostring `Cargo-toml` is unsupported by cargo; specify `cargo` for embedding a manifest
1+
[ERROR] unsupported frontmatter infostring `Cargo-toml`; specify `cargo` for embedding a manifest
22
--> script:1:5
33
|
44
1 | --- Cargo-toml

tests/testsuite/script/rustc_fixtures/infostring-fail.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[ERROR] cargo does not support frontmatter infostring attributes like `clippy` at this time
1+
[ERROR] unsupported frontmatter infostring attributes: `clippy`
22
--> script:1:4
33
|
44
1 | ---cargo,clippy

0 commit comments

Comments
 (0)