Skip to content

Commit b746397

Browse files
committed
Skip clean up profile.release.package."*"
1 parent d14c85f commit b746397

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/bin/cargo/commands/remove.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ fn gc_workspace(workspace: &Workspace<'_>) -> CargoResult<()> {
216216
//
217217
// Example tables:
218218
// - profile.dev.package.foo
219-
// - profile.release.package."*"
220219
// - profile.release.package."foo:2.1.0"
221220
if let Some(toml_edit::Item::Table(profile_section_table)) = manifest.get_mut("profile") {
222221
profile_section_table.set_implicit(true);
@@ -231,8 +230,14 @@ fn gc_workspace(workspace: &Workspace<'_>) -> CargoResult<()> {
231230
package_table.set_implicit(true);
232231

233232
for (key, item) in package_table.iter_mut() {
233+
let key = key.get();
234+
// Skip globs. Can't do anything with them.
235+
// For example, profile.release.package."*".
236+
if crate::util::restricted_names::is_glob_pattern(key) {
237+
continue;
238+
}
234239
if !spec_has_match(
235-
&PackageIdSpec::parse(key.get())?,
240+
&PackageIdSpec::parse(key)?,
236241
&dependencies,
237242
workspace.config(),
238243
)? {

0 commit comments

Comments
 (0)