summaryrefslogtreecommitdiff
path: root/rust/proc_macro.go
diff options
context:
space:
mode:
author Matthew Maurer <mmaurer@google.com> 2023-11-20 23:33:28 +0000
committer Matthew Maurer <mmaurer@google.com> 2023-11-22 00:52:14 +0000
commita28404a7b09d3fe7126f1a5863283888377885b0 (patch)
tree7181a7a42a7ca73853175d0c9de82ea179bd5049 /rust/proc_macro.go
parent1d8e20d744bae14ab3814125e6d9ac28b9fc97e3 (diff)
rust: Cache crateRootPath to avoid ctx
This makes it possible to call crateRootPath in situations where a ModuleContext is unavailable. Test: m nothing Bug: 309943184 Change-Id: Iee20b0606954a18ca516cdac40917d0016f94a05
Diffstat (limited to 'rust/proc_macro.go')
-rw-r--r--rust/proc_macro.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/rust/proc_macro.go b/rust/proc_macro.go
index e3a48bff6..8a0543dcd 100644
--- a/rust/proc_macro.go
+++ b/rust/proc_macro.go
@@ -79,7 +79,7 @@ func (procMacro *procMacroDecorator) compile(ctx ModuleContext, flags Flags, dep
fileName := procMacro.getStem(ctx) + ctx.toolchain().ProcMacroSuffix()
outputFile := android.PathForModuleOut(ctx, fileName)
- srcPath := procMacro.crateRootPath(ctx)
+ srcPath := crateRootPath(ctx, procMacro)
ret := TransformSrctoProcMacro(ctx, srcPath, deps, flags, outputFile)
procMacro.baseCompiler.unstrippedOutputFile = outputFile
return ret