1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 07:44:48 -05:00

Suppress remaining warnings in third party rust crates

This commit is contained in:
Bert Belder 2018-09-16 20:53:19 -07:00
parent c7a4ca3c88
commit 836fc255ba
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461
2 changed files with 21 additions and 1 deletions

View file

@ -14,6 +14,7 @@ registry_github = "$crates/registry/src/github.com-1ecc6299db9ec823/"
rust_crate("libc") { rust_crate("libc") {
source_root = "$registry_github/libc-0.2.42/src/lib.rs" source_root = "$registry_github/libc-0.2.42/src/lib.rs"
features = [ "use_std" ] features = [ "use_std" ]
args = [ "-Aunused_macros" ] # Unused macro `f` in macros.rs:51.
} }
rust_crate("url") { rust_crate("url") {
@ -163,6 +164,18 @@ rust_crate("winapi-0.2") {
crate_name = "winapi" crate_name = "winapi"
crate_version = "0.2" crate_version = "0.2"
source_root = "$registry_github/winapi-0.2.8/src/lib.rs" source_root = "$registry_github/winapi-0.2.8/src/lib.rs"
args = [
"-Asafe_packed_borrows",
"-Awarnings",
]
# The winapi-0.2 crate contains an unused type alias, but it also specifically
# sets the lint level to warn about this, so we can't suppress that warning
# with a command line argument, other than by using "-Awarnings", which has no
# effect if we also pass "-Dwarnings" to treat all warnings as errors.
# Since this crate is outdated and this will never be fixed, just override
# the global 'rust_treat_warnings_as_errors' setting for this crate.
treat_warnings_as_errors = false
} }
# TODO: Remove this crate together with crate 'winapi-0.2'. # TODO: Remove this crate together with crate 'winapi-0.2'.
@ -242,6 +255,7 @@ rust_crate("miow") {
crate_version = "0.2" crate_version = "0.2"
}, },
] ]
args = [ "-Aunused_macros" ] # Unused macro `t` in lib.rs:21.
} }
rust_crate("iovec") { rust_crate("iovec") {

View file

@ -57,6 +57,7 @@ template("run_rustc") {
"is_test", "is_test",
"source_root", "source_root",
"testonly", "testonly",
"treat_warnings_as_errors",
]) ])
if (!defined(crate_name)) { if (!defined(crate_name)) {
crate_name = target_name crate_name = target_name
@ -64,6 +65,10 @@ template("run_rustc") {
if (!defined(is_test)) { if (!defined(is_test)) {
is_test = false is_test = false
} }
if (!defined(treat_warnings_as_errors)) {
# Use global setting if not explicitly specified for this target.
treat_warnings_as_errors = rust_treat_warnings_as_errors
}
sources = [ sources = [
source_root, source_root,
@ -76,7 +81,7 @@ template("run_rustc") {
"--crate-type=$crate_type", "--crate-type=$crate_type",
] ]
if (rust_treat_warnings_as_errors) { if (treat_warnings_as_errors) {
args += [ "-Dwarnings" ] args += [ "-Dwarnings" ]
} }
@ -254,6 +259,7 @@ template("rust_crate") {
"is_test", "is_test",
"source_root", "source_root",
"testonly", "testonly",
"treat_warnings_as_errors",
]) ])
} }