File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ use crate::util::toml_mut::manifest::LocalManifest;
1414use crate :: util:: toml_mut:: upgrade:: upgrade_requirement;
1515use crate :: util:: { style, OptVersionReq } ;
1616use crate :: util:: { CargoResult , VersionExt } ;
17+ use anyhow:: Context as _;
1718use itertools:: Itertools ;
1819use semver:: { Op , Version , VersionReq } ;
1920use std:: cmp:: Ordering ;
@@ -224,7 +225,10 @@ pub fn upgrade_manifests(
224225
225226 let to_update = to_update
226227 . iter ( )
227- . map ( |s| PackageIdSpec :: parse ( s) )
228+ . map ( |spec| {
229+ PackageIdSpec :: parse ( spec)
230+ . with_context ( || format ! ( "invalid package ID specification: `{spec}`" ) )
231+ } )
228232 . collect :: < Result < Vec < _ > , _ > > ( ) ?;
229233
230234 // Updates often require a lot of modifications to the registry, so ensure
Original file line number Diff line number Diff line change @@ -2263,7 +2263,10 @@ fn update_breaking_spec_version() {
22632263 . masquerade_as_nightly_cargo ( & [ "update-breaking" ] )
22642264 . with_status ( 101 )
22652265 . with_stderr_data ( str![ [ r#"
2266- [ERROR] expected a version like "1.32"
2266+ [ERROR] invalid package ID specification: `incompatible@foo`
2267+
2268+ Caused by:
2269+ expected a version like "1.32"
22672270
22682271"# ] ] )
22692272 . run ( ) ;
You can’t perform that action at this time.
0 commit comments