summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/source/imports/imports-reorder-lines.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rustfmt/tests/source/imports/imports-reorder-lines.rs')
-rw-r--r--src/tools/rustfmt/tests/source/imports/imports-reorder-lines.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/imports/imports-reorder-lines.rs b/src/tools/rustfmt/tests/source/imports/imports-reorder-lines.rs
new file mode 100644
index 000000000..2b018544e
--- /dev/null
+++ b/src/tools/rustfmt/tests/source/imports/imports-reorder-lines.rs
@@ -0,0 +1,32 @@
+use std::str;
+use std::cmp::{d, c, b, a};
+use std::cmp::{b, e, g, f};
+use std::ddd::aaa;
+// This comment should stay with `use std::ddd;`
+use std::ddd;
+use std::ddd::bbb;
+
+mod test {
+}
+
+use aaa::bbb;
+use aaa;
+use aaa::*;
+
+mod test {}
+// If item names are equal, order by rename
+
+use test::{a as bb, b};
+use test::{a as aa, c};
+
+mod test {}
+// If item names are equal, order by rename - no rename comes before a rename
+
+use test::{a as bb, b};
+use test::{a, c};
+
+mod test {}
+// `self` always comes first
+
+use test::{a as aa, c};
+use test::{self as bb, b};