Closed jyn514 closed 1 year ago
The relevant code looks like https://github.com/rust-lang/rust/blob/3df55382d46842dcaeff48ea83e0107183550dd6/compiler/rustc_middle/src/ty/print/pretty.rs#L999-L1003, which ... seems fine?
cc @compiler-errors, I see you were the last one to touch that pretty-printing code.
If this is the consequence of the pretty printing infrastructure, then I'd expect we'd see in in more places than just measureme.
So it wasn't rustc_middle::ty::pretty
but it was rustc_ast_pretty
's fault, since the impl Trait
in the examples given by jyn were APITs.
I don't remember the details of the encoding but I do remember that it assigns special meaning to certain ASCII control characters in order to be space efficient. I doubt, however, that newlines are affected by that.
I can look into relaxing the checks here, but unless we consider it high priority, it will probably be a while before I get to that.
I doubt, however, that newlines are affected by that.
Yes they are. I did actually run into this while first wiring up cranelift's profiling system to -Zself-profile
in cg_clif. Initially I just replaced all \n
with |
to workaround this, but also changed cranelift's profiling system to allow a proper integration later.
I doubt, however, that newlines are affected by that.
What I mean is: I doubt that newlines really have a reserved meaning in the encoding -- so it's probably fine to relax the requirements here 🙂
Should this issue be kept open for when someone does need a newline in an argument?
@michaelwoerister made a suggestion last night but forgot to post the PR. posted it now. if you have something better in mind I can close it
It got closed again by a subtree sync...
I am not sure whether this is a rustc bug or a measureme bug so I'm reporting it here under the theory that it's more likely to be seen by the right people :)
I ran
on https://github.com/rust-lang/rust/commit/ba6f5e3b4d60ea5a847cd4402cca594cd40b218f. That generated a .mm_profdata file that the measureme tools fail to parse:
It looks like
FnOnce
impls are getting an extra newline generated at the end. That seems like a bug we should fix in rustc, but not such a bad bug that it should prevent measureme from generating a report - could we translated it to an ASCII space instead, maybe?