chore: checkpoint before Python removal

This commit is contained in:
2026-03-26 22:33:59 +00:00
parent 683cec9307
commit e568ddf82a
29972 changed files with 11269302 additions and 2 deletions

27
vendor/pin-utils/tests/projection.rs vendored Normal file
View File

@@ -0,0 +1,27 @@
use pin_utils::{unsafe_pinned, unsafe_unpinned, pin_mut};
use std::pin::Pin;
use std::marker::Unpin;
struct Foo<T1, T2> {
field1: T1,
field2: T2,
}
impl<T1, T2> Foo<T1, T2> {
unsafe_pinned!(field1: T1);
unsafe_unpinned!(field2: T2);
}
impl<T1: Unpin, T2> Unpin for Foo<T1, T2> {} // Conditional Unpin impl
#[test]
fn projection() {
let foo = Foo { field1: 1, field2: 2 };
pin_mut!(foo);
let x1: Pin<&mut i32> = foo.as_mut().field1();
assert_eq!(*x1, 1);
let x2: &mut i32 = foo.as_mut().field2();
assert_eq!(*x2, 2);
}

21
vendor/pin-utils/tests/stack_pin.rs vendored Normal file
View File

@@ -0,0 +1,21 @@
#![forbid(unsafe_code)] // pin_mut! is completely safe.
use pin_utils::pin_mut;
use core::pin::Pin;
#[test]
fn stack_pin() {
struct Foo {}
let foo = Foo {};
pin_mut!(foo);
let _: Pin<&mut Foo> = foo;
let bar = Foo {};
let baz = Foo {};
pin_mut!(
bar,
baz,
);
let _: Pin<&mut Foo> = bar;
let _: Pin<&mut Foo> = baz;
}