-
Notifications
You must be signed in to change notification settings - Fork 898
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
macro fails to be wrapped if it is exactly one character beyond max_width #3805
Comments
Confirming I can reproduce the issue with input (length of the macro matcher line including indentation is 101) macro_rules! test {
($asdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeiou:expr, $add:expr) => {{
return;
}};
} output macro_rules! test {
($asdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeiou:expr, $add:expr) => {{
return;
}};
} When the macro_matcher is 102 characters long, then it wraps. I assume we're not taking the length of the 2nd input (length of the macro matcher line including indentation is 102) macro_rules! test {
($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeiou:expr, $add:expr) => {{
return;
}};
} output macro_rules! test {
(
$aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeiou:expr, $add:expr
) => {{
return;
}};
} For anyone who wants to take a look at this I'd start in Lines 966 to 987 in f2c31ba
Linking the |
Submitted PR #5582 with a suggested fix. |
Using rustfmt 1.4.8 nightly with a
.rustfmt.toml
with the following:If this is manually formatted, overflow will not happen. However, if the
format_macro_matchers = true
line is uncommented, the line will always be reformatted to overflow until another character is added.The text was updated successfully, but these errors were encountered: