Merge pull request #512 from camelid/unit-update

Impl `Update` for unit type `()`
This commit is contained in:
Niko Matsakis 2024-07-22 09:27:09 +00:00 committed by GitHub
commit 5f35a3529d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -337,6 +337,7 @@ macro_rules! tuple_impl {
let ($($t,)*) = new_value;
let ($($u,)*) = unsafe { &mut *old_pointer };
#[allow(unused_mut)]
let mut changed = false;
$(
unsafe { changed |= Update::maybe_update($u, $t); }
@ -348,6 +349,7 @@ macro_rules! tuple_impl {
}
// Create implementations for tuples up to arity 12
tuple_impl!(;);
tuple_impl!(A; a);
tuple_impl!(A, B; a, b);
tuple_impl!(A, B, C; a, b, c);