We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 697a723 commit 72d3f9cCopy full SHA for 72d3f9c
src/stack_pin.rs
@@ -10,7 +10,7 @@
10
/// ```
11
#[macro_export]
12
macro_rules! pin_mut {
13
- ($($x:ident),*) => { $(
+ ($($x:ident),* $(,)?) => { $(
14
// Move the value to ensure that it is owned
15
let mut $x = $x;
16
// Shadow the original binding so that it can't be directly accessed
tests/stack_pin.rs
@@ -9,4 +9,13 @@ fn stack_pin() {
9
let foo = Foo {};
pin_mut!(foo);
let _: Pin<&mut Foo> = foo;
+
+ let bar = Foo {};
+ let baz = Foo {};
+ pin_mut!(
+ bar,
17
+ baz,
18
+ );
19
+ let _: Pin<&mut Foo> = bar;
20
+ let _: Pin<&mut Foo> = baz;
21
}
0 commit comments