summaryrefslogtreecommitdiff
path: root/rust/compiler.go
diff options
context:
space:
mode:
author Seth Moore <sethmo@google.com> 2021-10-14 15:25:17 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2021-10-14 15:25:17 +0000
commit6ec96b8102d72023edd92aadac2fae605a72d2e7 (patch)
tree7688349c539b91880929b4a51a1fc22c50ab2ce1 /rust/compiler.go
parent47a6c598195d6757fa1ecc39b039879cd2fe0bbc (diff)
parent3afac0b36fc843e46bdbe43ab6fe57c794f12a5f (diff)
Merge "Flag an error on empty rust module srcs"
Diffstat (limited to 'rust/compiler.go')
-rw-r--r--rust/compiler.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/rust/compiler.go b/rust/compiler.go
index 1ce71f60b..cada9854a 100644
--- a/rust/compiler.go
+++ b/rust/compiler.go
@@ -449,6 +449,10 @@ func (compiler *baseCompiler) relativeInstallPath() string {
// Returns the Path for the main source file along with Paths for generated source files from modules listed in srcs.
func srcPathFromModuleSrcs(ctx ModuleContext, srcs []string) (android.Path, android.Paths) {
+ if len(srcs) == 0 {
+ ctx.PropertyErrorf("srcs", "srcs must not be empty")
+ }
+
// The srcs can contain strings with prefix ":".
// They are dependent modules of this module, with android.SourceDepTag.
// They are not the main source file compiled by rustc.