@@ -210,7 +210,8 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
210
210
// `b`, and we uploaded `a` and `b` but only confirmed `a`, then on
211
211
// the following pass through the outer loop nothing will be ready for
212
212
// 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 ( ) {
214
215
let ( pkg, ( _features, tarball) ) = & pkg_dep_graph. packages [ & pkg_id] ;
215
216
opts. gctx . shell ( ) . status ( "Uploading" , pkg. package_id ( ) ) ?;
216
217
@@ -236,6 +237,19 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
236
237
) ?) ) ;
237
238
}
238
239
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
+
239
253
transmit (
240
254
opts. gctx ,
241
255
ws,
@@ -244,6 +258,7 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> {
244
258
& mut registry,
245
259
source_ids. original ,
246
260
opts. dry_run ,
261
+ workspace_context,
247
262
) ?;
248
263
to_confirm. insert ( pkg_id) ;
249
264
@@ -632,6 +647,7 @@ fn transmit(
632
647
registry : & mut Registry ,
633
648
registry_id : SourceId ,
634
649
dry_run : bool ,
650
+ workspace_context : impl Fn ( ) -> String ,
635
651
) -> CargoResult < ( ) > {
636
652
let new_crate = prepare_transmit ( gctx, ws, pkg, registry_id) ?;
637
653
@@ -643,10 +659,11 @@ fn transmit(
643
659
644
660
let warnings = registry. publish ( & new_crate, tarball) . with_context ( || {
645
661
format ! (
646
- "failed to publish {} v{} to registry at {}" ,
662
+ "failed to publish {} v{} to registry at {}{} " ,
647
663
pkg. name( ) ,
648
664
pkg. version( ) ,
649
- registry. host( )
665
+ registry. host( ) ,
666
+ workspace_context( )
650
667
)
651
668
} ) ?;
652
669
0 commit comments