-
Notifications
You must be signed in to change notification settings - Fork 967
Closed
Labels
1x-backport:pendingFixed/resolved in source but not yet backported to a 1x branch and releaseFixed/resolved in source but not yet backported to a 1x branch and releaseA-importsArea: imports, e.g. `use` syntaxArea: imports, e.g. `use` syntaxS-duplicateStatus: duplicate of another issue or PRStatus: duplicate of another issue or PR
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
Metadata
Metadata
Assignees
Labels
1x-backport:pendingFixed/resolved in source but not yet backported to a 1x branch and releaseFixed/resolved in source but not yet backported to a 1x branch and releaseA-importsArea: imports, e.g. `use` syntaxArea: imports, e.g. `use` syntaxS-duplicateStatus: duplicate of another issue or PRStatus: duplicate of another issue or PR