Skip to content

merge_imports will incorrectly format imports with self #3808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nagisa opened this issue Sep 26, 2019 · 1 comment · Fixed by #3810
Closed

merge_imports will incorrectly format imports with self #3808

nagisa opened this issue Sep 26, 2019 · 1 comment · Fixed by #3810

Comments

@nagisa
Copy link
Member

nagisa commented Sep 26, 2019

$ cat /tmp/test.rs 
use foo::{self};
$ rustfmt /tmp/test.rs --emit=stdout --config-path rustfmt.toml
/tmp/test.rs:

use foo::self;

The newly formatted code cannot compile because Rust requires self to appear within {}. Related: #3807.

@calebcartwright
Copy link
Member

Yup, indeed a bug. Will open a PR with a fix shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants