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
macro dst_port($name:ident, $node:expr, $lock_dst_node:expr, $port_id:expr, $dst_node_id:expr){
macro $name(){// TODO: Assign to val instead of re-reading on every access, since it's not overwritten before all reads are done
$node.ports[$port_id]}}
after running rustfmt, it shifted the inner macro body 4 indent levels (4*2 spaces) to the right for no reason!:
macro dst_port($name:ident, $node:expr, $lock_dst_node:expr, $port_id:expr, $dst_node_id:expr){
macro $name(){// TODO: Assign to val instead of re-reading on every access, since it's not overwritten before all reads are done
$node.ports[$port_id]}}
Note: This doesn't happen when the comment is shorter like:
macro dst_port($name:ident, $node:expr, $lock_dst_node:expr, $port_id:expr, $dst_node_id:expr){
macro $name(){// TODO: Assign to val instead of re-reading on every access
$node.ports[$port_id]}}
It also doesn't happen when the original long comment is before the inner macro like:
macro dst_port($name:ident, $node:expr, $lock_dst_node:expr, $port_id:expr, $dst_node_id:expr){// TODO: Assign to val instead of re-reading on every access, since it's not overwritten before all reads are done
macro $name(){
$node.ports[$port_id]}}
The text was updated successfully, but these errors were encountered:
@Boscop thanks for reaching out. The long line comment is definitely the issue here, and as you've highlighted this is only an issue when the comment is inside the inner macro definition.
You have a few options for how to deal with this. You can
increase the max_width
set wrap_comments=true to allow rustfmt to wrap the long line comment
manually wrap the long line comment so that it's under the max_width
This is likely related to #4609 and other macro indentation issues.
Version:
Config:
I have this code:
after running rustfmt, it shifted the inner macro body 4 indent levels (4*2 spaces) to the right for no reason!:
Note: This doesn't happen when the comment is shorter like:
It also doesn't happen when the original long comment is before the inner macro like:
The text was updated successfully, but these errors were encountered: