Skip to content

imports_granularity is not respected for #[cfg]'d items #6666

@clarfonthey

Description

@clarfonthey

Example with imports_granularity = "crate". The following:

#[cfg(true)]
use std::{cmp::Ordering, hash::Hash, hash::Hasher};
use core::{cmp::Ordering, hash::Hash, hash::Hasher};

will normalise to:

#[cfg(true)]
use std::{cmp::Ordering, hash::Hash, hash::Hasher};
use core::{cmp::Ordering, hash::{Hash, Hasher}};

Note that the desire to avoid messing with cfgs is too conservative here: the imports are not grouped in the same way.

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