Fix a splat legacy demangling display bug - #160050
Conversation
|
r? @camelid rustbot has assigned @camelid. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment was marked as resolved.
This comment was marked as resolved.
c82af0a to
980ae5d
Compare
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
980ae5d to
1099c87
Compare
| // there are arguments before the splat. | ||
| // FIXME(splat): if splatting becomes part of the type, we can remove this hack | ||
| if index > 0 { | ||
| write!(self, ",")?; |
There was a problem hiding this comment.
There should be a space after the comma too.
| write!(self, ",")?; | |
| write!(self, ", ")?; |
There was a problem hiding this comment.
Spacing unfortunately depends on the pretty-printing context, so I think I'll need to modify the trait definition and implementers. But it should be less code overall, which is nice.
rust/compiler/rustc_middle/src/ty/print/pretty.rs
Lines 292 to 300 in b5be620
rust/compiler/rustc_symbol_mangling/src/legacy.rs
Lines 490 to 498 in b5be620
There was a problem hiding this comment.
I ended up adding a comma_sep_has_space method, refactoring the near-duplicate comma_sep methods, and adding comments where we might want to do a similar fix in future.
(We don't currently have non-mangling pretty-printing tests for splat, and that's ok, it's an incomplete feature.)
@rustbot ready
1099c87 to
149a65c
Compare
149a65c to
9f6099c
Compare
This comment has been minimized.
This comment has been minimized.
9f6099c to
8db7925
Compare
This comment has been minimized.
This comment has been minimized.
8db7925 to
511d292
Compare
This comment has been minimized.
This comment has been minimized.
|
Failed due to a 15 digit crate hash in v0 demangling, which might be a bug to fix in demangling. This failure isn't splat related, it might happen on 1/16 of PRs (or changes to this test) anyway. Asked for advice here: |
This comment was marked as resolved.
This comment was marked as resolved.
|
It looks like we're stalled on the rustc-demangle side here, so I might redesign these tests so they're not blocked on it. |
This comment was marked as resolved.
This comment was marked as resolved.
2a26add to
707e045
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
707e045 to
e578f5c
Compare
This comment has been minimized.
This comment has been minimized.
e578f5c to
2a313d7
Compare
|
@rustbot ready I changed this PR to accept 8-16 character crate hashes in normalisation regexes, so it no longer depends on rust-lang/rustc-demangle#94 being reviewed, merged, and updated in rustc's deps. This is consistent with the normalisation approach taken in the UI test framework. |
View all comments
Tracking issue: #153629
This PR fixes a splat legacy demangling display bug, where the comma is in the wrong place in the argument list.
It also does a cleanup from @folkertdev's PR #159643 review:
@rustbot label +F-splat +C-bug +A-name-mangling
Edit: this PR now accepts 8-16 character crate hashes in normalisation regexes, so it no longer depends on rust-lang/rustc-demangle#94 being reviewed, merged, and updated in rustc's deps