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 places where rewrite_assign_rhsh()/_with() are used, and the comments between lhs and rhs are not handled, were identified in #4626. I submitted PRs to use rewrite_assign_rhs_with_comments() for the rewrite_assignment and format_trait cases.
For the following cases, it is not clear if and what should be done. There seem to be three options:
Do nothing, as it is not expected that comments will be added between the lhs (... =) and rhs in these cases.
Enhance the code to use rewrite_assign_rhs_with_comments instead of rewrite_assign_rhs....
Only check whether all comments are included in the formatted code and if not use the original code (using recover_comment_removed()).
Following are the relevant cases with code examples when I was able to find an example:
Macro format_lazy_static()
Maybe this case is not relevant currently, as format_lazy_static() is not called if the lazy_static! macro contains a comment - see here.
The places where
rewrite_assign_rhsh()/_with()
are used, and the comments between lhs and rhs are not handled, were identified in #4626. I submitted PRs to userewrite_assign_rhs_with_comments()
for therewrite_assignment
andformat_trait
cases.For the following cases, it is not clear if and what should be done. There seem to be three options:
... =
) and rhs in these cases.rewrite_assign_rhs_with_comments
instead ofrewrite_assign_rhs...
.recover_comment_removed()
).Following are the relevant cases with code examples when I was able to find an example:
rewrite_struct_field()
Could not find an example. Per this code requires new line inside of field type.
rewrite_opaque_impl_type()
Could not find an example.
Static ast::ForeignItem
Could not find an example.
Macro format_lazy_static()
Maybe this case is not relevant currently, as
format_lazy_static()
is not called if thelazy_static!
macro contains a comment - see here.ast::WherePredicate::BoundPredicate
Could not find an example.
ast::WherePredicate::EqPredicate
Could not find an example.
The text was updated successfully, but these errors were encountered: