blob: a4ac99d1a85c75318c55767b6c1b15173d79cb5c [file] [log] [blame]
# Copyright 2022 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
config("deny_unused_crate_dependencies") {
# Use -W instead of -D to treat as a warning while iterating
# Unused crate dependencies will still be denied in CQ because of -Dwarnings
rustflags = [ "-Wunused_crate_dependencies" ]
}
# This is preferred over adding `#![warn(clippy::all)]` in source because
# it's easier to override
config("clippy_warn_all") {
rustflags = [ "-Wclippy::all" ]
}
# TODO(https://fxbug.dev/42055130): Delete this config when all unused
# dependencies are removed.
#
# PLEASE DO NOT USE.
config("allow_unused_crate_dependencies") {
rustflags = [ "-Aunused_crate_dependencies" ]
# Please do not add to this list.
visibility = [
"//examples/*",
"//sdk/*",
"//src/*",
"//tools/*",
"//vendor/*",
"//zircon/*",
]
}
config("deny_unused_results") {
rustflags = [ "-Dunused_results" ]
}
config("allow_unused_results") {
rustflags = [ "-Aunused_results" ]
# This visibility list allows for targets to opt out of denying unused results.
#
# There is currently no platform mandate to adopt the unused_results lint and it's opt-in for
# developers that want to use it. See https://fxbug.dev/42153043 for more context.
#
# To adopt the lint, add the following to your rust target:
# configs -= ["//build/config/rust/lints:allow_unused_results"]
# The visibility list below can be used to enforce the list on certain areas of the tree while
# we evaluate wider adoption.
#
# To update this list run:
# $ scripts/gn/gen_visibility_globs.py \
# --all=//build/config/rust/lints:deny_unused_results \
# --allow=//build/config/rust/lints:allow_unused_results \
# --ignore-suffix=_rust # FIDL bindings use the _rust suffix
visibility = [
"//build/*",
"//examples/*",
"//garnet/*",
"//sdk/*",
"//src/bringup/*",
"//src/camera/*",
"//src/cobalt/*",
"//src/connectivity/bluetooth/lib/bt-metrics:*",
"//src/connectivity/location/*",
"//src/connectivity/lowpan/*",
"//src/connectivity/network/metrics:*",
"//src/connectivity/network/net-cli/ffx:*",
"//src/connectivity/network/testing/network-test-realm/ffx:*",
"//src/connectivity/openthread/*",
"//src/connectivity/overnet/*",
"//src/connectivity/policy/reachability/*",
"//src/connectivity/ppp/*",
"//src/connectivity/telephony/*",
"//src/connectivity/weave/*",
"//src/connectivity/wlan/*",
"//src/developer/*",
"//src/devices/*",
"//src/diagnostics/*",
"//src/experiences/*",
"//src/factory/*",
"//src/fonts/*",
"//src/graphics/*",
"//src/hwinfo/*",
"//src/identity/*",
"//src/intl/*",
"//src/lib/*",
"//src/media/*",
"//src/performance/*",
"//src/power/*",
"//src/recovery/*",
"//src/security/*",
"//src/sensors/*",
"//src/session/*",
"//src/settings/service:*",
"//src/starnix/*",
"//src/storage/*",
"//src/sys/*",
"//src/testing/*",
"//src/tests/*",
"//src/ui/*",
"//src/virtualization/*",
"//src/zircon/*",
"//third_party/*",
"//tools/*",
"//vendor/*",
"//zircon/*",
]
}