You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
376 B
22 lines
376 B
#![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;
|
|
}
|