@@ -210,7 +210,8 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
210210 // `b`, and we uploaded `a` and `b` but only confirmed `a`, then on
211211 // the following pass through the outer loop nothing will be ready for
212212 // upload.
213- for pkg_id in plan. take_ready ( ) {
213+ let mut ready = plan. take_ready ( ) ;
214+ while let Some ( pkg_id) = ready. pop_first ( ) {
214215 let ( pkg, ( _features, tarball) ) = & pkg_dep_graph. packages [ & pkg_id] ;
215216 opts. gctx . shell ( ) . status ( "Uploading" , pkg. package_id ( ) ) ?;
216217
@@ -236,6 +237,19 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
236237 ) ?) ) ;
237238 }
238239
240+ let workspace_context = || {
241+ let mut remaining = ready. clone ( ) ;
242+ remaining. extend ( plan. iter ( ) ) ;
243+ if !remaining. is_empty ( ) {
244+ format ! (
245+ "\n \n note: the following crates have not been published yet:\n {}" ,
246+ remaining. into_iter( ) . join( "\n " )
247+ )
248+ } else {
249+ String :: new ( )
250+ }
251+ } ;
252+
239253 transmit (
240254 opts. gctx ,
241255 ws,
@@ -244,6 +258,7 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
244258 & mut registry,
245259 source_ids. original ,
246260 opts. dry_run ,
261+ workspace_context,
247262 ) ?;
248263 to_confirm. insert ( pkg_id) ;
249264
@@ -632,6 +647,7 @@ fn transmit(
632647 registry : & mut Registry ,
633648 registry_id : SourceId ,
634649 dry_run : bool ,
650+ workspace_context : impl Fn ( ) -> String ,
635651) -> CargoResult < ( ) > {
636652 let new_crate = prepare_transmit ( gctx, ws, pkg, registry_id) ?;
637653
@@ -643,10 +659,11 @@ fn transmit(
643659
644660 let warnings = registry. publish ( & new_crate, tarball) . with_context ( || {
645661 format ! (
646- "failed to publish {} v{} to registry at {}" ,
662+ "failed to publish {} v{} to registry at {}{} " ,
647663 pkg. name( ) ,
648664 pkg. version( ) ,
649- registry. host( )
665+ registry. host( ) ,
666+ workspace_context( )
650667 )
651668 } ) ?;
652669
0 commit comments