bazelbuild / bazelbuild/rules_rust

rustfmt incompatible with `unused-qualifications`

Open
#3,493 0 comments 0 reactions 0 assignees View on GitHub
needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

Our repository has `-Dunused-qualifications` in the build flags, and now we can't run rustfmt anymore (well, without some workarounds) because we get lots of errors like the following when running `bazel run @rules_rust//:rustfmt`:

```
error: unnecessary qualification
--> external/rules_rust+/rust/runfiles/runfiles.rs:158:49
|
158 | let mode = if let Some(manifest_file) = std::env::var_os(MANIFEST_FILE_ENV_VAR) {
| ^^^^^^^^^^^^^^^^
|
= note: requested on the command line with `-D unused-qualifications`
help: remove the unnecessary path segments
|
158 - let mode = if let Some(manifest_file) = std::env::var_os(MANIFEST_FILE_ENV_VAR) {
158 + let mode = if let Some(manifest_file) = env::var_os(MANIFEST_FILE_ENV_VAR) {
|
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.