-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Added more const_closure functionality #102276
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
932c33b
to
d4e5e0b
Compare
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.
This is an internal change so I don't think this would interfere with new developments and discussions around the feature.
b9695f4
to
fa93a1a
Compare
@bors r+ rollup |
📌 Commit fa93a1a476d53dbd93c0eef12a330a60c1915f38 has been approved by It is now in the queue for this repository. |
@bors r- |
library/core/src/const_closure.rs
Outdated
{ | ||
extern "rust-call" fn call_mut(&mut self, args: ClosureArguments) -> Self::Output { | ||
#[allow(non_snake_case)] | ||
let ($($var),*) = &mut self.data; | ||
(self.func)(($($var),*), args) | ||
} | ||
} | ||
|
||
impl<'a, CapturedData: ?Sized, ClosureArguments, Function, ClosureReturnValue> const | ||
FnMut<ClosureArguments> for ConstFnMutClosure<'a, CapturedData, Function> | ||
where | ||
Function: ~const Fn(&mut CapturedData, ClosureArguments) -> ClosureReturnValue, | ||
{ | ||
extern "rust-call" fn call_mut(&mut self, args: ClosureArguments) -> Self::Output { | ||
(self.func)(self.data, args) | ||
} | ||
} | ||
}; | ||
} |
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.
Sorry for the nits, but this isn't formatted properly. The last brace should have no spaces before them, and all of these should have four spaces.
r=me once you are done
@bors delegate+ After you are done, mention bors and |
✌️ @chriss0612 can now approve this pull request |
fa93a1a
to
10739d4
Compare
@bors r=fee1-dead |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#102276 (Added more const_closure functionality) - rust-lang#102382 (Manually order `DefId` on 64-bit big-endian) - rust-lang#102421 (remove the unused :: between trait and type to give user correct diag…) - rust-lang#102495 (Reinstate `hir-stats.rs` test for stage 1.) - rust-lang#102505 (rustdoc: remove no-op CSS `h3.variant, .sub-variant h4 { border-bottom: none }`) - rust-lang#102506 (Specify `DynKind::Dyn`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Enables ConstFnMutClosure to use a tuple of mutable references instead of just a mutable reference to a tuple.
Removes the new function, since it would barely be usable with this new code.
r? @fee1-dead