Skip to content
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

Long casts get's moved to a new line #3528

Open
drager opened this issue Apr 25, 2019 · 1 comment
Open

Long casts get's moved to a new line #3528

drager opened this issue Apr 25, 2019 · 1 comment
Labels
1x-backport:pending Fixed/resolved in source but not yet backported to a 1x branch and release poor-formatting
Milestone

Comments

@drager
Copy link

drager commented Apr 25, 2019

When running rustfmt on long lines that contains a cast, the formatting gets a bit weird. I copied the code I formatted to a playground that can be found here: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=4bc27f6604fa0ca8cce228b99e81223c (this wont compile). This is my formatted version, using rustfmt 1.0.3-stable (d6829d6 2019-02-14). I also tried rustfmt 1.2.1-nightly (b860fea 2019-04-18) which seems to be the one at the playground which also results in the same formatting. I think the weird formatting is that as Box<dyn Backend> gets moved to a new line with weird indention.

@topecongiro topecongiro added this to the 3.0.0 milestone Jun 29, 2020
davidBar-On added a commit to davidBar-On/rustfmt that referenced this issue Aug 31, 2020
calebcartwright pushed a commit that referenced this issue Sep 6, 2020
* Fix issues in handling cast pre/post comments and adding test cases

* Add target for cast pre/post comments test cases

* Add test cases related to #2896 and #3528

* Changes per comments to the original PR
@ytmimi
Copy link
Contributor

ytmimi commented Jul 20, 2022

Backport PR #5296 seems to solve this

@ytmimi ytmimi added the 1x-backport:pending Fixed/resolved in source but not yet backported to a 1x branch and release label Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1x-backport:pending Fixed/resolved in source but not yet backported to a 1x branch and release poor-formatting
Projects
None yet
Development

No branches or pull requests

3 participants