Skip to content
Merged
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
8 changes: 6 additions & 2 deletions src/cargo/util/toml_mut/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,13 @@ fn non_existent_dependency_err(
) -> anyhow::Error {
let mut msg = format!("the dependency `{name}` could not be found in `{search_table}`");
if let Some(found_table) = found_table {
msg.push_str(&format!("; it is present in `{found_table}`",));
msg.push_str(&format!(
"\n\nhelp: a dependency with the same name exists in `{found_table}`"
));
} else if let Some(alt_name) = alt_name {
msg.push_str(&format!("; dependency `{alt_name}` exists",));
msg.push_str(&format!(
"\n\nhelp: a dependency with a similar name exists: `{alt_name}`"
));
}
anyhow::format_err!(msg)
}
Expand Down
10 changes: 7 additions & 3 deletions tests/testsuite/cargo_remove/invalid_dep/stderr.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions tests/testsuite/cargo_remove/invalid_section/stderr.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions tests/testsuite/cargo_remove/invalid_section_dep/stderr.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions tests/testsuite/cargo_remove/invalid_target/stderr.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions tests/testsuite/cargo_remove/invalid_target_dep/stderr.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.