summaryrefslogtreecommitdiff
path: root/rust/compiler.go
diff options
context:
space:
mode:
authorThiƩbaud Weksteen <tweek@google.com>2020-07-01 17:38:58 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-07-01 17:38:58 +0000
commit6bbe5774a3b7125460b7ea32e91b35ada3402c04 (patch)
tree86c11b63ff45aae32d25021d8ad6257a4a7369cb /rust/compiler.go
parent7d9deed9fd74b9cc221bbd272ad9025273ace5e1 (diff)
parent8e46efac71a025bc71840c4ea1a4293233fc0958 (diff)
Merge "Explicitly define Rust default lints"
Diffstat (limited to 'rust/compiler.go')
-rw-r--r--rust/compiler.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/rust/compiler.go b/rust/compiler.go
index 050a2593d..51d7180ca 100644
--- a/rust/compiler.go
+++ b/rust/compiler.go
@@ -28,10 +28,6 @@ func getEdition(compiler *baseCompiler) string {
return proptools.StringDefault(compiler.Properties.Edition, config.DefaultEdition)
}
-func getDenyWarnings(compiler *baseCompiler) bool {
- return BoolDefault(compiler.Properties.Deny_warnings, config.DefaultDenyWarnings)
-}
-
func (compiler *baseCompiler) setNoStdlibs() {
compiler.Properties.No_stdlibs = proptools.BoolPtr(true)
}
@@ -56,8 +52,8 @@ type BaseCompilerProperties struct {
// path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs)
Srcs []string `android:"path,arch_variant"`
- // whether to pass "-D warnings" to rustc. Defaults to true.
- Deny_warnings *bool
+ // whether to suppress the standard lint flags - default to false
+ No_lint *bool
// flags to pass to rustc
Flags []string `android:"path,arch_variant"`
@@ -145,8 +141,8 @@ func (compiler *baseCompiler) featuresToFlags(features []string) []string {
func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flags {
- if getDenyWarnings(compiler) {
- flags.RustFlags = append(flags.RustFlags, "-D warnings")
+ if !Bool(compiler.Properties.No_lint) {
+ flags.RustFlags = append(flags.RustFlags, config.RustcLintsForDir(ctx.ModuleDir()))
}
flags.RustFlags = append(flags.RustFlags, compiler.Properties.Flags...)
flags.RustFlags = append(flags.RustFlags, compiler.featuresToFlags(compiler.Properties.Features)...)