You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The line lengths for the supertrait bounds before formatting were
AllTheOthers1: 104
AllTheOthers2: 105
AllTheOthers3: 100
AllTheOthers4: 101
As expected, rustfmt reformatted the AllTheOthers2 and AllTheOthers4 supertraits, but it left the AllTheOthers1 supertraits as-is at 104 characters.
This seems related to indentation: if I change tab_spaces to 3 instead of 4, the reformatting outside the module occurs when the supertraits line reaches 104 characters instead of 105. (Inside the module, things still work as expected and even a 101-character line gets reformatted).
See this playground for a demonstration. It looks like supertrait bounds are getting formatted to fit under a certain maximum line length that is slightly longer than the actual maximum (100 chars). In the example above, it will keep the super long trait bounds on a single line until they are over >104 chars exactly, and break them up into multiple lines at that point.
Given the following
src/lib.rs
:rustfmt
produces:The line lengths for the supertrait bounds before formatting were
AllTheOthers1
: 104AllTheOthers2
: 105AllTheOthers3
: 100AllTheOthers4
: 101As expected,
rustfmt
reformatted theAllTheOthers2
andAllTheOthers4
supertraits, but it left theAllTheOthers1
supertraits as-is at 104 characters.This seems related to indentation: if I change
tab_spaces
to 3 instead of 4, the reformatting outside the module occurs when the supertraits line reaches 104 characters instead of 105. (Inside the module, things still work as expected and even a 101-character line gets reformatted).My
rustfmt
config should just be the default:The text was updated successfully, but these errors were encountered: