Skip to content

Commit 682e5a5

Browse files
committed
Properly handle the return value of promote_files_registered_in_last_run
Signed-off-by: Ambre Austen Suhamy <[email protected]>
1 parent 8525717 commit 682e5a5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/dune_rpc_impl/server.ml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,15 @@ let handler (t : _ t Fdecl.t) handle : 'build_arg Dune_rpc_server.Handler.t =
369369
(* A 'successful' formatting means there is nothing to promote. *)
370370
| Success -> ()
371371
| Failure ->
372-
let _is_necessarily_empty =
372+
let missing =
373373
Promote.Diff_promotion.promote_files_registered_in_last_run
374374
Dune_rpc.Files_to_promote.All
375375
in
376+
if List.is_non_empty missing
377+
then
378+
Code_error.raise
379+
"promote_files_registered_in_last_run All should always return an empty list"
380+
[];
376381
()
377382
in
378383
Handler.implement_request rpc Procedures.Public.format f
@@ -447,7 +452,7 @@ let handler (t : _ t Fdecl.t) handle : 'build_arg Dune_rpc_server.Handler.t =
447452
let () =
448453
let f _ path =
449454
let files = For_handlers.source_path_of_string path in
450-
let _ignored =
455+
let _ignored : Path.Source.t list =
451456
Promote.Diff_promotion.promote_files_registered_in_last_run (These [ files ])
452457
in
453458
Fiber.return ()

0 commit comments

Comments
 (0)