diff options
author | 2023-02-24 16:58:18 -0800 | |
---|---|---|
committer | 2023-02-24 16:58:18 -0800 | |
commit | 6d12db423c48c6273e4a896b0e50e56c54a92198 (patch) | |
tree | 352e33595b9eca2dcfb9c49da3e5f6c1cd5ec899 /rust/builder.go | |
parent | 2760e81c8292c68a215dfa461ecb882e402254bf (diff) |
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
Diffstat (limited to 'rust/builder.go')
-rw-r--r-- | rust/builder.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rust/builder.go b/rust/builder.go index 5b5c993fb..a2f1238c2 100644 --- a/rust/builder.go +++ b/rust/builder.go @@ -247,7 +247,13 @@ func transformSrctoCrate(ctx ModuleContext, main android.Path, deps PathDeps, fl if ctx.Config().IsEnvTrue("SOONG_RUSTC_INCREMENTAL") { incrementalPath := android.PathForOutput(ctx, "rustc").String() - rustcFlags = append(rustcFlags, "-C incremental="+incrementalPath) + 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 |