From cd8dc7c519f01864f2b5553812e7848f26a88962 Mon Sep 17 00:00:00 2001 From: Yacin Tmimi Date: Thu, 21 Jul 2022 00:53:06 -0400 Subject: [PATCH] add test for 4708 This is fixed by backporting 3999 --- .../target/issue-4708/imports_granularity_crate.rs | 13 +++++++++++++ tests/target/issue-4708/imports_granularity_item.rs | 13 +++++++++++++ .../target/issue-4708/imports_granularity_module.rs | 13 +++++++++++++ tests/target/issue-4708/imports_granularity_one.rs | 13 +++++++++++++ .../issue-4708/imports_granularity_preserve.rs | 13 +++++++++++++ 5 files changed, 65 insertions(+) create mode 100644 tests/target/issue-4708/imports_granularity_crate.rs create mode 100644 tests/target/issue-4708/imports_granularity_item.rs create mode 100644 tests/target/issue-4708/imports_granularity_module.rs create mode 100644 tests/target/issue-4708/imports_granularity_one.rs create mode 100644 tests/target/issue-4708/imports_granularity_preserve.rs diff --git a/tests/target/issue-4708/imports_granularity_crate.rs b/tests/target/issue-4708/imports_granularity_crate.rs new file mode 100644 index 00000000000..9f77fde6602 --- /dev/null +++ b/tests/target/issue-4708/imports_granularity_crate.rs @@ -0,0 +1,13 @@ +// rustfmt-imports_granularity: Crate + +// See https://github.com/rust-lang/rustfmt/issues/4708 +pub use serenity::model::{ + // channel::{Message, Reaction, ReactionType}, + // gateway::Ready, + // guild::{Member, Role}, + // id::{ChannelId, GuildId, MessageId, RoleId, UserId}, + // permissions::Permissions, + prelude::*, + // user::User, +}; +use {std::env::args /* this comment gets removed */}; diff --git a/tests/target/issue-4708/imports_granularity_item.rs b/tests/target/issue-4708/imports_granularity_item.rs new file mode 100644 index 00000000000..955f1aae213 --- /dev/null +++ b/tests/target/issue-4708/imports_granularity_item.rs @@ -0,0 +1,13 @@ +// rustfmt-imports_granularity: Item + +// See https://github.com/rust-lang/rustfmt/issues/4708 +pub use serenity::model::{ + // channel::{Message, Reaction, ReactionType}, + // gateway::Ready, + // guild::{Member, Role}, + // id::{ChannelId, GuildId, MessageId, RoleId, UserId}, + // permissions::Permissions, + prelude::*, + // user::User, +}; +use {std::env::args /* this comment gets removed */}; diff --git a/tests/target/issue-4708/imports_granularity_module.rs b/tests/target/issue-4708/imports_granularity_module.rs new file mode 100644 index 00000000000..6cb17470c60 --- /dev/null +++ b/tests/target/issue-4708/imports_granularity_module.rs @@ -0,0 +1,13 @@ +// rustfmt-imports_granularity: Module + +// See https://github.com/rust-lang/rustfmt/issues/4708 +pub use serenity::model::{ + // channel::{Message, Reaction, ReactionType}, + // gateway::Ready, + // guild::{Member, Role}, + // id::{ChannelId, GuildId, MessageId, RoleId, UserId}, + // permissions::Permissions, + prelude::*, + // user::User, +}; +use {std::env::args /* this comment gets removed */}; diff --git a/tests/target/issue-4708/imports_granularity_one.rs b/tests/target/issue-4708/imports_granularity_one.rs new file mode 100644 index 00000000000..36817e97e34 --- /dev/null +++ b/tests/target/issue-4708/imports_granularity_one.rs @@ -0,0 +1,13 @@ +// rustfmt-imports_granularity: One + +// See https://github.com/rust-lang/rustfmt/issues/4708 +pub use serenity::model::{ + // channel::{Message, Reaction, ReactionType}, + // gateway::Ready, + // guild::{Member, Role}, + // id::{ChannelId, GuildId, MessageId, RoleId, UserId}, + // permissions::Permissions, + prelude::*, + // user::User, +}; +use {std::env::args /* this comment gets removed */}; diff --git a/tests/target/issue-4708/imports_granularity_preserve.rs b/tests/target/issue-4708/imports_granularity_preserve.rs new file mode 100644 index 00000000000..dcb1a1864b8 --- /dev/null +++ b/tests/target/issue-4708/imports_granularity_preserve.rs @@ -0,0 +1,13 @@ +// rustfmt-imports_granularity: Preserve + +// See https://github.com/rust-lang/rustfmt/issues/4708 +pub use serenity::model::{ + // channel::{Message, Reaction, ReactionType}, + // gateway::Ready, + // guild::{Member, Role}, + // id::{ChannelId, GuildId, MessageId, RoleId, UserId}, + // permissions::Permissions, + prelude::*, + // user::User, +}; +use {std::env::args /* this comment gets removed */};