Skip to content

Pretty print ItemKind::Use in rustfmt style - #93759

Merged
bors merged 3 commits into
rust-lang:masterfrom
dtolnay:usetree
Feb 12, 2022
Merged

Pretty print ItemKind::Use in rustfmt style#93759
bors merged 3 commits into
rust-lang:masterfrom
dtolnay:usetree

Conversation

@dtolnay

Copy link
Copy Markdown
Member

This PR backports the formatting for use items from https://github.com/dtolnay/prettyplease into rustc_ast_pretty.

Before:

use core::{cmp::{Eq,Ord,PartialEq,PartialOrd},
convert::{AsMut,AsRef,From,Into},
iter::{DoubleEndedIterator,ExactSizeIterator,Extend,FromIterator,IntoIterator,Iterator},
marker::{CopyasCopy,SendasSend,SizedasSized,SyncasSync,UnpinasU}, ops::{*,Drop,Fn,FnMut,FnOnce}};

After:

use core::{
cmp::{Eq,Ord,PartialEq,PartialOrd},
convert::{AsMut,AsRef,From,Into},
iter::{DoubleEndedIterator,ExactSizeIterator,Extend,FromIterator,IntoIterator,Iterator,},
marker::{CopyasCopy,SendasSend,SizedasSized,SyncasSync,UnpinasU,},
ops::{*,Drop,Fn,FnMut,FnOnce},};

@rustbotrustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 8, 2022
@rust-highfive

Copy link
Copy Markdown
Contributor

r? @nagisa

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 8, 2022
@rust-log-analyzer

This comment has been minimized.

@nagisa

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Feb 12, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit b64a822 has been approved by nagisa

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 12, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 12, 2022
Pretty print ItemKind::Use in rustfmt style
This PR backports the formatting for `use` items from https://github.com/dtolnay/prettyplease into rustc_ast_pretty.
Before:
```rust
use core::{cmp::{Eq, Ord, PartialEq, PartialOrd},
convert::{AsMut, AsRef, From, Into},
iter::{DoubleEndedIterator, ExactSizeIterator, Extend, FromIterator,
IntoIterator, Iterator},
marker::{Copy as Copy, Send as Send, Sized as Sized, Sync as Sync, Unpin
as U}, ops::{*, Drop, Fn, FnMut, FnOnce}};
```
After:
```rust
use core::{
cmp::{Eq, Ord, PartialEq, PartialOrd},
convert::{AsMut, AsRef, From, Into},
iter::{
DoubleEndedIterator, ExactSizeIterator, Extend, FromIterator,
IntoIterator, Iterator,
},
marker::{
Copy as Copy, Send as Send, Sized as Sized, Sync as Sync, Unpin as U,
},
ops::{*, Drop, Fn, FnMut, FnOnce},
};
```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 12, 2022
Pretty print ItemKind::Use in rustfmt style
This PR backports the formatting for `use` items from https://github.com/dtolnay/prettyplease into rustc_ast_pretty.
Before:
```rust
use core::{cmp::{Eq, Ord, PartialEq, PartialOrd},
convert::{AsMut, AsRef, From, Into},
iter::{DoubleEndedIterator, ExactSizeIterator, Extend, FromIterator,
IntoIterator, Iterator},
marker::{Copy as Copy, Send as Send, Sized as Sized, Sync as Sync, Unpin
as U}, ops::{*, Drop, Fn, FnMut, FnOnce}};
```
After:
```rust
use core::{
cmp::{Eq, Ord, PartialEq, PartialOrd},
convert::{AsMut, AsRef, From, Into},
iter::{
DoubleEndedIterator, ExactSizeIterator, Extend, FromIterator,
IntoIterator, Iterator,
},
marker::{
Copy as Copy, Send as Send, Sized as Sized, Sync as Sync, Unpin as U,
},
ops::{*, Drop, Fn, FnMut, FnOnce},
};
```
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 12, 2022
…askrgr
Rollup of 7 pull requests
Successful merges:
- rust-lang#91908 (Add 2 tests)
- rust-lang#93595 (fix ICE when parsing lifetime as function argument)
- rust-lang#93757 (Add some known GAT bugs as tests)
- rust-lang#93759 (Pretty print ItemKind::Use in rustfmt style)
- rust-lang#93897 (linkchecker: fix panic on directory symlinks)
- rust-lang#93898 (tidy: Extend error code check)
- rust-lang#93928 (Add missing release notes for rust-lang#85200)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit f30f6de into rust-lang:masterFeb 12, 2022
@rustbotrustbot added this to the 1.60.0 milestone Feb 12, 2022
@dtolnay
dtolnay deleted the usetree branch April 3, 2022 18:50
@dtolnaydtolnay added the A-pretty Area: Pretty printing (including `-Z unpretty`) label Dec 28, 2023
@dtolnaydtolnay removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 14, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-prettyArea: Pretty printing (including `-Z unpretty`)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@dtolnay@rust-highfive@rust-log-analyzer@nagisa@bors@rustbot