From acb15135fa555fdb92e69e613079eb178090afcf Mon Sep 17 00:00:00 2001 From: Marcel Hlopko Date: Fri, 1 Dec 2023 17:24:48 +0100 Subject: [PATCH] Improve the error message when crate root couldn't be found. (#2296) Co-authored-by: scentini --- rust/private/utils.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/private/utils.bzl b/rust/private/utils.bzl index 7b0fe23e9b..89c41bbe04 100644 --- a/rust/private/utils.bzl +++ b/rust/private/utils.bzl @@ -707,7 +707,7 @@ def crate_root_src(name, srcs, crate_type): ) if not crate_root: file_names = [default_crate_root_filename, name + ".rs"] - fail("No {} source file found.".format(" or ".join(file_names)), "srcs") + fail("Couldn't find {} among `srcs`, please use `crate_root` to specify the root file.".format(" or ".join(file_names))) return crate_root def _shortest_src_with_basename(srcs, basename):