summaryrefslogtreecommitdiff
path: root/rust/compiler.go
diff options
context:
space:
mode:
authorThiƩbaud Weksteen <tweek@google.com>2020-08-03 10:46:28 +0200
committerThiƩbaud Weksteen <tweek@google.com>2020-08-03 11:00:43 +0200
commite81c924f0c70b07fdfac86ef1475622ee6444c36 (patch)
tree7ee2fe380092ffaf14e8e31aa8357dc7f99e7b4c /rust/compiler.go
parentd118b1c2b74a1028f86f570db602a3b39e2009e1 (diff)
Move getEdition to a baseCompiler method
Test: cd build/soong; mma Test: cd external/rust/; mma Change-Id: Ide63b2e633e7c4345c6338e107f5d66688e4cf58
Diffstat (limited to 'rust/compiler.go')
-rw-r--r--rust/compiler.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/compiler.go b/rust/compiler.go
index 040219dc4..83a1f27cc 100644
--- a/rust/compiler.go
+++ b/rust/compiler.go
@@ -24,7 +24,7 @@ import (
"android/soong/rust/config"
)
-func getEdition(compiler *baseCompiler) string {
+func (compiler *baseCompiler) edition() string {
return proptools.StringDefault(compiler.Properties.Edition, config.DefaultEdition)
}
@@ -149,7 +149,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flag
}
flags.RustFlags = append(flags.RustFlags, compiler.Properties.Flags...)
flags.RustFlags = append(flags.RustFlags, compiler.featuresToFlags(compiler.Properties.Features)...)
- flags.RustFlags = append(flags.RustFlags, "--edition="+getEdition(compiler))
+ flags.RustFlags = append(flags.RustFlags, "--edition="+compiler.edition())
flags.LinkFlags = append(flags.LinkFlags, compiler.Properties.Ld_flags...)
flags.GlobalRustFlags = append(flags.GlobalRustFlags, config.GlobalRustFlags...)
flags.GlobalRustFlags = append(flags.GlobalRustFlags, ctx.toolchain().ToolchainRustFlags())