Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Latest commit

 

History

History
42 lines (33 loc) · 1.02 KB

README.md

File metadata and controls

42 lines (33 loc) · 1.02 KB

Motivation

This repo is used to reproduce the rustfix bug reported in rust-lang/rustfmt#5131 .

How to reproduce it?

Step1: clone this repo:

git clone https://github.com/sunt-ing/rustfmt_bug_example.git

Step 2: ensure the repo is correct.

cd rustfmt_bug_example
cargo test

Should be fine.

Step 3: format it by running rustfmt with the rules in rustfmt.toml.

cd rustfmt_bug_example
cargo fmt

Step 4: run the test again:

cd rustfmt_bug_example
cargo test

Test failed because of lack of importing dependencies.

Tips: if you want to run again, you can drop all the local changes:

cd rustfmt_bug_example
git co -- .

Expected behaviour

I don't think that rustfmt should turn the correct code into incorrect in any condition.

Both the original name of the dependency and the given alias should be kept.

rustfmt should provide another option to solve the issue that both of the two names are exposed in the same scope.