-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use std::panic::Location
to get log location information
#599
Use std::panic::Location
to get log location information
#599
Conversation
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.