about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2025-03-26 22:03:17 +0000
committerGitHub <noreply@github.com>2025-03-26 22:03:17 +0000
commitc4789a014f840dacc13073698aa2d2b1a895867e (patch)
tree5ee7cb0272a52cad567338d4a771fa76435fc8e4 /tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
parentfe4dd5b92e603555594b9abef58405fc9f4f260e (diff)
parent9b1945d9fb57516c585f7aea9dfe638ad3c7a397 (diff)
downloadrust-c4789a014f840dacc13073698aa2d2b1a895867e.tar.gz
rust-c4789a014f840dacc13073698aa2d2b1a895867e.zip
Prevent including preceeding whitespaces if line contains non blanks (#14480)
This extra condition prevents a problem when removing the '}' in:
```rust
  ( // There was an opening bracket after the parenthesis, which has been removed
    // This is a comment
   })
```
Removing the whitespaces, including the linefeed, before the '}', would
put the closing parenthesis at the end of the `// This is a comment`
line, which would make it part of the comment as well. In this case, it
is best to keep the span on the '}' alone.

changelog: none

Note to reviewer: `manual_inspect` and `collapsible_if` were two lints
exhibiting this problem in cooked up test cases, which have been
included as non-regression tests.
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions