diff options
Diffstat (limited to 'rust/compiler.go')
-rw-r--r-- | rust/compiler.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rust/compiler.go b/rust/compiler.go index c20179bd0..ab3d2f44a 100644 --- a/rust/compiler.go +++ b/rust/compiler.go @@ -46,6 +46,8 @@ type installLocation int const ( InstallInSystem installLocation = 0 InstallInData = iota + + incorrectSourcesError = "srcs can only contain one path for a rust file and source providers prefixed by \":\"" ) type BaseCompilerProperties struct { @@ -253,6 +255,7 @@ func (compiler *baseCompiler) relativeInstallPath() string { return String(compiler.Properties.Relative_install_path) } +// 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) { // The srcs can contain strings with prefix ":". // They are dependent modules of this module, with android.SourceDepTag. @@ -266,11 +269,11 @@ func srcPathFromModuleSrcs(ctx ModuleContext, srcs []string) (android.Path, andr } } if numSrcs != 1 { - ctx.PropertyErrorf("srcs", "srcs can only contain one path for a rust file") + ctx.PropertyErrorf("srcs", incorrectSourcesError) } if srcIndex != 0 { ctx.PropertyErrorf("srcs", "main source file must be the first in srcs") } paths := android.PathsForModuleSrc(ctx, srcs) - return paths[srcIndex], paths + return paths[srcIndex], paths[1:] } |