Skip to content

rustfmt incompatible with unused-qualifications #3493

@palfrey

Description

@palfrey

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) {
    |

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions