-
Notifications
You must be signed in to change notification settings - Fork 901
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue #3805 - wrap macro line with width of one char beyond max
- Loading branch information
1 parent
cedb7b5
commit b9cc509
Showing
3 changed files
with
170 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// rustfmt-version: Two | ||
// rustfmt-format_macro_matchers: true | ||
|
||
// From original issue example - Line length 101 | ||
macro_rules! test { | ||
($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr) => {{ | ||
return; | ||
}}; | ||
} | ||
|
||
// Spaces between the `{` and `}` | ||
macro_rules! test { | ||
($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr) => { { | ||
return; | ||
} }; | ||
} | ||
|
||
// Multi `{}` | ||
macro_rules! test { | ||
($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr) => {{{{ | ||
return; | ||
}}}}; | ||
} | ||
|
||
// Multi `{}` with spaces | ||
macro_rules! test { | ||
($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr) => { { { { | ||
return; | ||
} } } }; | ||
} | ||
|
||
// Line length 102 | ||
macro_rules! test { | ||
($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeiou:expr, $add:expr) => {{ | ||
return; | ||
}}; | ||
} | ||
|
||
// Line length 103 | ||
macro_rules! test { | ||
($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeioua:expr, $add:expr) => {{ | ||
return; | ||
}}; | ||
} | ||
|
||
// With extended macro body - Line length 101 | ||
macro_rules! test { | ||
($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr) => {{ | ||
let VAR = "VALUE"; return VAR; | ||
}}; | ||
} | ||
|
||
// With extended macro body - Line length 102 | ||
macro_rules! test { | ||
($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeiou:expr, $add:expr) => {{ | ||
let VAR = "VALUE"; return VAR; | ||
}}; | ||
} | ||
|
||
// With extended macro body - Line length 103 | ||
macro_rules! test { | ||
($aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeioua:expr, $add:expr) => {{ | ||
let VAR = "VALUE"; return VAR; | ||
}}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// rustfmt-version: Two | ||
// rustfmt-format_macro_matchers: true | ||
|
||
// From original issue example - Line length 101 | ||
macro_rules! test { | ||
( | ||
$aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr | ||
) => {{ | ||
return; | ||
}}; | ||
} | ||
|
||
// Spaces between the `{` and `}` | ||
macro_rules! test { | ||
( | ||
$aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr | ||
) => {{ | ||
return; | ||
}}; | ||
} | ||
|
||
// Multi `{}` | ||
macro_rules! test { | ||
( | ||
$aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr | ||
) => {{ | ||
{ | ||
{ | ||
return; | ||
} | ||
} | ||
}}; | ||
} | ||
|
||
// Multi `{}` with spaces | ||
macro_rules! test { | ||
( | ||
$aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr | ||
) => {{ | ||
{ | ||
{ | ||
return; | ||
} | ||
} | ||
}}; | ||
} | ||
|
||
// Line length 102 | ||
macro_rules! test { | ||
( | ||
$aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeiou:expr, $add:expr | ||
) => {{ | ||
return; | ||
}}; | ||
} | ||
|
||
// Line length 103 | ||
macro_rules! test { | ||
( | ||
$aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeioua:expr, $add:expr | ||
) => {{ | ||
return; | ||
}}; | ||
} | ||
|
||
// With extended macro body - Line length 101 | ||
macro_rules! test { | ||
( | ||
$aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeio:expr, $add:expr | ||
) => {{ | ||
let VAR = "VALUE"; | ||
return VAR; | ||
}}; | ||
} | ||
|
||
// With extended macro body - Line length 102 | ||
macro_rules! test { | ||
( | ||
$aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeiou:expr, $add:expr | ||
) => {{ | ||
let VAR = "VALUE"; | ||
return VAR; | ||
}}; | ||
} | ||
|
||
// With extended macro body - Line length 103 | ||
macro_rules! test { | ||
( | ||
$aasdfghj:expr, $qwertyuiop:expr, $zxcvbnmasdfghjkl:expr, $aeiouaeiouaeioua:expr, $add:expr | ||
) => {{ | ||
let VAR = "VALUE"; | ||
return VAR; | ||
}}; | ||
} |