Skip to content

Commit eae072a

Browse files
committed
Fix continuation_line_hook_incorrect false positive
1 parent 4c336d5 commit eae072a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/lint/rules/spacing.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,11 @@ impl SpPtrDeclArgs {
797797

798798
fn has_space_between(range_left: &ZeroRange,
799799
range_right: &ZeroRange) -> bool {
800+
// Print what is being compared
801+
println!(
802+
"Comparing ranges: left = {:?}, right = {:?}",
803+
range_left, range_right
804+
);
800805
!((range_left.row_end == range_right.row_start)
801806
&& (range_left.col_end == range_right.col_start))
802807
}
@@ -859,7 +864,8 @@ impl NspPtrDeclRule {
859864
if !self.enabled { return; }
860865
if let Some(ranges) = ranges {
861866
if let Some(op_range) = ranges.rightmost_multiply {
862-
if has_space_between(&op_range, &ranges.identifier_range) {
867+
if has_space_between(&op_range, &ranges.identifier_range)
868+
&& ranges.identifier_range != ZeroRange::invalid() {
863869
acc.push(self.create_err(ranges.identifier_range));
864870
}
865871
}

0 commit comments

Comments
 (0)