Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 659053ab authored by Alistair Delva's avatar Alistair Delva Committed by Gerrit Code Review
Browse files

Merge "Deny rust warnings by default."

parents 318c9c5d efdd7aca
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ func NewBaseCompiler(dir, dir64 string) *baseCompiler {
	return &baseCompiler{
		Properties: BaseCompilerProperties{
			Edition:       &config.DefaultEdition,
			Deny_warnings: config.DefaultDenyWarnings,
		},
		dir:   dir,
		dir64: dir64,
@@ -33,6 +34,9 @@ func NewBaseCompiler(dir, dir64 string) *baseCompiler {
}

type BaseCompilerProperties struct {
	// whether to pass "-D warnings" to rustc. Defaults to true.
	Deny_warnings *bool

	// flags to pass to rustc
	Flags []string `android:"path,arch_variant"`

@@ -109,6 +113,9 @@ func (compiler *baseCompiler) featuresToFlags(features []string) []string {

func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flags {

	if Bool(compiler.Properties.Deny_warnings) {
		flags.RustFlags = append(flags.RustFlags, "-D warnings")
	}
	flags.RustFlags = append(flags.RustFlags, compiler.Properties.Flags...)
	flags.RustFlags = append(flags.RustFlags, compiler.featuresToFlags(compiler.Properties.Features)...)
	flags.RustFlags = append(flags.RustFlags, "--edition="+*compiler.Properties.Edition)
+4 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ package config
import (
	"strings"

	"github.com/google/blueprint/proptools"

	"android/soong/android"
	_ "android/soong/cc/config"
)
@@ -33,6 +35,8 @@ var (
		"libtest",
	}

	DefaultDenyWarnings = proptools.BoolPtr(true)

	deviceGlobalRustFlags = []string{}

	deviceGlobalLinkFlags = []string{