]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Rollup merge of #93759 - dtolnay:usetree, r=nagisa
authorMatthias Krüger <matthias.krueger@famsik.de>
Sat, 12 Feb 2022 08:26:23 +0000 (09:26 +0100)
committerGitHub <noreply@github.com>
Sat, 12 Feb 2022 08:26:23 +0000 (09:26 +0100)
commitf30f6def0fb2c5d77a5a36e05e84ad60d9e87078
treed1627005ddc1f5cd6a0930822af799d98cfd55e1
parent36461e04471772b235f9512c4beab48befddd1a8
parentb64a8222ab1868490bbcadc160a8c868b2ce5d13
Rollup merge of #93759 - dtolnay:usetree, r=nagisa

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},
};
```