-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Add method for reborrowing SystemParam types #22029
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
Conversation
b5f2187 to
6bc764e
Compare
I would have expected As with |
It's a pretty rare exception. In custom system params a user could write |
6bc764e to
e268b51
Compare
Oh, wow, that's subtle! ... Oh, I see, and you have a conditional I'd personally still lean towards combining the traits. The cost of requiring |
e268b51 to
5c6ff23
Compare
fix all impls
5c6ff23 to
34af904
Compare
|
closing these for now, will wrap into a later PR if perf looks good |
Objective
Blocked on: #22025
Next steps:
impl_reborrow_system_param!(...). I decided not to at least at first, though it wouldn't be too hard.ReborrowQueryDatain theory, but it might be controversial:System::scopeSolution
Add a optional
ReborrowSystemParamsubtrait, almost identical toReborrowQueryDataWhile most system params should implement this trait, there's a few exceptions like
ParamSettypes with invariant lifetimes, which we can't shorten AFAICT. Maybe if we changedParamSet::Itemto shorten the inner lifetime as well?