-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Fix overly restrictive lifetime in core::panic::Location::file
return type
#132087
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. |
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.