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

Commit 6d12db42 authored by Chris Wailes's avatar Chris Wailes
Browse files

Disallow the use of new unstable features

This CL adds a set of allowed unstable featuers for Rust code.  The goal
is to get this down to an empty list.

Bug: 267698452
Test: m rust
Change-Id: I09e61bf19594101f064bdf67dc81c3b4d1236266
parent 2760e81c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -250,6 +250,12 @@ func transformSrctoCrate(ctx ModuleContext, main android.Path, deps PathDeps, fl
		rustcFlags = append(rustcFlags, "-Cincremental="+incrementalPath)
	}

	// Disallow experimental features
	modulePath := android.PathForModuleSrc(ctx).String()
	if !(android.IsThirdPartyPath(modulePath) || strings.HasPrefix(modulePath, "prebuilts")) {
		rustcFlags = append(rustcFlags, "-Zallow-features=\"default_alloc_error_handler,custom_inner_attributes,mixed_integer_ops,slice_internals\"")
	}

	// Collect linker flags
	linkFlags = append(linkFlags, flags.GlobalLinkFlags...)
	linkFlags = append(linkFlags, flags.LinkFlags...)