From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../tests/target/imports/imports-reorder-lines.rs | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/tools/rustfmt/tests/target/imports/imports-reorder-lines.rs (limited to 'src/tools/rustfmt/tests/target/imports/imports-reorder-lines.rs') diff --git a/src/tools/rustfmt/tests/target/imports/imports-reorder-lines.rs b/src/tools/rustfmt/tests/target/imports/imports-reorder-lines.rs new file mode 100644 index 000000000..5b85503b5 --- /dev/null +++ b/src/tools/rustfmt/tests/target/imports/imports-reorder-lines.rs @@ -0,0 +1,31 @@ +use std::cmp::{a, b, c, d}; +use std::cmp::{b, e, f, g}; +use std::ddd::aaa; +use std::str; +// This comment should stay with `use std::ddd;` +use std::ddd; +use std::ddd::bbb; + +mod test {} + +use aaa; +use aaa::bbb; +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::{self as bb, b}; +use test::{a as aa, c}; -- cgit v1.2.3