-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Fix overly restrictive lifetime in core::panic::Location::file
return type
#132087
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
base: master
Are you sure you want to change the base?
Conversation
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.
Maybe adding a regression test in library/core/tests/panic/location.rs
would be nice.
That's a great idea! I'll implement that. UPDATE: Implemented. It's a bit of a strange test, since it fails through a compiler error instead of a runtime panic, but I think that's necessary considering lifetimes and the borrow checker only exists at compile time. |
Hmm, this is "overly restrictive" in the current implementation, but sometimes that's on purpose to give implementation freedom. For instance, we couldn't use The breaking change of the function type is unlikely to be a problem IMO, but the API team should review it overall. @rustbot label -T-libs +T-libs-api |
☔ The latest upstream changes (presumably #135937) made this pull request unmergeable. Please resolve the merge conflicts. |
@ijchen any updates on this? this requires resolving conflicts in order to move ahead and if you are ready for a review you can click on »Ready for review« so it changes it from a draft. |
0ff917b
to
8a0438f
Compare
Thanks for the poke! I've resolved merge conflicts, although it looks like the source code has changed a bit since I left off. |
This comment has been minimized.
This comment has been minimized.
@rfcbot merge |
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
Fixes #131770 by relaxing the lifetime to match what's stored in the struct. See that issue for more details and discussion.
Since this is a breaking change, I think a crater run is in order. Since this change should only have an effect at compile-time, I think just a check run is sufficient.