Use std::panic::Location to get log location information#599
Use std::panic::Location to get log location information#599pwoolcoc wants to merge 1 commit intorust-lang:masterfrom
std::panic::Location to get log location information#599Conversation
|
At some point I deleted the fork that I used to open #410, so this is just the updated version of that PR. I have removed the feature gate for this, as it was suggested that since the MSRV is now 1.60.0, this feature should be unconditional. |
Thomasdezeeuw
left a comment
There was a problem hiding this comment.
Can you remove the line! and file! macros?
|
@EFanZh I know you are/were interested in reducing the code size of |
d3f2eee to
1dc2526
Compare
Done! |
@Thomasdezeeuw Yes, I think I can have the result in a few days after my comment being addressed. |
1dc2526 to
54a2103
Compare
|
I have tested this PR on my project, I see an observable size increasing of the result binary. It seems that currently the compiler can’t optimize this implementation well: https://godbolt.org/z/1E4fWKv34. |
I tried adding |
|
I think the problem is that additional function calls somehow prevent the compiler from treating constant values as static values: https://godbolt.org/z/57K9hdEcc. |
I don't really have a good solution for this. Maybe it's worth opening a discussion on rustc's Zullip? Or an issue in the rustc tracker? |
|
@Thomasdezeeuw I have submitted an issue here: rust-lang/rust#118557. |
|
This seems useful for helpers marked with If there's interest I can try to get a PR up |
|
Maybe we can change the I'm not sure introducing complexity with a conditional would be the best way forward, but we can experiment with it. |
No description provided.