Closed
Description
Description
I'm writing a toy compiler, and recently split up the elements of my grammar into their own modules.
Unfortunately, there's overlap between the elements and some Rust keywords, so sometimes I need to use raw identifiers:
use self::r#enum::*;
use self::interface::*;
use self::struct::*;
I would expect these to be sorted alphabetically, not including the r#
But, rustfmt seems to include it when sorting, and changes this to:
use self::interface::*;
use self::r#enum::*;
use self::struct::*;
Note that this doesn't happen with modules:
mod r#enum;
mod interface;
mod struct;
here rustfmt correctly ignores the r#
prefix when sorting.
I'm open to fixing this, if someone could point me in the right direction! Since it seems *crosses fingers* like an easy fix.
Environment
rustfmt 1.4.38-nightly (e0944922 2022-05-31) on macOS Monterey