Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cargo/ops/cargo_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ impl<'gctx> InstallablePackage<'gctx> {
);
} else if src.path().join("cargo.toml").exists() {
bail!(
"`{}` does not contain a Cargo.toml file, but found cargo.toml please try to rename it to Cargo.toml. \
"`{}` does not contain a Cargo.toml file, but does contain cargo.toml. Please try to rename it to Cargo.toml. \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably add a help: and in the future we migrate to annotate-snippets

Suggested change
"`{}` does not contain a Cargo.toml file, but does contain cargo.toml. Please try to rename it to Cargo.toml. \
"`{}` does not contain a Cargo.toml file, but does contain cargo.toml\nhelp: try to rename it to Cargo.toml

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this is more in line with the style guide:

Suggested change
"`{}` does not contain a Cargo.toml file, but does contain cargo.toml. Please try to rename it to Cargo.toml. \
"`{}` does not contain a `Cargo.toml` file
help: a `cargo.toml` exists

--path must point to a directory containing a Cargo.toml file.",
src.path().display()
)
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/sources/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ fn read_packages(
None => {
if find_project_manifest_exact(path, "cargo.toml").is_ok() {
Err(anyhow::format_err!(
"Could not find Cargo.toml in `{}`, but found cargo.toml please try to rename it to Cargo.toml",
"Could not find Cargo.toml in `{}`, but found cargo.toml. Please try to rename it to Cargo.toml",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

path.display()
))
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/util/important_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ pub fn find_root_manifest_for_wd(cwd: &Path) -> CargoResult<PathBuf> {

if invalid_cargo_toml_path_exists {
anyhow::bail!(
"could not find `{}` in `{}` or any parent directory, but found cargo.toml please try to rename it to Cargo.toml",
"Could not find `{}` in `{}` or any parent directory, but found cargo.toml. Please try to rename it to Cargo.toml",
valid_cargo_toml_file_name,
cwd.display()
)
} else {
anyhow::bail!(
"could not find `{}` in `{}` or any parent directory",
"Could not find `{}` in `{}` or any parent directory",
valid_cargo_toml_file_name,
cwd.display()
)
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ fn cargo_compile_with_lowercase_cargo_toml() {
p.cargo("build")
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] could not find `Cargo.toml` in `[ROOT]/foo` or any parent directory, but found cargo.toml please try to rename it to Cargo.toml
[ERROR] could not find `Cargo.toml` in `[ROOT]/foo` or any parent directory, but found cargo.toml. Please try to rename it to Cargo.toml

"#]])
.run();
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ fn install_path_with_lowercase_cargo_toml() {
cargo_process("install --path .")
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] `[ROOT]` does not contain a Cargo.toml file, but found cargo.toml please try to rename it to Cargo.toml. --path must point to a directory containing a Cargo.toml file.
[ERROR] `[ROOT]` does not contain a Cargo.toml file, but does contain cargo.toml. Please try to rename it to Cargo.toml. --path must point to a directory containing a Cargo.toml file.

"#]]
)
Expand Down Expand Up @@ -1064,7 +1064,7 @@ fn git_repo_with_lowercase_cargo_toml() {
.with_status(101)
.with_stderr_data(str![[r#"
[UPDATING] git repository [..]
[ERROR] Could not find Cargo.toml in `[..]`, but found cargo.toml please try to rename it to Cargo.toml
[ERROR] Could not find Cargo.toml in `[..]`, but found cargo.toml. Please try to rename it to Cargo.toml

"#]]
)
Expand Down
Loading