rust: internalize srcPathFromModuleSrcs
This was frequently misused (for example, in the prebuilts module, it
was used as a complex "assert(len(srcs))==1"), and can be superceded by
getCrateRoot anywhere it was used. It's now only called from
compiler.go, and can drop the second return parameter, as it was only
actually used by the prebuilt assert misuse.
Bug: 309943184
Test: m nothing
Change-Id: I6c92580bc8f0ecb7586c544056b5409e6dd280e7
diff --git a/rust/compiler_test.go b/rust/compiler_test.go
index ec6829a..89f4d1a 100644
--- a/rust/compiler_test.go
+++ b/rust/compiler_test.go
@@ -67,6 +67,7 @@
func TestEnforceSingleSourceFile(t *testing.T) {
singleSrcError := "srcs can only contain one path for a rust file and source providers prefixed by \":\""
+ prebuiltSingleSrcError := "prebuilt libraries can only have one entry in srcs"
// Test libraries
testRustError(t, singleSrcError, `
@@ -90,7 +91,7 @@
}`)
// Test prebuilts
- testRustError(t, singleSrcError, `
+ testRustError(t, prebuiltSingleSrcError, `
rust_prebuilt_dylib {
name: "foo-bar-prebuilt",
srcs: ["liby.so", "libz.so"],