about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-08-04 08:05:50 +0900
committerGitHub <noreply@github.com>2021-08-04 08:05:50 +0900
commit87c820573a0ed8733523bb697a78021620a9bf94 (patch)
tree34cf10d227c9af4757ec40f1fdb75916e0372ff0 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parentad74828b506866a96c6b25501f64b1262a5693f8 (diff)
parent3744dc868793e42200c5221ba4496ef5c17b8899 (diff)
downloadrust-87c820573a0ed8733523bb697a78021620a9bf94.tar.gz
rust-87c820573a0ed8733523bb697a78021620a9bf94.zip
Rollup merge of #87267 - dtolnay:negspace, r=Aaron1011
Remove space after negative sign in Literal to_string

Negative proc macro literal tokens used to be printed with a space between the minus sign and the magnitude. That's because `impl ToString for Literal` used to convert the Literal into a TokenStream, which splits the minus sign into a separate Punct token.

```rust
Literal::isize_unsuffixed(-10).to_string()  // "- 10"
```

This PR updates the ToString impl to directly use `rustc_ast::token::Lit`'s ToString, which matches the way Rust negative numbers are idiomatically written without a space.

```rust
Literal::isize_unsuffixed(-10).to_string()  // "-10"
```
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions