]> git.lizzy.rs Git - rust.git/blob - tests/source/imports-reorder-lines.rs
Add `use` declaration re-ordering (#1104)
[rust.git] / tests / source / imports-reorder-lines.rs
1 // rustfmt-reorder_imports: true
2
3 use std::str;
4 use std::cmp::{d, c, b, a};
5 use std::cmp::{b, e, g, f};
6 use std::ddd::aaa;
7 // This comment should stay with `use std::ddd;`
8 use std::ddd;
9 use std::ddd::bbb;
10
11 mod test {
12 }
13
14 use aaa::bbb;
15 use aaa;
16 use aaa::*;
17
18 mod test {}
19 // If item names are equal, order by rename
20
21 use test::{a as bb, b};
22 use test::{a as aa, c};
23
24 mod test {}
25 // If item names are equal, order by rename - no rename comes before a rename
26
27 use test::{a as bb, b};
28 use test::{a, c};
29
30 mod test {}
31 // `self` always comes first
32
33 use test::{a as aa, c};
34 use test::{self as bb, b};