diff --git a/build_extra/flatbuffers/BUILD.gn b/build_extra/flatbuffers/BUILD.gn index b46cb3d2c0..d3ace99c57 100644 --- a/build_extra/flatbuffers/BUILD.gn +++ b/build_extra/flatbuffers/BUILD.gn @@ -13,6 +13,10 @@ config("flatbuffers_config") { cflags = [ "-Wno-exit-time-destructors", "-Wno-header-hygiene", + + # TODO: rust branch of flatbuffers has this warning. + # This should be removed when the branch fixed. + "-Wno-return-type", ] } } diff --git a/build_extra/rust/BUILD.gn b/build_extra/rust/BUILD.gn index f5c85319a6..b94cfe372f 100644 --- a/build_extra/rust/BUILD.gn +++ b/build_extra/rust/BUILD.gn @@ -26,6 +26,13 @@ rust_component("url") { rust_component("percent_encoding") { source_root = "$crates/registry/src/github.com-1ecc6299db9ec823/percent-encoding-1.0.1/lib.rs" + args = [ + # TODO: Suppress some warnings at this moment + # This should be removed when it's fixed in servo/rust-url repository + # https://github.com/servo/rust-url/issues/455 + "-Aunused-imports", + "-Adeprecated", + ] } rust_component("matches") { diff --git a/build_extra/rust/rust.gni b/build_extra/rust/rust.gni index e99859a591..2fc8228376 100644 --- a/build_extra/rust/rust.gni +++ b/build_extra/rust/rust.gni @@ -62,11 +62,14 @@ template("run_rustc") { outputs = [] script = "//tools/run_rustc.py" + # TODO: We want to apply "-Dwarnings" only when treat_warnings_as_errors is not false + # https://github.com/ry/deno/pull/379 args = [ rebase_path(source_root, root_build_dir), "--crate-name=$crate_name", "--crate-type=$crate_type", ] + if (!is_win) { args += [ "--color=always" ] } @@ -116,6 +119,10 @@ template("run_rustc") { } } + if (defined(invoker.args)) { + args += invoker.args + } + if (!defined(deps)) { deps = [] } @@ -155,6 +162,7 @@ template("rust_component") { "source_root", "is_test", "testonly", + "args", ]) if (!defined(invoker.crate_type)) { crate_type = "rlib"